Content :
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/bash | |
| # call this script with an email address (valid or not). | |
| # like: | |
| # ./makecert.sh [email protected] | |
| mkdir certs | |
| rm certs/* | |
| echo "make server cert" | |
| openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1" | |
| echo "make client cert" | |
| openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$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
| package events | |
| import ( | |
| "sync" | |
| "context" | |
| ) | |
| type Dispatcher struct { | |
| mutex *sync.RWMutex | |
| listeners map[string][]Listener |
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
| package main | |
| import ( | |
| "database/sql" | |
| "log" | |
| ) | |
| func main() { | |
| db, err := sql.Open("VENDOR_HERE", "YOUR_DSN_HERE") | |
| handleError(err) |
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
| / Convert IPv4 range into CIDR | |
| func iPv4RangeToCIDRRange(ipStart string, ipEnd string) (cidrs []string, err error) { | |
| cidr2mask := []uint32{ | |
| 0x00000000, 0x80000000, 0xC0000000, | |
| 0xE0000000, 0xF0000000, 0xF8000000, | |
| 0xFC000000, 0xFE000000, 0xFF000000, | |
| 0xFF800000, 0xFFC00000, 0xFFE00000, | |
| 0xFFF00000, 0xFFF80000, 0xFFFC0000, | |
| 0xFFFE0000, 0xFFFF0000, 0xFFFF8000, |
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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/google/gopacket" | |
| "github.com/google/gopacket/pcap" | |
| ) | |
| func main() { | |
| handle, err := pcap.OpenLive("en0", 1600, true, pcap.BlockForever) |
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
| package main | |
| import ( | |
| "crypto/rand" | |
| "flag" | |
| "log" | |
| mrand "math/rand" | |
| "net" | |
| "os" | |
| "os/signal" |
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
| # Got from https://www.digitalocean.com/community/questions/how-to-install-pptp-vpn-on-centos-7 and changed new workable epel rpm url | |
| rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm | |
| yum -y install ppp pptpd | |
| cp /etc/pptpd.conf /etc/pptpd.conf.bak | |
| cat >/etc/pptpd.conf<<EOF | |
| option /etc/ppp/options.pptpd | |
| logwtmp | |
| localip 10.0.10.1 | |
| remoteip 10.0.10.2-254 |
NewerOlder