Skip to content

Instantly share code, notes, and snippets.

@arsperger
arsperger / keybase.md
Created June 15, 2017 13:05
keybase proof

Keybase proof

I hereby claim:

  • I am arsperger on github.
  • I am arsperger (https://keybase.io/arsperger) on keybase.
  • I have a public key whose fingerprint is 7134 49D2 08E4 33D4 B2B7 131E 1581 B6D8 AAB4 7E71

To claim this, I am signing this object:

@arsperger
arsperger / homer_ubuntu_16.04_.md
Last active May 28, 2021 04:26
Install Homer Debian Ubuntu 16.04
@arsperger
arsperger / homer_kazoo.md
Created September 6, 2017 23:24
setup kazoo with homer

SIPCAPTURE / HOMER

  • You need this the moment you have more then 1 machine for Kazoo.

Preferred way

@arsperger
arsperger / redis_import_csv.txt
Created September 12, 2017 11:38
import csv file into redis with a single command
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe
@arsperger
arsperger / abandonallhopes.sh
Created December 24, 2017 10:23
Simple script to stop SIP DDoS attack with Iptables rules
#!/bin/bash
iptables -N SIPDDOS
iptables -A INPUT -p all -m string --string "sundayddr" --algo bm --to 65535 -m comment --comment "deny sundayddr" -j SIPDDOS
iptables -A INPUT -p all -m string --string "sipsak" --algo bm --to 65535 -m comment --comment "deny sipsak" -j SIPDDOS
iptables -A INPUT -p all -m string --string "sipvicious" --algo bm --to 65535 -m comment --comment "deny sipvicious" -j SIPDDOS
iptables -A INPUT -p all -m string --string "friendly-scanner" --algo bm --to 65535 -m comment --comment "deny friendly-scanner" -j SIPDDOS
iptables -A INPUT -p all -m string --string "iWar" --algo bm --to 65535 -m comment --comment "deny iWar" -j SIPDDOS
iptables -A INPUT -p all -m string --string "sip-scan" --algo bm --to 65535 -m comment --comment "deny sip-scan" -j SIPDDOS
@arsperger
arsperger / cgr-tester-LCR.py
Created June 14, 2018 11:07
Python script for various test of CGRateS engine.
# jsonclient.py
# A simple JSONRPC client library, created to work with Go servers
# Written by Stephen Day
# Modified by Bruce Eckel to work with both Python 2 & 3
import json, socket, itertools, time
from datetime import datetime
class JSONClient(object):
def __init__(self, addr, codec=json):
@arsperger
arsperger / iptables.sh
Created June 10, 2020 18:07 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@arsperger
arsperger / import-private-go-modules-from-gitlab-repositories
Created June 17, 2020 10:12
How to import private go module from private gitlab repo
## 1
# make git use SSH instead of HTTPS
git config --global url."git@gitlab.com:".insteadof="https://gitlab.com"
# or edit .gitconfig
[url "git@gitlab.com:"] insteadOf = https://gitlab.com
## 2
# in gitlab repo and create access tocken

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@arsperger
arsperger / vimdiff.md
Last active April 13, 2021 06:08 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

Vimdiff cheat sheet

git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)