Skip to content

Instantly share code, notes, and snippets.

@laduke
laduke / ztv6.md
Last active September 23, 2023 15:53
ZeroTier 6PLANE and RFC4193 address calculation

ZeroTier IPv6 Auto-Assign Addresses

https://www.zerotier.com/manual.shtml#2_2_3

  • A network ID is 16 hex digits (9bee8941b5de0691)
  • A node ID is 10 hex digits (1234512345)

ZeroTier RFC4193 (/128 for each device)

  • fd9b:ee89:41b5:de06:9199:9312:3451:2345

ZeroTier 6PLANE (/80 routable for each device)

@Nihisil
Nihisil / jail.local
Last active September 5, 2023 06:20
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
'''
Easy Mac
Copyright (2015) Sean Beck
Licensed under Creative Commons Attribution-ShareAlike 4.0 International
See: https://creativecommons.org/licenses/by-sa/4.0/
Easily change your MAC address on Linux using `ifconfig`
'''
#!/usr/bin/python2.7
@SeanTRobinson
SeanTRobinson / ConfluenceBackup.sh
Last active June 6, 2022 14:58
Backup Atlassian Jira and Confluence from the command line.
#!/bin/bash
USERNAME=<username>
PASSWORD=<password>
INSTANCE="<company>.atlassian.net"
LOCATION="./Backups/"
mkdir "Backups"
# Grabs cookies and generates the backup on the UI.
@aido
aido / Polipo-adblocker.sh
Created June 12, 2013 18:01
Use wget and sed to update Polipo forbidden file from http://easylist-downloads.adblockplus.org/easylist.txt
#!/bin/bash +xv
declare WGET=/usr/bin/wget
declare SED=/bin/sed
declare INVOKE=/usr/sbin/invoke-rc.d
#declare TORIFY=/usr/bin/torify
#declare TORRESOLVE=/usr/bin/tor-resolve
declare -i EXIT_VALUE=0
#include "mysql_connection.h"
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h>
#include <memory>
#include <fstream>
#include <vector>
#include <cstring>
@srbs
srbs / od.sh
Created October 7, 2012 07:16
diff any file using opendiff (svn, git, mercurial, fossil)
# function for .bash-profile or .bashrc
# od <file> [<file2>]
# diff's the given file using opendiff based on the file's vcs
# supports svn, git, mercurial, fossil, & CVS
# can specify any path, checks are done where the file is
# when file2 is specified, fall back to default opendiff behavior
od()
{
@srbs
srbs / updateall.sh
Last active May 17, 2016 07:36
Update all git/svn/mercurial repositories in any child directory of this script
#! /bin/bash
#guarantee you are in the directory you are in (src: http://stackoverflow.com/a/246128)
cd -P "$(dirname "$0")"
# basically traverse down all directories until you run across a
# .git/.svn/.hg/.fslckout/CVS directory/file, then update/pull the directory (stop traversing)
#updaterepo <folder type found> <path name to display>
@valvallow
valvallow / csv2sql.scm
Last active April 6, 2022 17:11
convert csv to insert|update sql query string
#!/usr/local/bin/gosh
(use srfi-1)
(use text.csv)
(use file.util)
(use util.list)
(use gauche.parseopt)
(define (usage)
(print "Usage: csv2sql [options ...] <csv-file>")
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/