Skip to content

Instantly share code, notes, and snippets.

View avidsapp's full-sized avatar

David Sapp avidsapp

View GitHub Profile
@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
@dnburgess
dnburgess / gist:afee89678005424e0c68e8111d4be155
Last active November 18, 2022 00:16
DB Tech Duplicati on Pi 4
---
version: "2.1"
services:
duplicati:
image: linuxserver/duplicati
container_name: duplicati
environment:
- PUID=998
- PGID=100
- TZ=America/Denver
@justinemter
justinemter / block-multiple-countries.sh
Last active March 10, 2021 19:59
Block multiple countries using iptables and ipset
#!/bin/bash
declare -a ISO=("af" "au" "al" "dz" "aq" "br" "ar" "cn" "lb" "my" "ly" "lr" "la" "jp" "jm" "jo" "kz" "ke" "hk" "ml" "mx" "fm" "md" "mc" "mn" "ms" "ma" "mz" "mm" "nr" "na" "np" "nl" "an" "nc" "nz" "ni" "ne" "ng" "nu" "nf" "mp" "no" "om" "pk" "pw" "pa" "pg" "py" "pe" "ph" "pn" "pl" "pt" "pr" "qa" "re" "ro" "ru" "rw" "kn" "lc" "vc" "ws" "sm" "st" "sn" "sa" "sc" "sl" "sg" "sk" "si" "sb" "so" "za" "gs" "es" "lk" "sh" "pm" "sd" "sr" "sj" "sz" "se" "ch" "sy" "tw" "tj" "tz" "th" "tg" "tk" "to" "tt" "tn" "tr" "tm" "tc" "tv" "ug" "ua" "ae" "gb" "um" "uy" "uz" "vu" "ve" "vn" "vg" "vi" "wf" "eh" "ye" "yu" "zm" "zw" "ie" "in" "il" "ir" "hn" )
declare -a zone_file_names_ext=()
# remove any old list that might exist from previous runs of this script
find /tmp -name '*.zone' -or -name '*.zone.1' | xargs rm
for i in "${ISO[@]}"
do
zone_file_names_ext+=( "$i.zone" )
@adilsoncarvalho
adilsoncarvalho / README.md
Last active August 22, 2022 12:00
Deploying a firebase function from Bitbucket pipelines

Deploying functions from Bitbucket Pipelines

It's quite easy and the same process applies to all Firebase features with minor changes.

Acquire a deployment token

In order to deploy you'll need a deployment token (I named it FIREBASE_TOKEN) and it can be acquired by using the following command

firebase login:ci

@darencard
darencard / auto_git_file.md
Last active August 23, 2024 13:41
Automatic file git commit/push upon change

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active November 3, 2024 17:14
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@hleb-albau
hleb-albau / video-encode.py
Last active October 19, 2023 17:17
Simple python script to encode videos using ffmpeg
"""
This python script encodes all files in specified working directory.
Sources: http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
command: python video-encode.py /dir/to/encode
output: /dir/to/encode/encoded
"""
@ed-flanagan
ed-flanagan / geo_distance.js
Created July 29, 2015 10:40
Great-circle distance formulas in JavaScript
var earth_radius_km = 6371.0;
function deg_to_rad(deg) {
return (deg * Math.PI / 180.0);
}
function haversine_distance(latitude1, longitude1, latitude2, longitude2) {
var lat1 = deg_to_rad(latitude1);
var lng1 = deg_to_rad(longitude1);
var lat2 = deg_to_rad(latitude2);
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active July 3, 2024 02:22
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@ungoldman
ungoldman / dokku_setup.md
Last active November 28, 2023 12:35
Deploy your own PaaS: Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.


This write-up is several years out of date! You probably shouldn't use it.