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 <time.h> | |
void timespec_diff(struct timespec *start, struct timespec *stop, | |
struct timespec *result) | |
{ | |
if ((stop->tv_nsec - start->tv_nsec) < 0) { | |
result->tv_sec = stop->tv_sec - start->tv_sec - 1; | |
result->tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000; | |
} else { | |
result->tv_sec = stop->tv_sec - start->tv_sec; |
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
#!/usr/bin/env python | |
import hashlib | |
import base64 | |
import binascii | |
def main(): | |
pktstr = raw_input() | |
m = hashlib.md5() | |
m.update(base64.b16decode(pktstr.replace(' ', '').upper())) |
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 | |
ROOTDIR=~/ruijie | |
SESSION=main | |
NONAME="bash" | |
window_list="tftp $NONAME ipython $NONAME" | |
tmux has-session -t $SESSION | |
if [ $? -eq 0 ]; then | |
echo "Session $SESSION already exists. Attacing." |
NewerOlder