Blog

Finding iptables Rule Numbers

A lot of commands for iptables work with targeting a specific rule number. To find the rule we usually run iptables --list. Then I always forget if the rule numbers start at zero or one (it's one) and then have to manually count through the dozen or more rules I have in place. I'm never confident I'm targeting the correct rule, causing me a bunch of headaches. No iptables tutorials I ever encountered or even the iptables man page easily lets you know that you can add the --line-numbers to display the rule number.

Using a Bookmarklet to Load a Webpage from your Computer to your Smartphone

Using the Google Charts API, you can create a JavaScript bookmarklet to give you a QR Code for the page you are currently viewing.  From there you can scan it from with your phone and load it without having to e-mail it or tap in the URL by hand.  Just create a bookmark on your bookmarks bar with the following as the URL:

javascript:void(window.open('http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl='+encodeURIComponent(location.href),'Qr%20code','top=100,left=200,width=350,height=350,status=yes'));