Skip to content

Instantly share code, notes, and snippets.

@pacmac
pacmac / HY28A-00A0.dts
Last active August 29, 2015 14:07
bblack_arch
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation. *
dtc -O dtb -o HY28A-00A0.dtbo -b 0 -@ HY28A-00A0.dts
cp HY28A-00A0.dtbo /lib/firmware/
echo HY28A > /sys/devices/bone_capemgr.9/slots *
@pacmac
pacmac / ssh_tunnel
Created May 11, 2019 11:08
SSH Tunnel
/etc/ssh/sshd_config
AllowTcpForwarding yes
GatewayPorts yes
## Listens on 222 and forwards to example.com:22
ssh -f -N -L *:222:*:22 example.com
@pacmac
pacmac / sniproxy-install.sh
Last active June 23, 2019 09:26
Install sniproxy
## curl -o bashrc.pac -L https://gist.github.com/pacmac/348d9db22dbe90bbe0942d6c642a79b5/raw/
apt-get install autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev pkg-config git -y
cd ~
mkdir udns
cd udns
wget http://ftp.de.debian.org/debian/pool/main/u/udns/udns_0.4-1.dsc
wget http://ftp.de.debian.org/debian/pool/main/u/udns/udns_0.4.orig.tar.gz
wget http://ftp.de.debian.org/debian/pool/main/u/udns/udns_0.4-1.debian.tar.gz
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import SimpleHTTPServer
import SocketServer
from os import curdir, sep
import urllib
import subprocess
import time
import logging
[Unit]
Description=Dovecot Password Service
After=multi-user.target
Conflicts=getty@tty1.service
[Service]
Type=simple
WorkingDirectory=/root/http
ExecStart=/usr/bin/python /root/http/http.py
@pacmac
pacmac / xvpnping.sh
Last active January 5, 2020 07:41
expressvpn fastest host
#!/bin/ash
#
# /usr/share/scripts/xvpnping.sh yes
# expressvpn fastest host script
#
# /etc/openvpn/hosts"
# uk-berkshire-2-ca-version-2.expressnetw.com
# uk-east-london-ca-version-2.expressnetw.com
# uk-london-ca-version-2.expressnetw.com
# uk-kent-ca-version-2.expressnetw.com
#!/bin/sh
LINODE_API_KEY="12345"
DOMAIN_ID="12345"
SUB_NAME="my.sub.domain.com"
WAN_IP=`curl -s ipecho.net/plain`;
OLD_WAN_IP=`cat /tmp/CURRENT_WAN_IP.txt`
if [ "$WAN_IP" = "$OLD_WAN_IP" ]; then
echo "IP Unchanged"
#!/bin/sh
HOSTNAME="my.domain.com"
LOGFILE=$HOME/ufw.log
Current_IP=$(host $HOSTNAME | head -n1 | cut -f4 -d ' ')
if [ ! -f $LOGFILE ]; then
/usr/sbin/ufw insert 1 allow from $Current_IP to any port 22 proto tcp
echo $Current_IP > $LOGFILE
else
@pacmac
pacmac / linode-dns.sh
Last active December 19, 2019 06:37
linode update dns with APIV4
#!/bin/sh
TOKEN=""
DOMAIN_ID=""
RECORD_ID=""
WAN_IP=`curl -s ipecho.net/plain`;
OLD_WAN_IP=`cat /tmp/CURRENT_WAN_IP.txt`
func_go () {
curl -H "Content-Type: application/json" \
@pacmac
pacmac / pm2-root.service
Created February 19, 2020 04:36
PM2 Startup Script for systemctl
# /etc/systemd/system/pm2-root.service
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target
[Service]
Type=forking
User=root