Skip to content

Instantly share code, notes, and snippets.

@dannyge
dannyge / getLink.js
Last active June 2, 2017 10:26
get ed2k link from chrome console
@dannyge
dannyge / maven_list_dep
Created August 5, 2016 04:55
list maven dep
# first grab all dependencies
mvn dependency:resolve
# then list them with -o to keep noise low,
# remove extra information and duplicates
mvn -o dependency:list \
| grep ":.*:.*:.*" \
| cut -d] -f2- \
| sed 's/:[a-z]*$//g' \
| sort -u
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --dport 3366 -j DNAT --to-destination 10.91.13.195:3306
iptables -t nat -A POSTROUTING -d 10.91.13.195 -p tcp --dport 3306 -j SNAT --to 10.253.5.175
@dannyge
dannyge / dockerfile
Created July 16, 2016 10:20
docker
docker run --name mysql \
-d -p 9306:3306 \
--restart always \
-v /data/docker/mysql:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=root_pwd \
-e MYSQL_USER=gitlab \
-e MYSQL_PASSWORD=gitlab_db \
-e MYSQL_DATABASE=gitlab \
mysql:latest
@dannyge
dannyge / firewall
Last active July 16, 2016 10:25
centos
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=8070/tcp --permanent
firewall-cmd --reload
firewall-cmd --zone=public --list-all
######
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --zone=public --add-forward-port=port=3366:proto=tcp:toport=3306:toaddr=10.140.141.6 --permanent