Skip to content

Instantly share code, notes, and snippets.

Petr Ruzicka ruzickap

Block or report user

Report or block ruzickap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ruzickap /
Last active Jan 6, 2018
OpenWrt Transmission
opkg install transmission-remote transmission-web
mkdir -p /data/torrents/torrents-completed /data/torrents/torrents-incomplete /data/torrents/torrents /data/torrents/config
uci set transmission.@transmission[-1].enabled=1
uci set transmission.@transmission[-1].config_dir=/data/torrents/config
uci set transmission.@transmission[-1].download_dir=/data/torrents/torrents-completed
uci set transmission.@transmission[-1].incomplete_dir_enabled=true
uci set transmission.@transmission[-1].incomplete_dir=/data/torrents/torrents-incomplete
uci set transmission.@transmission[-1].blocklist_enabled=1
ruzickap /
Last active Apr 11, 2019
OpenWrt DHCP modifications
uci set dhcp.lan.start=200
uci set dhcp.lan.limit=54
uci set dhcp.@dnsmasq[0]
uci set dhcp.@dnsmasq[0].leasefile=/etc/dnsmasq-dhcp.leases
#Send email for new connections:
echo "dhcp-script=/etc/" >> /etc/dnsmasq.conf
cat > /etc/ << \EOF
opkg install luci-app-watchcat
uci set system.@watchcat[0].period=1h
/etc/init.d/watchcat enable
ruzickap /
Last active Oct 19, 2016
OpenWrt fstab - create and mount external USB stick
mkdir /data
mkfs.ext4 -L data /dev/mmcblk0p1
uci add fstab mount
uci set fstab.@mount[-1].device=/dev/mmcblk0p1
uci set fstab.@mount[-1].target=/data
uci set fstab.@mount[-1].fstype=ext4
uci set fstab.@mount[-1].options=rw,sync,noatime,nodiratime
uci set fstab.@mount[-1].enabled=1
ruzickap /
Created Apr 6, 2014
OpenWrt WiFi configuration tweaks
uci set
uci set wireless.radio0.htmode=HT40-
uci set wireless.radio0.noscan=1
uci set wireless.radio0.bursting=1
uci set wireless.radio0.ff=1
uci set wireless.radio0.compression=1
uci set wireless.radio0.xr=1
uci set
uci set wireless.radio0.txpower=20
ruzickap /
Created Apr 7, 2014
OpenWrt vnStat configuration
opkg install luci-app-vnstat vnstati
mkdir /etc/vnstat /www3/myadmin/vnstat
sed -i 's@^\(DatabaseDir\).*@\1 "/etc/vnstat"@' /etc/vnstat.conf
vnstat -u -i eth2
vnstat -u -i wlan0
vnstat -u -i br-lan
echo "*/5 * * * * vnstat -u" >> /etc/crontabs/root
ruzickap /
Last active Feb 1, 2016
OpenWrt system configuration including MidnightCommander, screen and ssmtp
opkg install bash bind-dig diffutils digitemp dstat file htop kmod-usb-serial-pl2303 less lftp lsof mc mtr nmap rsync screen ssmtp sudo tcpdump
#File highlighting in "mc"
mkdir -p /usr/lib/mc/extfs.d
touch /etc/mc/sfs.ini
wget --no-check-certificate -O /etc/mc/filehighlight.ini
#Favorite "mc" settings
mkdir -p /etc/skel/.mc/
ruzickap /
Last active Mar 5, 2019
OpenWrt Lighttpd modification to use https and serve transmission, foris, and personal web pages
opkg install lighttpd-mod-proxy
#See the for main "myadmin" page
mkdir -p /www3/myadmin/transmission-web
mkdir -p /www3/myadmin/luci
cp /etc/foris/foris-lighttpd-inc.conf /etc/foris/foris-lighttpd-inc.conf.orig
cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig
#Let foris "listen" only on
#sed -i "s@\$HTTP\[\"url\"\] !~ \"\^/static\" {.*@\$HTTP\[\"host\"\] == \"192\\.168\\.1\\.1\" {@" /etc/foris/foris-lighttpd-inc.conf
ruzickap /
Created Apr 11, 2014
OpenWrt Rainbow - set led colors
uci set rainbow.wifi=led
uci set rainbow.@led[-1].color=blue
uci set rainbow.@led[-1].status=auto
uci set rainbow.pwr=led
uci set rainbow.@led[-1].color=red
uci set rainbow.@led[-1].status=auto
uci set rainbow.lan=led
uci set rainbow.@led[-1].color=green
ruzickap /
Created Apr 13, 2014
OpenWrt system and firewall changes
#Configure ssh key autologin:
ssh-copy-id -i ~/.ssh/id_rsa root@
uci set system.@system[0].hostname=gate
uci add_list sshd.@openssh[0].Port=2222
uci add firewall rule
uci set firewall.@rule[-1].name=ssh
uci set firewall.@rule[-1].src=wan
uci set firewall.@rule[-1].target=ACCEPT
You can’t perform that action at this time.