Skip to content

Instantly share code, notes, and snippets.

@ItsMeooooooo
ItsMeooooooo / css browser switch
Created July 22, 2013 17:25
css browser switch
<!doctype html>
<!--[if IE]><![endif]-->
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en"><!--<![endif]-->
import os, subprocess, redis, thread, json, time, daemon, re
red = redis.Redis("localhost", password=os.getenv("REDISPASS"))
class InterCom(object):
def __init__(self, id):
self.id = id
self.prefix = "server-%s-" % self.id
def getCvar(self, i):
@ItsMeooooooo
ItsMeooooooo / flac2ogg
Created August 3, 2013 11:36
A short oneliner for converting a folder with *flac files to *ogg
find . -name "*flac" -exec oggenc -q 7 {} \;
@ItsMeooooooo
ItsMeooooooo / getLoad
Created August 3, 2013 12:45
Get Load with a python oneliner
python -c 'import os;print os.getloadavg()[0]'
@ItsMeooooooo
ItsMeooooooo / removeExif
Created August 3, 2013 12:47
Remove EXIF data from a file
mogrify -strip /foo/bar/mypic.jpg
@ItsMeooooooo
ItsMeooooooo / resizeProportional
Last active December 20, 2015 14:28
The -geometry flag is to resize the image, it requires a dimension parameter in the format WIDTHxHEIGHT
mogrify -geometry x240 /foo/bar/nattebums.png
@ItsMeooooooo
ItsMeooooooo / geoip
Last active December 21, 2015 19:29
get the GeoIP.dat and decompress it into a given folder
#!/usr/bin/env bash
#
# OK lets work
geoIPPath='/home/urbanterror/geoip/'
IPAddress='http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz'
zcat=/bin/zcat
wget=/usr/bin/wget
echo 'Checking if the remote File is available...'
@ItsMeooooooo
ItsMeooooooo / iptables_flush
Created September 2, 2013 14:01
Script to flush all iptables rules
#!/bin/sh
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
@ItsMeooooooo
ItsMeooooooo / extract_uri
Created September 4, 2013 06:28
Extract the real URI from google
#!/bin/sh
# Convert Google's fuxnored URLs to the true URL
sed 's/^.*\&url=//; s/\&.*//' | urlenc2ascii
------------------------------------------------------------------------
#!/usr/bin/awk -f
# Print URL-encoded URL as ASCII
@ItsMeooooooo
ItsMeooooooo / nginx.conf
Last active August 29, 2015 14:15 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048