Skip to content

Instantly share code, notes, and snippets.

@sanbrother
sanbrother / easylist.pl
Created January 27, 2020 04:51 — forked from g3rhard/easylist.pl
Adding EasyList subscriptions for PiHole project
#!/usr/bin/perl -w
#Source: https://newspaint.wordpress.com/2014/08/18/filtering-easylist-for-hosts-file-style-adblock/
use strict;
my %hosts = ();
while ( <> ) {
if ( $_ =~ m/^\|\|([a-z][a-z0-9-_.]+\.([a-z]{2,3}))\^\s*$/ ) {
$hosts{$1} = 1;
}
@sanbrother
sanbrother / common.h
Created October 25, 2018 14:03
C & C++
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
#endif /* __cplusplus */
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define handle_error(msg) \
do { perror(msg); exit(EXIT_FAILURE); } while (0)
@sanbrother
sanbrother / gist:952cf84e22121c8a322b
Created April 7, 2015 14:14
Yosemite Shutdown Problem
4/7/15 10:12:49.297 PM loginwindow[66]: ERROR | -[SessionLogoutManager startLogout:logoutSubType:showConfirmationUI:countDownTime:useTALOption:logoutOptions:] | Attempt to start a: Restart, AFTER a Restart was already past the point where logout can change types
4/7/15 10:12:58.393 PM powerd[27]: Failed to read current rating(0xe00002f0)
@sanbrother
sanbrother / gist:61883c711ea480417f5f
Created April 7, 2015 14:01
Yosemite Kernel Panic
Anonymous UUID: DE055349-CF2A-318F-2CD0-41DB35C98BD8
Wed Apr 8 05:52:28 2015
*** Panic Report ***
Panic(CPU 0): Unresponsive processor (this CPU did not acknowledge interrupts) TLB state:0x0
RAX: 0xffffff800ba562c0, RBX: 0xffffff8000adfd98, RCX: 0xffffff8000a951d8, RDX: 0x0000000500000000
RSP: 0xffffff80733cbe30, RBP: 0xffffff80733cbe50, RSI: 0x00000005e80698d0, RDI: 0xffffff8000adfd98
R8: 0x000000002dce7522, R9: 0x00000000000000ec, R10: 0x00000000f9a9ff11, R11: 0x00000000089159f2
R12: 0xffffff8000b17000, R13: 0xffffff8000b16000, R14: 0x0000000000000b16, R15: 0xffffff8000adfd98
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,