Skip to content

Instantly share code, notes, and snippets.

View rameshkrishna's full-sized avatar
🎯
Focusing

Ramesh Krishna rameshkrishna

🎯
Focusing
View GitHub Profile
@rameshkrishna
rameshkrishna / Dockerfile
Created February 14, 2022 02:48
openfass-python-flask
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
@rameshkrishna
rameshkrishna / openvpncloudlared.txt
Last active May 20, 2024 07:04
OpenVPN with Cloudflared Tunnels - No Port Fowarding - No Static IP - NO DDNS
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
@rameshkrishna
rameshkrishna / cloudflaredinstall.sh
Last active August 13, 2021 11:56
Cloudflared Tunnel
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
@rameshkrishna
rameshkrishna / tesseract_patterns_triaining_file
Last active July 16, 2021 13:23
tesseract_patterns_triaining_file
// Inserts the list of patterns from the given file into the Trie.
// The pattern list file should contain one pattern per line in UTF-8 format.
//
// Each pattern can contain any non-whitespace characters, however only the
// patterns that contain characters from the unicharset of the corresponding
// language will be useful.
// The only meta character is '\'. To be used in a pattern as an ordinary
// string it should be escaped with '\' (e.g. string "C:\Documents" should
// be written in the patterns file as "C:\\Documents").
// This function supports a very limited regular expression syntax. One can
@rameshkrishna
rameshkrishna / dockerinstall.sh
Created July 16, 2021 02:03
Install Docker on Ubuntu from Ubntu Repo
sudo apt install docker.io
sudo systemctl enable --now docker
rclone copy s3-Source:buckername s3-dest:bucker --progress --tpslimit 300
Copy objects to new S3 remote bukcet with rclone
@rameshkrishna
rameshkrishna / DictWihtoutQuotes.py
Created May 15, 2020 07:49
Dict Without Quotes Python
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
@rameshkrishna
rameshkrishna / python requests debugging
Created May 15, 2020 07:21
Debgguing Python Requests
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
@rameshkrishna
rameshkrishna / kaggleDatasetsDL.ipynb
Created April 14, 2020 00:40
Download Kaggle Datasets in Notebook / Google Colab / Azure Notebook / Jupyter notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.