Skip to content

Instantly share code, notes, and snippets.

View angad's full-sized avatar

Angad Singh angad

View GitHub Profile
#!/home/asingh/local/bin/ruby
require 'rubygems'
require 'memprof'
Memprof.start
12.times{ "abc" }
Memprof.stats
Memprof.stop
@angad
angad / nmap-android.sh
Created April 27, 2012 20:12
Build Script for Nmap Android
STARTTIME=`date +%s`
cd ~
wget https://sourcery.mentor.com/sgpp/lite/arm/portal/package9728/public/arm-none-linux-gnueabi/arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
tar -xjf arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
export PATH=~/arm-2011.09/bin:$PATH
rm arm-2011.09-70-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
mkdir nmap-android
cd nmap-android
wget http://nmap.org/dist/nmap-5.51.tar.bz2
tar -xjf nmap-5.51.tar.bz2
@angad
angad / dvideo.md
Created November 6, 2011 07:30
Digital Video

##Sampling methods ###4:2:2 4:2:2

###4:1:1 4:1:1

###4:2:0 4:2:0

@angad
angad / dvideo.md
Created November 6, 2011 07:30
Digital Video

##Sampling methods ###4:2:2 4:2:2

###4:1:1 4:1:1

###4:0:0 4:2:0

@angad
angad / dvideo.md
Created November 6, 2011 07:27
Digital Video

##Sampling methods ###4:2:2 4:2:2

@angad
angad / dvideo.md
Created November 6, 2011 07:27
Digital Video

##Sampling methods ###4:2:2 4:2:2

@angad
angad / CopyNative.java
Created August 19, 2011 18:42
CopyNative
/**
* Copies the native binary from resource to path
*
* @param path
* path to where the native binary needs to be copied
*
* @param resource
* integer value of the resource (e.g. R.raw.synscanner)
*
*/
@angad
angad / isup.c
Created July 3, 2011 12:36
ping
#define PING_TIMEOUT 2
struct in_addr ouraddr = { 0 };
unsigned long global_rtt = 0;
//nmap
/* A relatively fast (or at least short ;) ping function. Doesn't require a
seperate checksum function */
int isup(struct in_addr target) {
int res, retries = 3;
struct sockaddr_in sock;
@angad
angad / raw_packet.c
Created June 26, 2011 19:17
SYN Packet
uint16_t csum (uint16_t *addr, int len) {
//RFC 1071
register long sum = 0;
int count = len;
uint16_t temp;
while (count > 1) {
temp = htons(*addr++);
sum += temp;
count -= 2;
@angad
angad / raw_packet.c
Created June 26, 2011 11:51
SYN Packet
struct pseudo_hdr {
u_int32_t src; //src ip
u_int32_t dst; //dst ip
u_char mbz; //all 0 reserved bits
u_char proto; //protocol field
u_int16_t len; //tcp length
};
//TCP Header