This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /etc/network/interfaces | |
auto lo | |
iface lo inet loopback | |
iface eth0 inet dhcp | |
#allow-hotplug wlan0 | |
iface wlan0 inet manual | |
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
This script is forked originally from Dave Jeffery. The original implementation | |
was very slow and deleted around 2 tweets per second. Making it multithreaded I | |
am able to delete 30-50 tweets per second. | |
@author: vik-y | |
---------------------------------------------------------------------------- | |
This script will delete all of the tweets in the specified account. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from socket import * | |
s=socket(AF_INET, SOCK_DGRAM) | |
s.bind(('',12345)) | |
m=s.recvfrom(1024) | |
print m[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modprobe iptable_nat | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #Forward on this interface | |
iptables -A FORWARD -i wlan0 -j ACCEPT #Tells to accept all connections coming on wlan0 | |
# Works completely fine - Need to test it on OpenVPN | |
# Here the interface which has internet is eth0 | |
# Need to understand POSTROUTING nad MASQUERADE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package APIConnect; | |
import android.util.Base64; | |
import android.util.Log; | |
import android.widget.Toast; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.NameValuePair; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.entity.UrlEncodedFormEntity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://curl.haxx.se/docs/httpscripting.html#GET Use this link for further reference | |
curl --referer http://www.example.come http://www.example.com | |
# To fake the referrer header | |
curl --location http://www.example.com | |
# To make curl follow the redirects as well | |
curl --upload-file uploadfile http://www.example.com/receive.cgi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> res,unans = traceroute(["www.microsoft.com","www.cisco.com","www.yahoo.com","www.wanadoo.fr","www.pacsec.com"],dport=[80,443],maxttl=20,retry=-2) | |
Received 190 packets, got 190 answers, remaining 10 packets | |
193.252.122.103:443 193.252.122.103:80 198.133.219.25:443 198.133.219.25:80 207.46... | |
1 192.168.8.1 192.168.8.1 192.168.8.1 192.168.8.1 192.16... | |
2 82.251.4.254 82.251.4.254 82.251.4.254 82.251.4.254 82.251... | |
3 213.228.4.254 213.228.4.254 213.228.4.254 213.228.4.254 213.22... | |
[...] | |
>>> res.graph() # piped to ImageMagick's display program. Image below. | |
>>> res.graph(type="ps",target="| lp") # piped to postscript printer | |
>>> res.graph(target="> /tmp/graph.svg") # saved to file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "laravel/laravel", | |
"description": "The Laravel Framework.", | |
"keywords": ["framework", "laravel"], | |
"license": "MIT", | |
"type": "project", | |
"require": { | |
"laravel/framework": "4.2.*" | |
}, | |
"autoload": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from itertools import combinations | |
import math | |
import copy | |
def euclid(a, b): | |
"""returns the Greatest Common Divisor of a and b""" | |
a = abs(a) | |
b = abs(b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A basic implementation of calling Alchemy API using python. | |
I have used request library but you can use urllib too | |
''' | |
import requests | |
import json | |
from BeautifulSoup import BeautifulSoup | |