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 <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <arpa/inet.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
Proposed multi-line output for netstat | |
====================================== | |
Current Layout | |
-------------- | |
Proto Recv-Q Send-Q Local Address Foreign Address State | |
tcp6 0 0 2001:67c:26f4:64::55736 2001:67c:26f4:64::7:993 ESTABLISHED | |
Note: The current layout seems to cut off addresses. | |
Proposal #1 (RFC-compliant, one line, 80+ chars) |
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
danrl@tunafish ~$ netstat -tanW | |
Active Internet connections (servers and established) | |
Proto Recv-Q Send-Q Local Address Foreign Address State <-- [1] | |
tcp 0 0 0.0.0.0:5000 LISTEN | |
0.0.0.0:* | |
tcp6 0 0 :::5000 LISTEN | |
:::* | |
tcp6 0 0 2001:470:722d:10:4c6f:4b6d:dde0:1131:57366 ESTABLISHED | |
2a00:1450:4001:804::1008:443 | |
tcp6 0 0 2001:470:722d:10:c9d:41ad:470e:81bf:32855 ESTABLISHED |
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
# build config | |
TARGETS = bin1 bin2 | |
INCLUDES = header.h | |
# project config | |
CC = gcc | |
CFLAGS += -Wall -Wextra -pedantic | |
LDFLAGS += | |
# generic build instructions |
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 | |
echo -n "loading ipv4 packet filter... " | |
### clear tables | |
iptables --flush | |
iptables --delete-chain | |
iptables --table mangle --flush | |
iptables --table mangle --delete-chain |
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
diff --git a/fake_router26.c b/fake_router26.c | |
index 2db4ac2..3e2e3be 100644 | |
--- a/fake_router26.c | |
+++ b/fake_router26.c | |
@@ -7,14 +7,15 @@ | |
#include <sys/resource.h> | |
#include <sys/wait.h> | |
#include <time.h> | |
+#include <signal.h> | |
#include <pcap.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 -e | |
hostname=$1 | |
device=$2 | |
file=$HOME/.dynv6.addr6 | |
[ -e $file ] && old=`cat $file` | |
if [ -z "$hostname" -o -z "$token" ]; then | |
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]" | |
exit 1 | |
fi |
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 <ESP8266WiFi.h> | |
#include <MQTTClient.h> | |
#include "DHT.h" | |
const char *wifi_ssid = "wifi"; | |
const char *wifi_password = "secret"; | |
const char *mqtt_server = "broker.shiftr.io"; | |
const char *mqtt_id = "my_first_node"; | |
const char *mqtt_user = "login"; |
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 | |
# caution: quick hack! | |
# -- project selection | |
PROJECT_IDS=() | |
PROJECT_NAMES=() | |
IFS_ORIG=$IFS |
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
package main | |
import ( | |
"flag" | |
"io/ioutil" | |
"log" | |
"os" | |
"github.com/nlopes/slack" | |
) |
OlderNewer