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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <cs50.h> | |
#include <ctype.h> | |
int main(int argc, char *argv[]) | |
{ | |
if (argc != 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
typedef struct node | |
{ | |
int n; | |
struct node *next; | |
} | |
node; | |
bool search(int n, node* list) | |
{ | |
node* ptr = list; |
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> | |
#include <string.h> | |
int main(int argc, char* argv[]) | |
{ | |
if (argc != 2) | |
{ | |
printf("\nCorrect usage is: gdb_script plaintext\n"); | |
return 1; | |
} |
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
ssize_t readlink (const char *filename, char *buffer, size_t size) | |
char *readlink_malloc (const char *filename) | |
{ | |
int size = 100; | |
char *buffer = NULL; | |
while (1) | |
{ | |
buffer = (char *) xrealloc (buffer, size); |
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
;----------RED-SECTOR-INC.-proudly-presents-a-33-year-old-record-:---------- | |
; 468-byte footprint___ _ "...The original chess game in a bootsector" | |
; / / _____ _ _ _____ _ _ ___ _ | |
; .::. / / / / / / / / / / | |
; :::: / / ____ .-/ _ ___/-. .-/ _ ___/-. / /__ | |
; :: / \ | | . | | | . | / / | |
; :: __ _ \ l | | | l | | / ___/ | |
; .::. / / / / | l |_| l | |__/ / ____ | |
; .::::. / __/ `--' `--' / | | |
; :::::::: / / | |
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
import sys | |
from StringIO import StringIO | |
def parse_rtf(f): | |
d = f.read() | |
# \rtf & \shp | |
if d.find('\x7b\x5c\x72') != -1 and d.find('\x5c\x73\x68\x70') != -1 and d.find('\x5c\x73\x70') != -1: | |
addr = d.find('\x5c\x73\x76') | |
if addr != -1: | |
f.seek(addr) |
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
0000000: 0123 4567 ff03 0000 0000 0000 0000 0000 .#Eg............ | |
0000010: 0000 0000 0000 0000 0000 1245 fa7f 0000 ...........E.... | |
0000020: 807c 0000 807c bbbb bbbb cccc cccc dddd .|...|.......... | |
0000030: dddd 906a 887c 9090 9090 64a1 3000 0000 ...j.|....d.0... | |
0000040: 8b40 0c8b 701c ad8b 7008 e9f4 0200 0058 .@..p...p......X | |
0000050: 81ec 0003 0000 8bfc 5033 c0b9 0003 0000 ........P3...... | |
0000060: f3aa 588b fc89 7708 8947 10ff 7708 68ec ..X...w..G..w.h. | |
0000070: 9703 0ce8 7702 0000 8947 1cff 7708 68f6 ....w....G..w.h. | |
0000080: 22b9 7ce8 6702 0000 8947 20ff 7708 68a5 ".|.g....G .w.h. | |
0000090: 1700 7ce8 5702 0000 8947 24ff 7708 68fb ..|.W....G$.w.h. |
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
# | |
# Library with various ip manipulation functions | |
# | |
# convert ip ranges to CIDR notation | |
# str range2cidr(ip2dec("192.168.0.15"), ip2dec("192.168.5.115")) | |
# | |
# Credit to Chubler_XL for this brilliant function. (see his post below for non GNU awk) | |
# | |
function range2cidr(ipStart, ipEnd, bits, mask, newip) { |
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
#define _GNU_SOURCE | |
#include <netinet/ip.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <sys/socket.h> | |
#include <sys/stat.h> |
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 | |
echo '#!/bin/sh' >/var/upgrade/upgrade1.sh | |
chmod 755 /var/upgrade/upgrade1.sh | |
KEYGEN=/usr/bin/ssh-keygen | |
SSHD=/usr/sbin/sshd | |
RSA1_KEY=/etc/ssh_host_key | |
RSA_KEY=/etc/ssh_host_rsa_key | |
DSA_KEY=/etc/ssh_host_dsa_key |
OlderNewer