tcpdump -i eth0 -s 1024 -A
Shows only packets from eth0, size of packet is 1024, -A prints ascii.
# Making substitutions on files where a certain pattern is found | |
fgrep -r "<something>" . | awk -F : '{print $1}' | xargs sed -i "s/<something>/<something else>/g" $@ | |
## Mac OS specifics | |
## Cleaning up Time Machine snapshots | |
tmutil listlocalsnapshots / | awk -F "." '{print $4}' | while read dt; do tmutil deletelocalsnapshots $dt; done |
// to compile: gcc -fno-stack-protector -o boverflow_strcpy boverflow_strcpy.c | |
// to run (test): ./boverflow_strcpy $(python -c "print 'a'*15") | |
#include <stdio.h> | |
#include <strings.h> | |
void foo(char *bar){ | |
char buffer[16]; | |
strcpy(buffer, bar); | |
printf("%s", buffer); | |
} |
// To compile: gcc -fno-stack-protector -o boverflow_gets boverflow_gets.c | |
// To run (test): python -c "print 'a'*<some number>" | ./boverflow_gets | |
#include <stdio.h> | |
#include <string.h> | |
int main() { | |
char buffer[16]; | |
gets(buffer); | |
printf("%s", buffer); | |
return 0; |
#include <stdio.h> | |
#include <string.h> | |
int main(int argc, char *argv[]) { | |
char *test = argv[1]; | |
int tt = (int)strlen(test); | |
printf("%d", tt); | |
return 0; | |
} |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <netinet/in.h> | |
void main() { | |
int sock = socket(AF_INET, SOCK_STREAM, 0); | |
struct sockaddr_in addr; | |
addr.sin_family = AF_INET; | |
addr.sin_addr.s_addr = INADDR_ANY; |
package main | |
import ( | |
"fmt" | |
) | |
type Node struct { | |
Data int | |
Next_node *Node | |
} |