Categories
Arch Linux Command Line Linux Raspberry Pi Ubuntu

Setting up a static external IP address on a Raspberry Pi (For Free!)

If you’re planning on setting up your raspberry pi as a server or a project that’ll want you to access it from a static external IP address, here’s a really simple and quick way to get that up and running for free.

First off, this guide uses the free service from no-ip (www.no-ip.com), so you’ll want to head over there and register for that. (http://www.no-ip.com/newUser.php)

Done? Ok, great. Next you’ll want to create a new host, this can be found under the “Hosts/Redirects” page (this link should work if you’re logged in: https://www.no-ip.com/members/dns/)

Click “Add a Host”

Enter a name and choose one of the free domains from the drop down box (alternatively you are able to use an existing domain name or sub-domain if you have one.) There are some other settings, if you know what you’re doing go ahead and choose which you prefer but from those who just want to get this set up you can now click “Create Host” and you’re done.

Now, in order for this system to know what your pi’s current address is in order to assign it that domain address you need to install the client on the pi (thankfully, they have a Linux one!).

Download the latest version of their client – http://www.no-ip.com/downloads.php?page=linux

tar -zxvf noip-duc-linux.tar.gz
make
sudo make install

One there, you’ll be promted for your email and password for no-ip.com.
It will then show you have a host registered, just hit enter.
Then it will ask to update the host you made on the site “Do you wish to have host [somedescriptivename.no-ip.org] updated?[N] (y/N)”. Type “Y” then hit enter.
It’ll ask for an update interval, this can be left at 30.
Then it’ll ask if you want to “run something on successful update”, basically this allows a script to run if it gets a connection. Choose N and hit return.

That’s it, you should be done. Just test out the connection via SSH or ping and compare the IPs.

Categories
Arch Linux Fedora HowTo Linux Ubuntu

Heat Management in Linux

When you first switch from Windows or OSX to Linux, one of the things you’ll probably first notice (especially if you’re using a laptop) is that it can run considerably hotter than the alternatives. There are a few things you can do to remedy this, however. The following software packages help you keep track of and cool down your laptop/netbook, how much will depend per machine but my HP Pavilion dm1 goes from around 60-70degrees without these tools installed to around 50-60degrees and the same goes for my older Acer Travelmate which dropped from 70-80degrees to 60-70degrees. Hopefully this information will help you shave off 10degrees from your laptop, making it cooler, easier to use and hopefully extending its life a little too!

lm-sensors

First thing that you’re going to want to do is be able to see what the temperature readings of the components (that have temperature sensors) inside your computer/laptop. This can be done by installing lm-sensors:

sudo apt-get install lm-sensors

Now you’ll want to run the script which probes all the possible sensors in your laptop:

sudo sensors-detect

You’ll be asked if you want to scan for sensors and what not, follow the on-screen instructions, mostly just pressing enter, if YES is written in capitals this is the default answer and it will scan. After several times it’ll ask you if you want to save the changes, make sure you do and then you’re done.

Now you can see the temperature the sensors are reading by using the following command:

sensors
cpufreq

cpufreq is a utility which scales the frequency of the CPU, either by monitoring the systems status (if it needs more, it’ll get more) or by user controlled settings. This essentially underclocks the CPU while it isn’t in use, reducing power usage and thus heat.

Installation:

sudo apt-get install cpufreq

The best choice would be to set cpufreq to on-demand (default) or to power-saving. Alternatively, if you’re using a laptop or netbook let jupiter take care of it for you:

jupiter

Jupiter is a light weight power and hardware control applet for Linux. It is designed to improve battery life of a portable Linux computer by integrating with the operating system and changing parameters of the computer based on battery or powered connection.

Additionally, Jupiter provides quick access to some of the commonly needed hardware controls like screen output and resolution, WIFI, and bluetooth.

If you use Linux on a portable computer, let Jupiter take the effort out of going mobile.

By using this to intelligently control the CPU frequency when on battery and AC along with the tuning to the kernel and hardware, it can make a huge difference to the temperature expelled by your laptop.

Ubuntu 11:10 installation instructions: here

Graphics Card Drivers

If you have a dedicated graphics card in your laptop, you’ll also be better off installing the proprietary graphics drivers provided by the hardware vendor. While the open source ones do an awesome job of getting the card to work, more often than not they don’t include any control over the frequency scaling and keep the card running at max, along with all those other little features the card has, they’ll probably all always be running.

Nvidia : Link
ATI/AMD : Link

Categories
Arch Linux Fedora HowTo Linux Posts Ubuntu

Linux Media Players And Flash Not Stopping The Screensaver

It’s a pretty common problem, one which could be solved by pretty much the following sentence: ‘[Insert Linux Distro], [Insert Media Player] not stopping screen saver when playing videos.’ And, yeah, it’s very annoying. Something that should have been fixed thousands of releases ago, just like most common Linux problems. Luckily though there is a fix, it’s easy and it’s awesome.

Introducing: Caffeine, “An application to temporarily prevent the activation of both the screen saver and the “sleep” powersaving mode.” – https://launchpad.net/caffeine

Essentially what this program does is look for processes running on your machine (you can do this too, just run ‘ps -A’ in a terminal emulator to see a list of everything), so you set process names which the program should look out for, for example ‘vlc’ and when there is a process with this name Caffeine disables the screensaver, when the process stops the screensaver is re-enabled. It even comes with a little tray icon which allows you to manual enable or disable the screensaver/power management with a single click.

Installation (Ubuntu):
sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine
Usage:

You’ll be able to see if caffeine is running by the tray icon the first time you use it (this can be disabled in the settings).

Caffeine Running (Screensaver / Power Management Enabled)
Caffeine Running (Right Click Settings)
Caffeine Running (Screensaver / Power Management Disabled)
Adding Processes:

To add a process which will disable the screensaver from being activated, for example VLC so we can watch a movie without constantly having to wiggle the mouse:

First, run VLC (or whatever other media player you wish and just replace VLC for that for the other few steps)

Next, right click on the Caffeine tray icon and select “Preference”.

Click the “Add” button.

List of processes already disabling the screensaver, note Totem is added here.

You should be greeted by a list of the running processes, select the name of the media player (this case, vlc) if it isn’t there check under the “Recent Processes” tab or alternatively just write the command you would use to run this program from the command line.

Adding VLC to processes to disable the screensaver.

Finally click the “Add” button and close the preferences window, that pesky screensaver should no longer be bothering you!

Stopping Flash from enabling the screensaver:

Okay, this is actually really easy, if you’re using Chromium or Google Chrome or Firefox, you’ll just want to add the processes ‘npviewer.bin’ to list, you can use the above instructions to do so.

Categories
Linux Posts Ubuntu

How to Install the ‘gnome-shell-extensions-mediaplayer’ Extension

The mediaplayer widget found on github, created by eonpatapon – (https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer).

I’ve been searching for a while for a good, solid widget style thing that’ll sit in the top of the gnome-shell panel which can control the music that’s playing in banshee, rhythmbox or whatever else you want to use to play your tunes.

 

Installation:

1. First you’ll need to grab some dependencies:
sudo apt-get install git gnome-common gnome-tweak-tool
2. Next download the files from the git repository as below (this will download the folder to whatever directory you’re currently in, in terminal):
git clone https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer.git
3. Once it’s finished download (it shouldn’t take too long it’s only about 2.30MB as of writing this guide), you’ll want to install using the following commands:
cd gnome-shell-extensions-mediaplayer
./autogen.sh --prefix=/usr
make
sudo make install
4. That’s it, it’s installed. Next you’re going to want to enable it, run gnome-tweak-tool and under extensions slide the newly installed extension to ON and it should appear next to the “Universal Access Settings” in the top right.

Categories
Arch Linux Linux Posts Ubuntu

HowTo: Disable Mouse Scroll to Switch Desktop – OpenBox

Open up the openbox config file, it should be located in /home/username/.config/openbox/ but if it’s not you might have to do a little digging.

nano /~.config/openbox/rc.xml

Find the following lines and remove or comment them out, you can use Ctrl+W in nano to find:

      
        
      
      
        
      

Note: XML comments are as follow:<-- Comment -->

Save with Ctrl+X, Y, Enter (if you’re using nano) and restart OpenBox (Preferences -> OpenBox Config -> Restart) and all should be done.

Categories
Arch Linux HowTo Posts

wicd Error During ArchBang Update

error: failed to commit transaction (conflicting files)
wicd: /usr/lib/python2.7/site-packages/wicd/__init__.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/backend.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/configmanager.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/dbusmanager.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/logfile.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/misc.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/networking.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/wnettools.pyo exists in filesystem
wicd: /usr/lib/python2.7/site-packages/wicd/wpath.pyo exists in filesystem
Errors occurred, no packages were upgraded.

Remove wicd:

sudo pacman -R wicd

Re-update the system:

sudo pacman -Syu

Re-install wicd (and wicd-gtk gui if you want that too)

sudo pacman -Sy wicd wicd-gtk
Categories
Arch Linux Blog Command Line HowTo Linux Posts Ubuntu

HowTo: Remove Every Other Line in Text Files – Linux

Let’s say you’ve got a text file, of any size, big or small, and you want to remove every other line of that file, well here are a few commands in Linux that allow you to do this.

Example, you want to get from this:

1
2
3
4
5
6
7
8
9
10

To this:

1
3
5
7
9

The sed way:

 sed -n "p;N;" file.txt > newfile.txt

The awk way:

 awk 'NR%2 != 0' file.txt > newfile.txt

Here you can actually specify N lines, replace 2 in the above command and you’ll be able to take out every N’th number. As an example, here’s the above replaced with a 3 on the file:

1
2
4
5
7
8
10

Easy as pie, right?

Categories
Linux Posts Ubuntu

Error: “end_request: I/O error, dev sr0, sector xxxxx” – Linux

Error:

end_request: I/O error, dev sr0, sector 537392

If you’re getting a similar error filling your screen once you’ve installed Ubuntu, don’t panic. It’s pretty common which is basically because Ubuntu (or any other Linux distro) can’t control your CD/DVD drive properly, it’s probably trying to open/close it but doesn’t know if it has or not. The problem is that you don’t get to see what Ubuntu wrote before because it’s filled your screen up with this error.

If you’ve just installed Ubuntu this probably happened when it wanted you to take the disc out and close the cd tray (if there is one) then hit Enter to finish the installation, so just do that and ignore this error.