Skip to content

Instantly share code, notes, and snippets.

View oussemos's full-sized avatar

Oussema Ch oussemos

  • Paris, France
View GitHub Profile
class Hello(object):
def hello(self):
return 'hello'
def call_hello(self):
return self.hello()
class Hello
def hello
'hello'
end
def call_hello
hello()
end
end
#!/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
https://developers.google.com/appengine/articles/appengine_helper_for_django?hl=fr&csw=1
http://code.google.com/p/vosao/
/usr/lib/postgresql/9.1/bin/pg_upgrade -d /var/lib/postgresql/8.3/main -D /var/lib/postgresql/9.1/main -b /usr/lib/postgresql/8.3/bin -B /usr/lib/postgresql/9.1/bin -k -v
Running in verbose mode
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories
You must have read and write access in the current directory.
Failure, exiting
postgres@vds2192:/root$ cd /var/lib/postgresql/
postgres@vds2192:~$ /usr/lib/postgresql/9.1/bin/pg_upgrade -d /var/lib/postgresql/8.3/main -D /var/lib/postgresql/9.1/main -b /usr/lib/postgresql/8.3/bin -B /usr/lib/postgresql/9.1/bin -k -v
Running in verbose mode
@oussemos
oussemos / Flush-iptables.sh
Created October 8, 2013 13:33
Rest Iptables Rules
#!/bin/sh
echo "Flushing iptables rules..."
sleep 1
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
@oussemos
oussemos / iptables-country-block
Created September 19, 2013 08:51
This tool will automatically create iptables rules on Linux system to block all connection from one country or more. The blocklist is created with an API that fetch data in our SQL database based on IP address country location.
#!/bin/bash
### IpInfoDB iptables countries block bash script###
### Slightly modified script from http://www.cyberciti.biz
### Countries code available : http://ipinfodb.com/country.txt ###
### Block all traffic from AFGHANISTAN (af) and CHINA (CN). Use ISO code ##
ISO="AF CN"
### Set PATH ###
IPT=/sbin/iptables
WGET=/usr/bin/wget