This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openfaas/of-watchdog:0.7.7 as watchdog | |
FROM python:3.7-slim-buster | |
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog | |
RUN chmod +x /usr/bin/fwatchdog | |
RUN apt-get -qy update | |
# Add non root user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task: | |
Access OpenVPN or any Service on Home Network from Public Networks (Hotel) without configuring router and without static IP | |
Step 1: | |
Install OpenVPN on any device connected to Home Network (Raspberry mychoice with pivpn) | |
- Change default OpenVPN protocol from UDP to TCP (Cloudflare doesn't support UDP) | |
- Make a note of TCP port number (default is 443) | |
- Grab the OpenVPN client config file | |
Step 2: | |
Install Cloudflared on Raspberry PI | |
- Create a tunnel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cloudflared tunnel login | |
cloudflared tunnel create tunnelName | |
cloudflared tunnel route dns tunnelName tunnelName.domain.com | |
#after this you can delete cert.pem file for security reasons from now on only tunnel crediential are sufficient | |
#Change port number as required, if ssh or rdp enable rendering in cloudflare teams | |
cloudflared tunnel run --url http://127.0.0.1:8000 tunnelName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install docker.io | |
sudo systemctl enable --now docker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rclone copy s3-Source:buckername s3-dest:bucker --progress --tpslimit 300 | |
Copy objects to new S3 remote bukcet with rclone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DictWithoutQuotedKeys(dict): | |
def __repr__(self): | |
s = "{" | |
for key in self: | |
s += "{0}:".format(key) | |
# if isinstance(self[key], str): | |
# # String values still get quoted | |
# s += "\"{0}\", ".format(self[key]) | |
# if isinstance(self[key], int): | |
# # String values still get quoted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = requests.get('https://api.github.com', auth=('user', 'pass')) | |
r is a response. It has a request attribute which has the information you need. | |
r.request.allow_redirects r.request.headers r.request.register_hook | |
r.request.auth r.request.hooks r.request.response | |
r.request.cert r.request.method r.request.send | |
r.request.config r.request.params r.request.sent | |
r.request.cookies r.request.path_url r.request.session | |
r.request.data r.request.prefetch r.request.timeout | |
r.request.deregister_hook r.request.proxies r.request.url |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.