Skip to content

Instantly share code, notes, and snippets.

View jsarenik's full-sized avatar

Ján Sáreník jsarenik

View GitHub Profile
@zbrdge
zbrdge / mDNSResponder.plist.patch
Created April 12, 2014 12:18
OS X Chroot mDNSResponder
--- /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist 2014-04-12 05:15:39.000000000 -0700
+++ /tmp/com.apple.mDNSResponder.plist.new 2014-04-12 05:15:11.000000000 -0700
@@ -26,6 +26,7 @@
<key>Sockets</key>
<dict>
<key>Listeners</key>
+ <array>
<dict>
<key>SockFamily</key>
<string>Unix</string>
nweb README for version 23
1) Bug fixed - was duplicating errors in the nweb.log file
- thanks to Kieran Grant for stopping this and pointing out the fix.
2) Added support for favicon.ico - if nothing elase this will stop annoying
errors in the log file. Most browsers on first encountering a webpage
also ask for this file. The name mean favourite icon - Wikipedia has
more on this. It is a tiny Bit Map image (normally called .bmp and
BMP editors can be used to create one - I used Windows Paint)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@lox
lox / mirror_test.sh
Last active November 7, 2023 17:33
A bash script to select the fastest ubuntu apt geo-mirror
#!/bin/bash -e
# mirror_test.sh
# benchmarks closest ubuntu mirrors and outputs them in speed order
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/lox/9152137/raw/mirror_test.sh)"
RELEASE=$(lsb_release -c -s 2>/dev/null || echo 14.04)
MIRRORS=$(curl -s http://mirrors.ubuntu.com/mirrors.txt)
TESTFILE="dists/$RELEASE/main/binary-amd64/Packages.bz2"
TIMEOUT=1
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@pezz
pezz / crypto-pi-root.md
Last active December 17, 2020 15:40
Archlinux ARM encrypted root

Intro

Just some FYI, to get started:

  • I'm using a 16 GB Sandisk SD card.
  • I have a model B Pi, 512 MB RAM (not really relevant, thought I'd mention it).
  • Monitor and keyboard connected to the Pi itself, for now.
  • Network working, internet access.
@taylor
taylor / HOWTO-bitlbee+hipchat.mkd
Created December 16, 2012 01:13
Using bitlbee with HipChat

Using bitlbee with HipChat

Initial setup

  • account add jabber USERNAME@chat.hipchat.com 'PASSWORD'
  • account hipchat set nick_source full_name
  • account hipchat set resource bot
  • account hipchat on
@packz
packz / 000.mkd
Created November 15, 2012 09:06
Static cryptsetup

I suppose you use Debian-like systems

$ mkdir rootdir && cd rootdir && export ROOTDIR=$PWD
$ apt-get source libdevmapper1.02.1
$ apt-get source cryptsetup
@jberger
jberger / gist:3916068
Created October 19, 2012 03:28
darabase app example
#!/usr/bin/env perl
use Mojolicious::Lite;
# connect to database
use DBI;
my $dbh = DBI->connect("dbi:SQLite:database.db","","") or die "Could not connect";
# shortcut for use in template
helper db => sub { $dbh };
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'