Saturday 19 October 2013

Bash script wrapper for Easy Firewall Generator IPTables

I wanted a gateway firewall, to share internet access from one interface to another.  Iptables is excellent for this, but setting it up manually is a pain.

Easy Firewall Generator provides a excellent gateway iptables script but in my environment the interface names could change and manually editing the script is no good.

This script basically a 'wrapper script' for the Easy Firewall Generator script, with a few mods.

The usage is: 
./ics.sh -i [Internet Interface] -e [Sharing Interface] -a [Sharing IP Address]
 
For example, if eth0 had internet access and I wanted to share the internet connection to hostapd wlan0 (10.0.0.1) then the command to enable sharing would be:

./ics.sh -i eth0 -e wlan0 -a 10.0.0.1


You will need to generate a iptables 'firewall script' using the Easy Firewall Generator site.
  • On the website just select arbitrary values for the interfaces and ip addresses.
  • On the website, in section "Select Type of Internet Address ", select "Dynamic Internet IP Address"
  • Click generate, save the code, comment out the "Internet Interface" and the "Local Interface Information" sections in the saved 'firewall script'.
  • In the 'firewall script' remove the first line "#!/bin/sh"
  • Then add the raw 'wrapper script' below to the top of your firewall script.
  • Save and chmod +x the file before trying it out.


Those instruction suck.
Find the script here or below:




WindyCityTech Blogger
WindyWindyCityTech Wordpress

UPDATE: Modern Bash Wifi Connection Script for Linux; goodbye network manager

An update to a previous post.  This script has some more command line features, including a random_config_mode.

The random config mode can be used to check several AP's in the area for internet access.  In internet cannot be found, the script will randomly try another connection until internet can be found again.  The timer to check for internet access is randomly set between 60 to 90 seconds for an extra touch.
A preferred AP can be initially chosen in the random mode, so if it does fail, another connection will become selected.  In no way is this script perfect, results may vary depending what distro you are using.

Completely run from the command line.  Great for Raspberry Pi.

View it here: http://pastebin.com/vcVC9iL9

or below.



WindyCityTech Blogger
WindyWindyCityTech Wordpress

GNURADIO needs a urgent overhall

From the GNURADIO website: "GNU Radio has a steep learning curve", Fuck off, what it really means is:

GNU Radio is porly written / implemented / not user fiendly / has too many obscure install options and is designed to simply waste your time.

Furthermore the build-gnuradio script is fucking stupid.  It will ruin your system, beware.  Best to stick to the deb packages if you are on Debian.



WindyCityTech Blogger
WindyWindyCityTech Wordpress

Thursday 10 October 2013

Get back the Black Bar Toolbar on Google


Why do Google remove efficient mouse based UI's for favor touch screen based UI's on PC platforms?  After the trouble everyone was having with the Google Compose in Gmail, this is another nail in the coffin.

The issue access to apps like "Drive",  "Calendar", "News", etc is NOW restricted by the need to navigate a grid all the way on the right side of the screen.  This focus stealing design is no way efficient and only tailors a user experience for touchscreen users.
What used to be "Look, Point, Click" is now, "Scroll Right, Click, Look, Read, Click".
Great F*ckin Work

There is a solution for the new time robbing issue:
Install Stylish from Userstyles.org or from FF Addons page.
Install Google black nav bar returns from the Userstyles.org page.

On a serious note, these stop gap solutions just to gain user efficiency is wearing thin.  And it is of a similar road to being frustrated with all the baggage tolerated using Microsoft Windows products, which lead to finding alternatives.


WindyCityTech Blogger
WindyWindyCityTech Wordpress

Saturday 5 October 2013

Installing dhcpd dhcp server on Raspberry Pi isc-dhcp-server

Quick notes for installing isc-dhcp-server on the pi.  Should work the same for other Debian based distros.

Install isc-dhcp-server.
sudo apt-get autoremove dnsmasq
sudo apt-get install isc-dhcp-server


Give your interface  a fixed ip.
sudo nano /etc/network/interfaces
#
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1


Setting isc-dhcp-server to use eth0
sudo nano /etc/default/isc-dhcp-server
#
INTERFACES="eth0"
DHCPD_CONF=/etc/dhcp/dhcpd.conf


Setting up the dhcpd.conf for eth0, comment out everything else
sudo nano /etc/dhcp/dhcpd.conf
#
ddns-update-style none;
log-facility local7;
#
subnet 192.168.1.1 netmask 255.255.255.0 {
#
range 192.168.1.10 192.168.1.20;
option routers 192.168.1.1; #this is the gateway ip for your clients
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 8.8.8.8, 208.67.222.222, 192.168.1.1; #ns.exapmle.org
default-lease-time 86400;
max-lease-time 86400;
}



To test check your syslog while running:
sudo service isc-dhcp-server start


WindyCityTech Blogger
WindyWindyCityTech Wordpress