Skip to content

Instantly share code, notes, and snippets.

View k0nsl's full-sized avatar
🎯
Focusing

k0nsl k0nsl

🎯
Focusing
View GitHub Profile
@k0nsl
k0nsl / k0nsl-cloud-proxy
Created January 15, 2013 09:10
My simple proxy configuration for k0nsl.org
[nginx.conf]
upstream kCloud {
server IP1; #main server
server IP2:81 backup;
}
[/nginx.conf]
[k0nsl.org]
server {
error_log vhost-error_log warn;
@k0nsl
k0nsl / k0nsl-phpbb-nginx-rewrite
Created April 29, 2013 00:54
phpBB3 Pretty URLs & nginx
## k0nsl: START phpBB rewrites
location / {
root /home/k0nsl/location/;
index index.php index.html index.htm;
rewrite ^/t([0-9]+)-[^_]+?\.html$ /viewtopic.php?t=$1 last;
rewrite ^/t([0-9]+)-[^_]+?_([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 last;
rewrite ^/f([0-9]+)-[^_]+?_([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 last;
rewrite ^/f([0-9]+)-[^_]+?\.html$ /viewforum.php?f=$1 last;
rewrite ^/p([0-9]+)-[^_]+?\.html$ /viewtopic.php?p=$1 last;
rewrite ^/u([0-9]+)-.+?\.html$ /memberlist.php?mode=viewprofile&u=$1 last;
@k0nsl
k0nsl / k0nsl-anonymizer
Last active December 17, 2015 00:29
Anonymize all external links via the "anonymizer.mastrcoder.com" service.
<script src="http://cdn.mastrcoder.com/js/anonymize.js" type="text/javascript"></script>
<script type="text/javascript"><!--
protected_links = "";
auto_anonymize();
//--></script>
@k0nsl
k0nsl / hook_cf_country_admin
Last active December 17, 2015 08:29
Untested. This hook will only allow access to ACP if the IP Geolocation matches a defined value. Only works with CloudFlare.
<?php
/**
* hook_cf_country_admin
*
* This hook will only allow access to ACP if the IP Geolocation matches a defined value. Only works with CloudFlare.
*
* @author k0nsl (http://k0nsl.org)
* @link http://k0nsl.org
*/
@k0nsl
k0nsl / k0nsl-wordpress-index.php
Created November 3, 2013 02:49
k0nsl's index.php for WordPress.
<?php
/*
Base code by Jim Westergren & Jeedo Aquino
File: index.php
Updated: 2013-10-22
comment: this entire index needs to be rewritten from scratch - very ugly.
*/
X-Gmail-Received: 5fa8487a42d31e8eaa6a7c6fd13809e07e985ba6
Delivered-To: system33r@gmail.com
Received: by 10.38.86.36 with SMTP id j36cs36256rnb;
Mon, 21 Feb 2005 05:30:18 -0800 (PST)
Received: by 10.38.72.21 with SMTP id u21mr56117rna;
Mon, 21 Feb 2005 05:30:18 -0800 (PST)
Received: by 10.38.81.8 with HTTP; Mon, 21 Feb 2005 05:30:18 -0800 (PST)
Message-ID: <245f0df105022105304e338991@mail.gmail.com>
Date: Tue, 22 Feb 2005 00:30:18 +1100
From: "SecNet Securiteam Founder [ADMIN]"
@k0nsl
k0nsl / cron-service.sh
Created November 8, 2013 12:51
Cron service to block all traffic from tor clients (for linux) by Daniel da Silva.
#!/bin/bash
if [ "$USER" != "root" ]; then
echo "Must be run as root (you are $USER)."
exit 1
fi
if [ "$1" == "" ]; then
echo "$0 port [port [port [...]]]"
exit 1
@k0nsl
k0nsl / b0b-ringtone
Last active December 27, 2015 19:29
The source of the b0b ringtone.
Fri Nov 8 02:29:38 2013 <b0b> they are collecting info for dox
Fri Nov 8 02:29:40 2013 <b0b> duh
Fri Nov 8 02:29:43 2013 <b0b> its illwill's irc
Fri Nov 8 02:29:56 2013 <b0b> he doesnt know your real name yet
Fri Nov 8 02:29:59 2013 <b0b> or does he?
Fri Nov 8 02:30:33 2013 <b0b> carmenjello
Fri Nov 8 03:28:56 2013 <RaGe[]> ;>
@k0nsl
k0nsl / nginx-hotlink
Created November 9, 2013 19:16
block all hotlinking if they don't match your domain.
@k0nsl
k0nsl / disable-exim-cpanel-whm
Created November 11, 2013 21:01
A way to disable Exim (applies to WHM/cPanel too).
service exim stop
chkconfig exim off
touch /etc/eximdisable (or create an empty file in /etc with the filename 'eximdisable')