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 socket | |
from BaseHTTPServer import HTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
class MyHandler(SimpleHTTPRequestHandler): | |
def do_GET(self): | |
if self.path == '/ip': | |
self.send_response(200) | |
self.send_header('Content-type', 'text/html') | |
self.end_headers() |
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
iptables -N LEVEL1 | |
iptables -N LEVEL2 | |
iptables -N LEVEL3 | |
iptables -N CHECKIN | |
iptables -N WELCOME | |
iptables -F LEVEL1 | |
iptables -F LEVEL2 | |
iptables -F LEVEL3 | |
iptables -F CHECKIN |
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
byte muxCount = 0; | |
byte lookup[17]={0,1,2,4,8,1,2,4,8,1,2,4,8,1,2,4,8}; | |
void displayRing(byte number) { | |
byte groupMin = (4 * muxCount) + 1; | |
byte groupMax = (4 * muxCount) + 4; | |
byte A = 0; | |
byte B = 0; | |
if (number > 0) { | |
if ( (number >= groupMin) && (number <= groupMax) ) { |
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
byte muxCount = 0; | |
byte mask[16]={113,114,116,120,177,178,180,184,209,210,212,216,225,226,228,232}; | |
byte ledSegments1[]={0,0,1,1,0,1,0,1,0,1,0,1,1,0,0,1}; | |
void displayRing(byte input[]) { | |
if (input[muxCount]) { PORTD = mask[muxCount]; } else { PORTD = 0; } | |
muxCount = ++muxCount % 16; | |
} |
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
volatile byte muxCount = 0; | |
volatile byte mask[16] = {113, 114, 116, 120, 177, 178, 180, 184, 209, 210, 212, 216, 225, 226, 228, 232}; | |
volatile byte ledSegments1[16]; | |
byte n=0; | |
void setup() { | |
cli(); | |
DDRD = 255; // sets Arduino pins 0 to 7 as outputs | |
//timer setup | |
TCCR1A = 0; |
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 | |
# Put this file into /etc/network/if-up.d/ | |
HOSTNAME=my.example.com | |
PASSWD=keystring | |
logger -p local0.info -t ifupscript $CMD $IFACE $LOGICAL $ADDRFAM $METHOD $MODE $PHASE | |
if [ "$IFACE" = "eth0" ] || [ "$IFACE" = "wlan0" ]; then |
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 | |
### Make script executable, copy it to your $PATH somewhere and run: ip -o a | brif | |
import sys | |
print '{0: >5} {1: >11} {2: <40}'.format('Index','Iface','IP address') | |
for line in sys.stdin: | |
a=line.split(' ') |
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
ip link set up dev p1p1 | |
ip link set up dev p1p2 | |
ip netns add foo | |
ip netns add bar | |
ip link add veth0 type veth peer name veth1 | |
ip link set veth1 netns foo | |
ip link add veth2 type veth peer name veth3 | |
ip link set veth3 netns bar | |
brctl addbr br0 | |
brctl addif br0 p1p1 |
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 python3 | |
import os | |
import sys | |
import datetime | |
import pyotp | |
import hashlib | |
### TO ALLOW ACCSSS CALL sys.exit(0) | |
### TO DENY ACCESS CALL sys.exit(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
### https://www.arduino.cc/en/Reference/Map | |
### I find this useful | |
def remap(x, in_min, in_max, out_min, out_max): | |
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min |
OlderNewer