Skip to content

Instantly share code, notes, and snippets.

@labeneator
labeneator / debian-stretch-archived-sources.list
Created May 15, 2023 10:29
Sources list for debian stretch which is now archived. Covers debian security too. Takes care of errors such as E: The repository 'http://security.debian.org/debian-security stretch/updates Release' does no longer have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secu…
# lmwangi@db:~$ grep -v '#' /etc/apt/sources.list
deb http://archive.debian.org/debian/ stretch main
deb http://archive.debian.org/debian-archive/debian-security stretch/updates main
@labeneator
labeneator / firewall.sh
Created March 28, 2023 15:52 — forked from albertogg/firewall.sh
EdgeRouter Lite configuration
# This configuration is based on the Wizard config and also the these ones:
# https://blog.dlasley.net/2013/06/initial-configuration-ubiquiti-edgerouter-lite/
# http://lg.io/2015/01/11/the-ubiquiti-edgerouter-configuring-this-extremely-lowcost-enterprisegrade-router-for-home-use.html
#
# Create simple firewall rules for Inbound wan to lan and local router
edit firewall
set all-ping enable
set broadcast-ping disable
set ipv6-receive-redirects disable
set ipv6-src-route disable
@labeneator
labeneator / README.md
Created April 15, 2021 12:54 — forked from magnetikonline/README.md
BIND - delegate a sub domain for a zone.

BIND - delegate a sub domain for a zone

The scenario:

  • DNS zone myzone.com defined in BIND.
  • Authoritative name server at 123.16.123.1.
  • Subzone sub.myzone.com with an authoritative name server at 123.16.123.10.
  • Wishing to forward sub-zone to authoritative name server.

Config

$ORIGIN myzone.com.
@labeneator
labeneator / auto_type_kra.au3
Last active July 19, 2019 11:57
Save a csv somewhere in your windows. Download and install autoit, open the scite editor and paste the *auto_type_kra.au3* file below into it. Make sure your csv is store as c:\kra_vat.csv, click run and switch to the excel program
#include <File.au3>
WinWaitActive("Microsoft Excel (Product Activation Failed)")
$file = "c:\kra_vat.csv"
FileOpen($file, 0)
@labeneator
labeneator / etc_cron.d_ubnt_metrics
Last active August 28, 2021 17:40
Script to send SNMP metrics from Ubiquiti devices to graphite.
* * * * * root /usr/local/bin/send_metrics.sh
@labeneator
labeneator / _etc_cron.d_apc_metrics
Created January 2, 2019 12:48
Sends APC UPS metrics to graphite by running apcaccess cmd on Linux.
* * * * * root python /usr/local/bin/send_apc_metrics.py --carbon-host metrics.yourcompany.co.ke 2>&1 | logger -t "apc_metrics"
@labeneator
labeneator / etc_cron.d_ubnt_metrics
Created September 18, 2018 08:11
Simple Cron invoked job to send metrics from airmax devices to Carbon-cache (Graphite).
* * * * * root /usr/local/bin/send_metrics.sh
@labeneator
labeneator / postgres_app_madlib
Created July 3, 2018 16:20
Install madlib into Postgres.app on OS
# Download and install the dmg for postgres.app
# Download the madlib dmg and install it
# Change your version appropriately
❯ PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.6/bin/ [19:16:16]
# add languages to postgres
❯ psql
CREATE EXTENSION plpythonu;
@labeneator
labeneator / postgres_app_madlib
Created July 3, 2018 16:19
Install madlib into Postgres.app on OS
❯ PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.6/bin/ [19:16:16]
# add languages to postgres
❯ psql
CREATE EXTENSION plpythonu;
❯ /usr/local/madlib/bin/madpack -s madlib -p postgres -c postgres@localhost:5432/pypos install -v [19:16:19]
madpack.py: INFO : Arguments: Namespace(command=['install'], connstr=['postgres@localhost:5432/pypos'], keeplogs=False, platform=['postgres'], schema=['madlib'], testcase='', tmpdir='/tmp/', verbose=True)
madpack.py: INFO : Testing database connection...
def deobs_pluralsight(fpath, target_dir):
fname = os.path.basename(fpath)
target_fname = fname.replace('psv', 'mp4')
target_file_path = os.path.join(target_dir, target_fname)
with open(target_file_path, "wb") as ofh:
for byte in bytearray(open(fpath, "rb").read()):
ofh.write(chr(byte ^ 101))