Speeding up wireless internet on Crunchbang 11

On a recent new install of Crunchbang 11 I was having major problems connecting to my router with a Ralink RT3370 wireless USB dongle from my main tower. After investigating and playing around, this is my list of changes which got me sorted:

1. AES vs TKIP Encryption:
Connect to the router and change the WPA2 encryption from AES to TKIP. My first suspicon about the lack of connection was the encryption method and maybe the latest RT3370 drivers and wpasupplicant. After changing to TKIP I could connect, allbeit with a slow connection due to packet loss.

2. Move Adapter from USB2 to USB3:
Moved the Dongle from the front USB2 connector to a blue USB3 connector at the back, and I noticed a slight speed increase. After these hardware changes, it was time to go for some terminal-fu and edit a few files to get some extra internet speed.

3. Firstly I edited /etc/nsswitch.conf:
sudo vim /etc/nsswitch.conf
I commented out the original line:
#hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
And changed it to:
hosts: files dns

4. Next I disabled ipV6 in Iceweasel:
In the address bar I typed “about:config” and changed “network.dns.disableIPv6” to “true” with a double-click.

5. Next up was to disable ipV6 system wide:
echo "#disable ipv6" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf

6. Adaptor Power Management:
Another thing I had heard is that sometimes powercontrol can interfere with wireless speed as well so I disabled it for the USB dongle:
sudo iwconfig wlan0 power off

7. Swap nm-applet and network-manager for a Manual Static Wireless Connection:
First I disabled nm-applet from autostarting:
sudo mv /etc/xdg/autostart/nm-applet.desktop /etc/xdg/autostart/BKPnm-applet
Then I stopped Network Manager:
sudo /etc/init.d/network-manager stop
And completely Disabled it:
sudo echo "manual" | sudo tee /etc/init/network-manager.override

8. Just needed to add my manual network config:
sudo vim /etc/network/interfaces
Added my wifi info:
auto wlan0
iface wlan0 inet static
address 192.168.1.136
netmask 255.255.255.0
gateway 192.168.1.1
wpa-ssid ROUTER_ESSID
wpa-psk MYPASSWORD

Then manually added the Google dns addresses:
sudo vim /etc/resolv.conf
And add these:
nameserver 8.8.8.8
nameserver 8.8.4.4

Rebooted into a system with awesome internet cow-power-fu speeds!!

Advertisements

Installing Crunchbang 11 on a Netbook with external monitor

Back on Linux at Home and Blogging again
It’s been a while since i’ve posted as a new business project has had me using Windows a lot, yeah I know, but hey, life’s like that sometimes.
I moved my main computer tower into the lounge and it now serves as our main media center, with xbmc, spotify, games etc.

Crunchbang 11 on the Netbook
This left me with a monitor, keyboard and mouse in our bedroom…. and an Asus Netbook, so I thought what the hell and set about removing Ubuntu (slow as a snail, painfully slow) and installing my trusty old friend Crunchbang (which i’m typing from now).

I downloaded the 32bit version from HERE, made a Crunchbang pendrive via Unetbootin, installed and set about configuring it to be used as a desktop.

External Monitor Resolution
The first thing I noticed was that when I changed the resolution of the monitors, the settings would be lost after reboot, so I added these xrandr commands to my autostart.sh and both get set when I login:

## Set both external monitor and netbook resolutions
xrandr –output VGA1 –mode 1920×1080
xrandr –output LVDS1 –mode 800×600

All looking nice. next up to install XBMC…..

Synchronizing Google Calendar on Linux with Thunderbird Mail

Business needs and Google services
Currently setting up my desktop for business use and decided that i’d make as much use of Google’s free online services as possible (Mail, Drive, Calendar).

Web or desktop apps?
I usually do everything via web, but am looking for a company solution as well, which will mean that I can use Linux desktops with access to Gmail, Gcalendar by simply creating a company related email address.

What do you need?
Ok, so first you need to install Mozilla Thunderbird as the email application. Available in all repos (Icedove in Debian).

Addons
The first add-on is “Lightning” calendar.
http://www.mozilla.org/projects/calendar

Then “Provider for Google Calendar” to be able to synch with your Calendar
https://addons.mozilla.org/en-US/thunderbird/addon/provider-for-google-calendar/

These can both be install inside of Thunderbird via its built-in “Addon-Manager”

Setting up your Calender Synch
Now just restart Thunderbird for the add-ons to be activated. Then add you just need a few simple steps.

1. Open your Google Calendar in your browser
2. Click on the Settings link located in the box at the right of the page.
3. Click on the calendar you want to use with Thunderbird Lightning or Sunbird.
4. Click on XML button shown at the bottom which says “Private”.
5. Copy that link

Now in your Thunderbird Lightning Calendar, click “Add Calendar”, Choose “Network Calendar”, then paste that xml URL as the destination.

All done! You now have bi-directional functionality with your Google Calendar.

 

The disk drive for uuid= is not ready yet or not present, Continue to wait; or Press S to skip

So you just saw this message at boot: 
The disk drive for uuid=[long string of numbers and letters]…. is not ready yet or not present, Continue to wait; or Press S to skip

Why did this happen?
A couple of reasons. One of your hard-drives is knackered, You’ve been messing around and accidentally unplugged a hard-drive, a partition has been formatted or is unreadable.

Most Probable Cause:
You installed another Linux distro to dual-boot with, and it has renumbered your SWAP partition, and now your old Linux doesn’t recognize it.

How do I fix it?
1. Open your Terminal with 3 tabs (Ctrl+T) on Terminator, Gnome-Terminal etc. Or just open 3 terminals if you prefer that.


2. In terminal One, list your discs and partitions to find SWAP

sudo fdisk -l

Mine are:

Device Boot Start End Blocks Id System

/dev/sda1 * 1859031040 3907028991 1023998976 7 HPFS/NTFS/exFAT

/dev/sda2 2048 1859031039 929514496 7 HPFS/NTFS/exFAT

Device Boot Start End Blocks Id System

/dev/sdb1 * 2048 488476671 244237312 7 HPFS/NTFS/exFAT

/dev/sdb2 488476672 976773119 244148224 7 HPFS/NTFS/exFAT

Device Boot Start End Blocks Id System

/dev/sdc1 2048 256008191 128003072 83 Linux

/dev/sdc2 * 512007615 623081024 55536705 7 HPFS/NTFS/exFAT

/dev/sdc3 623081472 625141759 1030144 82 Linux swap / Solaris

/dev/sdc4 256008192 512006143 127998976 83 Linux

3. In Terminal Two, get the UUIDs for each partition:

sudo blkid

Mine are:

/dev/sda1: UUID=”5A81E99E5D0E4BEC” TYPE=”ntfs”

/dev/sda2: UUID=”2ED785F62B8C2905″ TYPE=”ntfs”

/dev/sdb1: UUID=”AC84B67484B6409E” TYPE=”ntfs”

/dev/sdb2: UUID=”6E5D895444E6C134″ TYPE=”ntfs”

/dev/sdc1: UUID=”fb9b8f73-8755-41d7-9c86-a721fd354bad” TYPE=”ext4″

/dev/sdc2: UUID=”22B0AAE8B0AAC1A1″ TYPE=”ntfs”

/dev/sdc3: UUID=”a90dd59c-cba2-4275-8fc0-23cf097675a2″ TYPE=”swap”

/dev/sdc4: UUID=”cb69c289-170b-4b37-8d8f-970707ec0fd0″ TYPE=”ext4″

4. We are going to turn SWAP off before we edit anything.

sudo swapoff -a

5. In Terminal 3 we will edit fstab and change the UUID for SWAP which we can see is wrong.

sudo vim /etc/fstab

Mine looks like this:

proc /proc proc nodev,noexec,nosuid 0 0

# / was on /dev/sdb1 during installation

UUID=fb9b8f73-8755-41d7-9c86-a721fd354bad / ext4 errors=remount-ro 0 1

# swap was on /dev/sdb3 during installation

UUID=8389288c-0a99-40c7-8d56-4c9333e458dc none swap sw 0 0

# Storage Partition 1 on /dev/sda1

UUID=5A81E99E5D0E4BEC /storage1 ntfs-3g auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0

# Storage Partition 2 on /dev/sda2

UUID=2ED785F62B8C2905 /storage2 ntfs-3g auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0

# Storage Partition 3 on /dev/sdb2

UUID=6E5D895444E6C134 /storage3 ntfs-3g auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0

6. Now we are going to remove the UUID from the SWAP line, and leave the cursor just after the “=”

# swap was on /dev/sdb3 during installationUUID= none swap sw 0 0

7. Now look at Terminal Two and copy that UUID from SWAP, and paste it into the fstab file so it looks like this:

# swap was on /dev/sdb3 during installationUUID=a90dd59c-cba2-4275-8fc0-23cf097675a2 none swap sw 0 0

8. Save and Quit vim with “:wq + Enter”
9. Turn SWAP on again

sudo swapon -a

That’s it, all done, you now have the correct UUID for your SWAP partition.

Wireless-Only installs with Debian, Crunchbang and Kali Linux – Missing Non-Free Firmware

Wireless Network
I changed my entire network over to wireless and my router is now fixed to the wall, 25 meters away from my office, in my lounge. The wireless from my office reaches ok, and means we have a stronger signal from the lounge where we have our XBMC media center and everybody connects with their smart phones.

Wireless PCI/USB cards and Non-Free Drivers
Due to the fact that some manufacturers won’t release the source code for their drivers (Thank you Broadcom and Ralink!!) we still have a bit of a hard time, even though Linux geniuses have reverse engineered and hacked practically all of them for us so we can load wireless modules from the kernel.

Politics and Freedom
Some distros willingly provide non-free drivers right from the get-go, others are more conservative and stick to Stallmanesque non-free restrictions. Debian does this…. still…. in 2013.


Debian Live Builder
I’ve built my own Debian based distros, and like other distros which are built with this system, mainly Crunchbang and just recently Kali Linux (The New “Debian-Based” Backtrack).

Live Yes – Install No
I recently got a bit of a surprise with some Live installs, as I found that when running both Crunchbang and Kali live, my Ralink wireless USB firmware was loaded and allowed me to connect to the internet, but when I went for the install, at the network configuration step, I was told that the firmware was missing!!

Solution
When this stage happens:
1. Take a picture of the screen on the Debian Installer which tells you which files you need from /lib/firmware. In my case “rt2870.bin” and “rtl8168e-3.fw”.

2. Insert a blank USB Pendrive
3. Reboot the Live CD to get to the Live Session
4. Copy the two needed files from /lib/firmware on the Live CD to the Pendrive
5. Reboot and run the installer

The Debian Live installer will detect the firmware on the Pendrive, load it, and allow you to choose your wireless ESSID and WPA key, and continue the install.

There’s no time like now for the old adage “You learn something new every day”.

May all you fellow wireless-only users, now be able to install any Debian-based distro without being put off by this minor freenoyance.

Unofficial Debian Wheezy Netinstall with Non-Free Wireless Firmware

Wireless Network
As I am on a completely wireless home network, with about 25 meters separating my office computer from the router in my lounge, I went on a hunt for a Debian Netinstall iso with wireless firmware already added.

Non-Free Wireless Firmware Included
I remember a while back I came across a Squeeze version. Luckily for me, there is also a Wheezy version too!

Here:
http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/wheezy_di_rc1/amd64/iso-cd/firmware-wheezy-DI-rc1-amd64-netinst.iso