Skip to content

Instantly share code, notes, and snippets.

View ruyrybeyro's full-sized avatar

Rui Ribeiro ruyrybeyro

View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@mardahl
mardahl / updateSfBGAL.ps1
Last active January 2, 2023 17:03
Script to force update Skype for Business Clients Global Address List
<#
.SYNOPSIS
Script to force update Skype for Business Clients Global Address List Written by Michael Mardahl (iphase.dk)
(Provided AS-IS! I will not be held liable for any negative consequences)
.DESCRIPTION
This script will shutdown the SfB client, update the registry and delete the GAL DB, then start the client again. It should be run in the users context as it does user specific things.
.EXAMPLE
Just run the script without parameters
@jblang
jblang / disz80.asm
Created May 14, 2018 01:04
John Kerr's DIS-Z80 with Comments
SECTION code_clib
PUBLIC disz80
PUBLIC _disz80
EXTERN fputc_cons
; This code is been found in a ZX Spectrum tool called UTILITY3 v1.3
@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:
@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
########################################################
@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
@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:
@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
@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))
)
#
@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