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 socket, select | |
host = '121.40.77.208' | |
port = 10000 | |
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
socket.connect((host, port)) | |
inout = [socket] |
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 Node | |
{ | |
int data; | |
int length; | |
char buffer[0]; | |
}; | |
int main() |
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 <assert.h> | |
typedef double (*PF)(double *dbData, int iSize); | |
double getMin(double *dbData, int iSize) | |
{ | |
double dbMin; | |
int 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
SRCS = $(wildcard *.c) | |
OBJS = $(SRCS:.c = .o) | |
CC = gcc | |
CCFLAGS = -g -Wall -O0 | |
target = ringBuffer_test | |
$(target): $(OBJS) | |
$(CC) $^ -o $@ $(CCFLAGS) | |
%.o : %.c |
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 <syslog.h> | |
int main() | |
{ | |
setlogmask(LOG_UPTO(LOG_NOTICE)); | |
openlog("testlog", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL0); | |
syslog(LOG_NOTICE, "LOG NOTICE"); | |
syslog(LOG_INFO, "LOG INFO"); |
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> | |
void PrintTwoNumbers(int (*numberSource)(void)) | |
{ | |
printf("%d %d\n", numberSource(), numberSource()); | |
} | |
int overNineThousand(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
#!/bin/sh | |
# | |
# Traffic logging tool for OpenWRT-based routers | |
# | |
# Created by Emmanuel Brucy (e.brucy AT qut.edu.au) | |
# | |
# Based on work from Fredrik Erlandsson (erlis AT linux.nu) | |
# Based on traff_graph script by twist - http://wiki.openwrt.org/RrdTrafficWatch | |
# | |
# This program is free software; you can redistribute it and/or |
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
iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 21 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 22 -j ACCEPT | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -A INPUT -j DROP |
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
cat file.txt | sed -n 10p |
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 <rtthread.h> | |
#define THREAD_STACK_SIZE 512 | |
#define THREAD_TIMESLICE 3 | |
#define PERIOD1 25 | |
#define PERIOD2 15 | |
#define PERIOD3 18 | |
#define PERIOD4 20 | |
#define PERIOD 20 | |
#define WCET1 4 |
OlderNewer