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 ( | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/postgres" | |
) | |
type User struct { | |
ID int | |
Username string |
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
# Install docker | |
sudo apt update | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt update | |
sudo apt -y install docker-ce | |
sudo usermod -aG docker $USER | |
# logout and login now |
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 ( | |
"encoding/json" | |
"flag" | |
"io/ioutil" | |
"log" | |
"sort" | |
) |
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 <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cassert> | |
#include <condition_variable> | |
#include <mutex> | |
#include <thread> | |
#include <arpa/inet.h> | |
#include <sys/socket.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
#include <iostream> | |
#include <cassert> | |
#include <vector> | |
using namespace std; | |
typedef struct qsnap { | |
int first; | |
int last; | |
qsnap(int f, int l) : first(f), last(l) {} | |
} qsnap; |
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 <condition_variable> | |
#include <cstdio> | |
#include <cstring> | |
#include <iostream> | |
#include <mutex> | |
#include <thread> | |
using namespace std; | |
mutex mut; | |
condition_variable* cond; |
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
## Installation | |
# sudo apt-get install build-essential python-dev libnetfilter-queue-dev | |
# sudp pip install NetfilterQueue scapy | |
## References | |
# https://www.digitalocean.com/community/tutorials/how-to-list-and-delete-iptables-firewall-rules | |
# https://github.com/phaethon/scapy | |
# https://5d4a.wordpress.com/2011/08/25/having-fun-with-nfqueue-and-scapy/ | |
# https://pypi.python.org/pypi/NetfilterQueue/0.3 | |
# http://www.netfilter.org/documentation/HOWTO/netfilter-hacking-HOWTO-3.html |
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 | |
if [[ $0 != "/bin/bash" ]]; then | |
echo "Error: source the script!" | |
exit 1 | |
fi | |
if [[ ! -d $(pwd)/go/bin ]]; then | |
echo "Error: go installtion not found in the current directory!" | |
return |
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 ( | |
"bufio" | |
"fmt" | |
"net" | |
"os" | |
"syscall" | |
) |
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 ( | |
"bufio" | |
"fmt" | |
"net" | |
"os" | |
"syscall" | |
) |
NewerOlder