This file contains hidden or 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 nmea0183_checksum(char *nmea_data) | |
{ | |
int crc = 0; | |
int i; | |
// the first $ sign and the last two bytes of original CRC + the * sign | |
for (i = 1; i < strlen(nmea_data) - 3; i ++) { |
This file contains hidden or 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 <stdint.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#include <sys/signalfd.h> | |
#include <sys/select.h> | |
fd_set allfd; | |
int maxfd; | |
int sfd_int; |
This file contains hidden or 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/python | |
# Author: devnaga | |
## ip, username, password, command | |
# the csv file must look like the following | |
# ip,username,password,'command1; command2; command3' | |
# any sspace between the ',' will get you in trouble | |
import sys | |
import paramiko | |
import csv |
This file contains hidden or 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 <sys/stat.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
void usage() | |
{ | |
printf("./cpuenable <online / offline> <cpu number>\n"); | |
exit(1); |
This file contains hidden or 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/python | |
import sys | |
import os | |
if len(sys.argv) != 2: | |
print sys.argv[0] + " " + "filename" | |
exit(0) | |
fd = open(sys.argv[1], "r") |
This file contains hidden or 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> | |
struct test_ { | |
int a; | |
char string[20]; | |
}; | |
int main(void) { | |
struct test_ test_ = {}; |
This file contains hidden or 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 <unistd.h> | |
#include <pthread.h> | |
void *thread_func(void *data) | |
{ | |
execlp("/bin/ls", "ls", "-l", NULL); | |
} | |
int main(void) { |
This file contains hidden or 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 <sys/socket.h> | |
int opt = -1; | |
socklen_t optlen = sizeof(opt); | |
int main(int argc, char **argv) | |
{ | |
int type; |
This file contains hidden or 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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
int rand_gen_int() | |
{ | |
int ret; | |
int fd; | |
int number = 0; |
This file contains hidden or 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 <unistd.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <sys/signalfd.h> | |
int segv_handle() | |
{ | |
printf("segv\n"); | |
exit(0); |