This file contains 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
#include <stdio.h> | |
void * | |
f(void) { | |
a: | |
printf("here!\n"); | |
return &&a; | |
} | |
int |
This file contains 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
# need to use --posix or --re-interval | |
$0 ~ /^lib[^.]+\.so(.[0-9]+){0,3}$/ { | |
n = split($0, a, ".") | |
dso_basename = a[1]; | |
suffix = "" | |
for(i = 2; i <= n; i++) { | |
suffix = suffix"."a[i] | |
} |
This file contains 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
#!/bin/sh | |
# convert all file names in the current directory to lower case | |
# only operates on plain files--does not change the name of directories | |
# will ask for verification before overwriting an existing file | |
for x in `ls` | |
do | |
if [ ! -f $x ]; then | |
continue | |
fi |
This file contains 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
#include <stdio.h> | |
int main(int argc, char* argv[]) { | |
int i = 1; | |
/* endianess dependent result */ | |
if(*(char *) &i == 0) | |
fprintf( stderr, "little-endian\n" ); | |
else |
This file contains 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
#!/bin/bash | |
# parses an unsorted document with 2 columns : | |
# | |
# ip date | |
# | |
# where same ip's might appear multiple times and even the exact same ip date pair | |
# and outputs | |
# | |
# ip | # of occurences | list of dates of occurences |
This file contains 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
/* | |
simple usage of the tcpd/tcp wrapper API | |
a full-fledged program would probalby call hosts_access() upon accepting a new | |
connection and if denied it would close() | |
the established connection with FIN,ACK or most preferably RST | |
build with : | |
gcc -c tcpd_test.c |
This file contains 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
# capture SYN/ACK flagged packets | |
# tcp[13] is the byte location of TCP flags (URG,ACK,PSH,RST,SYN,FIN) | |
# | |
# mnemonic | |
# | |
# Unskilled 32 | |
# Attackers 16 | |
# Pester 8 | |
# Real 4 | |
# Security 2 |
This file contains 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
#!/bin/bash | |
# | |
# entry example | |
# | |
# (1579051) 10/16/2009 0:02:13 AM - (not logged in) (192.168.1.11)> USER chris | |
# | |
# sort -k1n fzs-2009-10-16.log | |
# does not work properly because when the session id and timestamp are the same | |
# it goes on and tries to sort based on the message |
This file contains 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
# multicast group 239.1.1.1 on port 4321 | |
# multicast listener/sink with read buffer of 512 bytes | |
iperf -s -u -B 239.1.1.1 -i 1 -l 512 -p 4321 | |
# multicast transmitter/source with write buffer of 512 bytes | |
# fill up bandwidth of 80Kb/s |
OlderNewer