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
ruzickap / openwrt_transmission.sh
Last active Jan 6, 2018
OpenWrt Transmission
View openwrt_transmission.sh
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
ruzickap / openwrt_dhcp.sh
Last active Apr 11, 2019
OpenWrt DHCP modifications
View openwrt_dhcp.sh
uci set dhcp.lan.start=200
uci set dhcp.lan.limit=54
uci set dhcp.@dnsmasq[0].domain=xvx.cz
uci set dhcp.@dnsmasq[0].leasefile=/etc/dnsmasq-dhcp.leases
#Send email for new connections:
echo "dhcp-script=/etc/dnsmasq-script.sh" >> /etc/dnsmasq.conf
cat > /etc/dnsmasq-script.sh << \EOF
View openwrt_watchcat.sh
opkg install luci-app-watchcat
/etc/uci-defaults/50-watchcat
uci set system.@watchcat[0].period=1h
/etc/init.d/watchcat enable
@ruzickap
ruzickap / openwrt_fstab.sh
Last active Oct 19, 2016
OpenWrt fstab - create and mount external USB stick
View openwrt_fstab.sh
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
ruzickap / openwrt_wireless.sh
Created Apr 6, 2014
OpenWrt WiFi configuration tweaks
View openwrt_wireless.sh
uci set wireless.radio0.channel=8
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 wireless.radio0.ar=1
uci set wireless.radio0.txpower=20
@ruzickap
ruzickap / openwrt_vnstat.sh
Created Apr 7, 2014
OpenWrt vnStat configuration
View openwrt_vnstat.sh
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
ruzickap / openwrt_system.sh
Last active Feb 1, 2016
OpenWrt system configuration including MidnightCommander, screen and ssmtp
View openwrt_system.sh
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 https://raw.github.com/MidnightCommander/mc/master/misc/filehighlight.ini -O /etc/mc/filehighlight.ini
#Favorite "mc" settings
mkdir -p /etc/skel/.mc/
@ruzickap
ruzickap / openwrt_lighttpd.sh
Last active Mar 5, 2019
OpenWrt Lighttpd modification to use https and serve transmission, foris, and personal web pages
View openwrt_lighttpd.sh
opkg install lighttpd-mod-proxy
#See the http://192.168.1.1/myadmin/ 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 192.168.1.1
#sed -i "s@\$HTTP\[\"url\"\] !~ \"\^/static\" {.*@\$HTTP\[\"host\"\] == \"192\\.168\\.1\\.1\" {@" /etc/foris/foris-lighttpd-inc.conf
@ruzickap
ruzickap / openwrt_rainbow.sh
Created Apr 11, 2014
OpenWrt Rainbow - set led colors
View openwrt_rainbow.sh
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
ruzickap / openwrt_system.sh
Created Apr 13, 2014
OpenWrt system and firewall changes
View openwrt_system.sh
#Configure ssh key autologin:
ssh-copy-id -i ~/.ssh/id_rsa root@192.168.1.1
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.