Skip to content

Instantly share code, notes, and snippets.

@dalhundal
dalhundal / namecheap-ddns.sh
Created May 4, 2014 16:48
Shell script to update namecheap.com dynamic dns for a domain with your external IP address
#!/bin/sh
# Shell script to update namecheap.com dynamic dns
# for a domain to your external IP address
HOSTNAME=yoursubdomain
DOMAIN=yourdomainname.com
PASSWORD=y0urp455w0rd
IP=`curl -s echoip.com`
@alvarow
alvarow / apache-xff-log.conf
Created February 9, 2017 17:48
Sets Apache Log of the X-Forwarded-For client IP address or the real client ip address if the X-Forwarded-For header does not exist.
# Log the X-Forwarded-For client IP address or the real client ip address if the X-Forwarded-For header does not exist.
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog "logs/access_log" combined env=!forwarded
CustomLog "logs/access_log" proxy env=forwarded
@j-jith
j-jith / miui-fastboot-howto.rst
Last active May 17, 2024 11:34
How to flash MIUI Fastboot ROM from Linux

How to flash MIUI Fastboot ROM from Linux

@jaddison
jaddison / suprnova_check.sh
Created January 10, 2018 03:59
Suprnova JSON API hash/share rate & balance script
#!/bin/bash
if [[ ! -v SUPRNOVA_KEY ]]
then
echo -e "SUPRNOVA_KEY environment variable isn't set.\n\nThis should be the API key from your Suprnova account."
exit 1
fi
if [[ ! -v SUPRNOVA_TARGET ]]
then
echo -e "SUPRNOVA_TARGET environment variable isn't set.\n\nThis should be 'zcl' if you are connecting to 'zcl.suprnova.cc'"
@lukpueh
lukpueh / say_lte.py
Created May 24, 2018 10:38
Script to help me position my `Alcatel Linkhub HH40v` LTE modem for the best signal strength
#!/usr/bin/env python
"""
<Program Name>
say_lte.py
<Author>
Lukas Puehringer <luk.puehringer@gmail.com>
<Purpose>
Script to help me position my `Alcatel Linkhub HH40v` LTE modem for the
@jarek-przygodzki
jarek-przygodzki / node_exporter-as-systemd-service.md
Last active May 31, 2024 16:11
Installing node_exporter as systemd serivice
sudo useradd --system --shell /bin/false node_exporter
curl -fsSL https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz \
  | sudo tar -zxvf - -C /usr/local/bin --strip-components=1 node_exporter-1.3.1.linux-amd64/node_exporter \
  && sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
@bmatthewshea
bmatthewshea / show_ssl_expire
Last active March 1, 2023 22:13
Retrieve/Check SSL certificate expiration date(s)
#!/bin/bash
# By B Shea Dec2018 & Mar2020
# https://www.holylinux.net
# Test for OpenSSL - if not installed stop here.
if ! [[ -x $(which openssl) ]]; then
printf "\nOpenSSL not found or not executable.\nPlease install OpenSSL before proceeding.\n\n"
exit 1
fi
@gabriel-v
gabriel-v / how_to_wireguard.sh
Last active February 4, 2024 22:20
Wireguard configuration for dummies
# install
firefox https://www.wireguard.com/install/
# for macOS use the brew/ports version, not the app
# be root
sudo -i
mkdir /etc/wireguard || true
cd /etc/wireguard
# create keys
@marfillaster
marfillaster / dual.cfg
Last active March 28, 2024 06:32
Mikrotik dual/triple dhcp wan recursive failover w/ pcc load balancing
/interface bridge add name=bridge
/interface bridge port
add bridge=bridge interface=ether3
add bridge=bridge interface=ether2
add bridge=bridge interface=ether1
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
@aslafy-z
aslafy-z / _huawei-sms-forwarder.md
Last active November 1, 2023 22:59
Forward SMS from Huawei LTE router to another number

Forward SMS from Huawei LTE router to another number

Dependencies

Usage

export HUAWEI_ROUTER_IP_ADDRESS="" # Router IP address