Skip to content

Instantly share code, notes, and snippets.

View ruyrybeyro's full-sized avatar

Rui Ribeiro ruyrybeyro

View GitHub Profile
@terminalfool
terminalfool / bind_config.pl
Created March 27, 2012 13:39
A BIND ad filter refresh script. Loads ad domains from adblock plus filters
#!/usr/bin/perl
use strict;
use Proc::Simple;
use Proc::Killall;
use Time::localtime;
use LWP::Simple qw($ua getstore);
$ua->agent("");
use Mozilla::CA;
@acidprime
acidprime / genMachineCert.py
Created September 12, 2013 01:12
Generate a new CSR sing M$ CA services
#!/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python
openssl = '/usr/bin/openssl'
curl = '/usr/bin/curl'
sed = '/usr/bin/sed'
kinit = '/usr/bin/kinit'
import urllib
import re
from subprocess import Popen, PIPE, STDOUT
## Get TGT via kinit - If 2k3, use password method if 2k8
@ozaki-r
ozaki-r / dtrace-arm.patch
Last active January 3, 2016 23:29
Porting DTrace on NetBSD to ARM.
Index: external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S
===================================================================
RCS file: /cvs/cvsroot/src/external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S,v
retrieving revision 1.3
diff -u -r1.3 dtrace_asm.S
--- external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S 5 Mar 2014 03:09:17 -0000 1.3
+++ external/cddl/osnet/dev/dtrace/arm/dtrace_asm.S 10 Mar 2014 05:47:33 -0000
@@ -203,13 +202,24 @@
void dtrace_invop_init(void)
*/
@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
@ruskotron
ruskotron / key_decode.py
Created January 14, 2015 09:13
Decode MS-MPPE-Send-Key / MS-MPPE-Recv-Key
from hashlib import md5
from binascii import unhexlify, hexlify
seq_xor = lambda c, b: ''.join(
chr(x) for x in map(lambda X: ord(X[0]) ^ ord(X[1]), zip(c, b))
)
#
@mcnewton
mcnewton / freeradiuscheck.sh
Last active April 27, 2020 14:50
Check that FreeRADIUS stack is running
#! /bin/bash
CONFIG_DISK_THRESHOLD=95
FR_PIDFILE=/var/run/freeradius/freeradius.pid
FR_BINARY=/usr/sbin/freeradius
DATE_MIN=$(date +%_M)
TEST_USER=checkuser
TEST_DOMAIN=my.domain.example
TEST_PASSWORD=password
@mfriedenhagen
mfriedenhagen / password_from_keyring.py
Last active January 3, 2018 05:14
A simple keyring based password provisioner for ansible
"""
Store this file as `vars_plugins/password_from_keyring.py` and specify the
following in `ansible.cfg`:
```
[defaults]
vars_plugins=./vars_plugins
```
In your inventory specify:
@thisismitch
thisismitch / haproxy.cfg
Last active November 11, 2023 04:08
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@mpeven
mpeven / captive_portal.sh
Last active January 10, 2023 00:47
iOS captive portal
# Captive portal setup
########################################################
sudo apt-get update -qq
sudo apt-get install -qq dnsmasq vim hostapd ufw dnsutils netstat-nat conntrack nginx php5 php5-common php5-fpm
sudo mkdir /usr/share/nginx/html/portal
sudo useradd nginx
sudo chown nginx:www-data /usr/share/nginx/html/portal
sudo chmod 755 /usr/share/nginx/html/portal
########################################################
@BalorPrice
BalorPrice / simple_scroll.asm
Last active March 13, 2023 22:55
Simple ZX Spectrum scroller - amended from John Metcalf's 69-byte scroller
org 32768
init_scroll:
ld hl,message-1 ; set to refresh char on first call
ld (scroll_pos),hl
ld hl,pix_count ; variable to check if new character needed
ld (hl),1
ret
update_scroll: