Skip to content

Instantly share code, notes, and snippets.

@alexsavio
alexsavio / extract_youtube_links
Last active December 28, 2015 18:39
Simple Python script to extract youtube links from a web page
@alexsavio
alexsavio / IPTables, block ports
Last active December 17, 2015 14:49
IPTables configuration in Ubuntu 13.04. Secure your ports!
Got this from: https://help.ubuntu.com/community/IptablesHowTo
IPTables setup, which will load and save configurations made in IPTables.
This default setup will block every port except for 80 and 22.
First create the files below in
/etc/iptables.rules
/etc/network/if-post-down.d/iptablessave
/etc/network/if-pre-up.d/iptablesload
#!/bin/sh
# btsync service
# Replace with linux users you want to run BTSync clients for
BTSYNC_USERS="mendel"
DAEMON=/usr/bin/btsync
start() {
for btsuser in $BTSYNC_USERS; do
HOMEDIR=`getent passwd $btsuser | cut -d: -f6`
config=$HOMEDIR/.sync/config.json