Skip to content

Instantly share code, notes, and snippets.

View k0nsl's full-sized avatar
🎯
Focusing

k0nsl k0nsl

🎯
Focusing
View GitHub Profile
@Kovah
Kovah / hn-theme-amber.md
Last active September 22, 2016 15:45
Hacker News Theme Amber
@0x9900
0x9900 / dnstest.py
Last active February 15, 2017 20:07
Quick and dirty speed test for public DNS services.
#!/usr/bin/env python
#
import DNS
import time
import sys
from collections import defaultdict
services = {
#'local': ['192.168.10.1'],
@k0nsl
k0nsl / blast-from-the-past.txt
Created January 7, 2016 20:15
A blast from the past. This is from the time when Irving originally caved in after his arrest in Austria. - HAC.
THE BALLAD OF DAVID "BLACKADDER" IRVING
(sung to the theme song of "Black Adder")
From some gormless public school,
Came forth Revision's brightest scholar,
Toffee-nosed, but he's no fool,
He raked in quids and marks and dollars!
Dave Irving, Dave Irving,
With nothing left to lose,
anonymous
anonymous / fawk
Created November 21, 2014 21:59
A Bash shell function to save your fingers from typing "awk '{ print $5 }'" all the time
# Inspiration: http://serverfault.com/a/5551 (but basically rewritten)
function fawk() {
USAGE="\
usage: fawk [<awk_args>] <field_no>
Ex: getent passwd | grep andy | fawk -F: 5
"
if [ $# -eq 0 ]; then
echo -e "$USAGE" >&2
return
#exit 1 # whoops! that would quit the shell!
@blHdIjbJ
blHdIjbJ / massrbl.php
Created January 28, 2012 21:24
simple mass RBL check
<?php
function rblcheck($host) { // Note: I have no idea how well suited CBL is for this purpose. If it gets annoying we can remove it ~ Aurora
$rbls = array('sbl-xbl.spamhaus.org', 'rbl.efnet.org', 'cbl.abuseat.org', 'dnsbl.dronebl.org');
foreach($rbls as $rbl) {
$lookup = implode('.', array_reverse(explode('.', $host))) . '.' . $rbl;
if (strstr(gethostbyname($lookup), "127.0.0")) {
return $rbl;
}
}
return 0;
@JimWestergren
JimWestergren / index-with-redis.php
Last active February 11, 2023 18:28
Redis as a Frontend Cache for WordPress
<?php
/*
Author: Jim Westergren & Jeedo Aquino
File: index-with-redis.php
Updated: 2012-10-25
This is a redis caching system for wordpress.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
@ecampidoglio
ecampidoglio / cpustatus.sh
Created February 21, 2013 23:42
A Bash script that prints the current state of the CPU on a Raspberry Pi. It displays variables like temperature, voltage and speed.
#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# The temperature is reported in degrees Celsius (C) while
# the CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
@sultanqasim
sultanqasim / zram.sh
Created June 21, 2016 02:41
ZRAM config for Raspberry Pi 3
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@doonga
doonga / A - Information
Last active November 4, 2023 21:10
Plex NGINX reverse proxy config using Cloudflare on Ubuntu 16.04
Credit where credit's due, I mainly used these 3 resources to get this all working. There were several others but I don't exactly remember which is which. So at least here are the 3 main places that I used.
The vast majority of this came from this link, the others helped me make it work for Plex.
http://emby.media/community/index.php?/topic/30975-reverse-proxy-with-ssl-hostname-routing-and-embyopenvpn-port-sharing/
https://gist.github.com/spikegrobstein/4384954
https://forums.plex.tv/discussion/207725/ubuntu-14-04-4-lts-plex-incorrectly-handles-lower-case-headers#latest
The data flow here is:
@kremalicious
kremalicious / tor-relay-setup.sh
Last active November 26, 2023 02:59
Set up new server as Tor relay
##
# Ubuntu 16.04 Xenial Xerus
##
######################################
# INITIAL SERVER SETUP & HARDENING
######################################
ssh root@1.2.3.4