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
/* http://tools.ietf.org/html/rfc6455#section-5.2 | |
0 1 2 3 | |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |
+-+-+-+-+-------+-+-------------+-------------------------------+ | |
|F|R|R|R| opcode|M| Payload len | Extended payload length | | |
|I|S|S|S| (4) |A| (7) | (16/64) | | |
|N|V|V|V| |S| | (if payload len==126/127) | | |
| |1|2|3| |K| | | | |
+-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | |
| Extended payload length continued, if payload len == 127 | |
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
/* | |
FizzBuzz in GO, as a webserver... | |
*/ | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"net/http" | |
c "strconv" |
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
// trivial HTTP server | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
) |
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/ruby | |
require 'net/http' | |
require 'cloudfiles' | |
require 'colorize' | |
require 'uri' | |
i = 0 | |
skipto = ARGV[0].to_i | |
snooze = ARGV[1].to_f |
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
table inet firewall { | |
chain incoming { | |
type filter hook input priority 0; | |
# bad tcp -> avoid network scanning: | |
tcp flags & (fin|syn) == (fin|syn) drop | |
tcp flags & (syn|rst) == (syn|rst) drop | |
tcp flags & (fin|syn|rst|psh|ack|urg) < (fin) drop # == 0 would be better, not supported yet. | |
tcp flags & (fin|syn|rst|psh|ack|urg) == (fin|psh|urg) drop |
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
nf_conntrack | |
nf_conntrack_ipv4 | |
nf_conntrack_ipv6 | |
nf_defrag_ipv4 | |
nf_defrag_ipv6 | |
nf_nat | |
nf_nat_ipv4 | |
nf_tables | |
nf_tables_inet | |
nf_tables_ipv4 |
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/python2 | |
# req : pip install keyring | |
import sys | |
import keyring | |
# ERROR if not enough arguments supplied | |
if len(sys.argv) < 4: | |
print ''' |
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 ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
fmt.Println("Hello World!") | |
fmt.Println("Testing the editor...") |
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
%w(git nano vim vi wget curl).each do |p| | |
package p | |
end | |
remote_file '/tmp/atom.rpm' do | |
owner 'student' | |
group 'student' | |
mode '0644' | |
source 'https://atom.io/download/rpm' |
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
{ | |
"nftables": [ | |
{ | |
"table": { | |
"name": "nat", | |
"family": "ip", | |
"flags": 0, | |
"use": 2 | |
} | |
}, |
OlderNewer