How-To's
Programming Under Linux
belly — Wed, 2011-01-12 16:19
This section will contain various information on how to natively do computing programming using Linux, which will detail the use of a variety of programming languages.
Track Your Lost Mobile Devices
noorbeast — Sun, 2011-01-09 08:48
Our computing is now so portable that a laptop or mobile phone can easily be lost or stolen.
There are some basic things that all laptop and phone owners should consider when they first set it up, such as use a strong password, backup key data, encrypt sensitive data, the home directory or, for the really paranoid, the whole disk.
Simple things like engraving a name, contact details and possible reward for the return of the device can assist if it is lost. Sometimes though it would be better to actually track the laptop, which is where the open source, cross platform Prey Project comes in: http://preyproject.com/
So what is Prey and what does it do? The Prey project page advises that "basically you install a tiny agent in your PC or phone, which silently waits for a remote signal to wake up and work its magic.
This signal is sent either from the Internet or through an SMS message, and allows you to gather information regarding the device's location, hardware and network status, and optionally trigger specific actions on it".
You also have choices in setting up Prey, either utilising the excellent online site to activate and track a lost device, or using your own email.
The basic Prey account is a free for a 3-device and 10-reports plan. More extensive plan coverage of additional devices and reporting is at a monthly cost: http://control.preyproject.com/subscription/new
Prey is a wonderful open source initiative, but there is no guarantee that Prey or anything else will ensure the return of a lost device, so be sensible when setting up and maintaining a mobile device and make sure you have copies and ensure the safe storage of sensitive data on your mobile devices!
LinuxMint9 on a Intel iMac 27"
OMR — Sun, 2010-10-31 13:49
How to install LinuxMint9 on an iMac 27 inch Intel machine........
First, use the inbuilt disk utility of the iMac to add a partition your internal hard drive with a partition of whatever size you want/need your linux installation to be. Do not format or do anything with it yet! leave it as blank space.
If you haven't already installed rEFIt (a boot loader thingy for macintosh), then download and install it now!
Put the live cd or dvd of mint9 into the cd/dvd drive on the side of the iMac. Shutdown the computer (shut down, not a restart.)
When you reboot the machine, rEFIt should give you an option to boot from mac os or linux cd (it will show an apple and a nice little pic of 'TUX' the penguin. The penguine is what you want, so use your up/down/left/right keys to highlight it.
When the live edition of mint9 starts up, goto the menu in the bottom left and select menu==>administration==>gparted. Use gparted to format the blank partition to whatever combination you want to use for your linux machine.
Install LinuxMint9 onto that partition...... It should be sda3 unless you may have already repartioned your hard drive to othe partitions as well.
Once installed, do not imediatley restart the machine, go back to use live cd some more then shutdown from there.
Same procedure as above for rebooting at this stage. Once back into the installed mint9 OS, you will notice that there is no sound from the iMac's inbuilt speakers. This is the only thing that does not seem to want to work properly in the iMac linux installation.
Go to menu==>terminal....... In terminal type sudo gedit /etc/modprobe.d/alsa-base.conf
Scroll right to the bottom of the file and type options snd-hda-intel model=mbp55
Save the altered file.
In terminal type alsamixer
Tab across three times to the Front Sp shown on the screen, press m on keyboard and up arrow to required volume position.
Press esc on keyboard......
Now Reboot/Restart and voila there is good sound appearing from the iMacs inbuilt speakers... I find these speakers are of excellent quality for my usuage.
Linux 101 Hacks
aondig — Tue, 2010-08-03 05:52
This is a book that let to know more about the linux terminal. the author says that "there are 101 hacks that will help you build a strong foundation in Linux", that's good
You can download and practice in your home.
Dynamic Wallpaper
Matty — Tue, 2010-07-20 17:45
Skip to the end if you just want to try it out, the process description is pretty long... Here's what one of the 8 phases looks like: http://img844.imageshack.us/img844/2016/57179053.jpg
Since I am switching over to a new machine I've been creating a custom Ubuntu install to take with me. While looking around the net i stumbled upon the idea of a dynamic wallpaper. Unfortunately I've heard these are far too CPU intensive for the task they perform due to constantly checking their conditions for updating. So I decided to have a go at creating my own.
Most dynamic wallpapers operate on a day/night or seasons basis, this is complicated when creating one as a series of images for the same scene at different times would be needed. Instead of using day and night for the change of wallpaper, I decided to use the phases of the moon. I found a script online that calculates the moon phase (It is possible to pull the information from online, however I would like the script to work offline). The original script can be found here: http://jivebay.com/2008/09/07/calculating-the-moon-phase/
For the most part this worked as-is, however bash had a problem with the string outputs (New Moon, Waxing Crescent Moon etc), so I replaced them with a number (0-7). I now had a working script to tell me the phase of the moon, so I went searching for images for it to set to the background. I eventually settled on a city view, found here: http://commons.wikimedia.org/wiki/File:New_York_City_at_night_HDR.jpg. The image is licensed under the creative commons attribution-share, so you're allowed to modify and distribute it as long as you credit the author.
I found the original image was a little bland, so I fired up gimp to do some editing. I used colourise (Colours->Colourise) to add a bluish grey color, giving me this: http://img210.imageshack.us/img210/9679/ny2p.jpg. I then combined (Filters->Combine->Depth Merge) this with the original image, changing the source and depth map selections to the original and edited layers. This gave me the base image for the background: http://img837.imageshack.us/img837/8616/ny3.jpg
Next I found images showing each phase of the moon: http://commons.wikimedia.org/wiki/File:Joka2000_-_Moon_in_Dec_2005_%28by.... Since just cutting and pasting these phases onto the image would leave ugly blackspace I needed to do some editing before moving the images. I used Layer->Transparancy->Colour to Alpha to change black to an alpha channel. If you do the same you'll notice the image becomes almost invisible, but don't worry, when it's pasted on top of the dark city sky, it'll look like it was before. The moon was also a bit too bright, it stood out from the image too much. Again I used colourise to give it the dull blue look. Finally I copied the six phases of the moon that I needed onto the image, saving the image as 1.jpg to 7.jpg as I went (0.jpg is the original - no moon). I have these in a folder on my home directory along with the scripts.
The last step was finding a way to take the output from the moon phase script and assign a picture accordingly. It was here that I found that bash didn't like me ('if' statements were the main cause). Eventually the problem was solved by not using them and editing the moon phase script as mentioned near the start. The end result was rather simple:
#!/bin/bash
phase="`php Moonphase`"
gconftool-2 --type string --set /desktop/gnome/background/picture_filename /home/newage3680/.Background/$phase.jpg
I then set it up to execute this script on startup (actually I had some issues with that, i had to make another script in my home directory that in turn executed this script). The end result suits my theme, so I like it.
If you're interested in using this, here's everything you need (50mb): http://www.mediafire.com/?zfql60f12qdhlj1
Remember, you will need to modify the Moonbackground.sh script so it points to the correct directory and add it to the startup programs so it updates.
And here is the Gimp .xcf image file, everything is seperated into layers (11mb): http://www.mediafire.com/?m6smgmsst641eab
Firefox: Protect your online search privacy
noorbeast — Fri, 2010-07-02 13:15
For those who care about their privacy there are search alternatives to Google, which do not log your personal data against every search you do. One I would like to suggest is Ixquick, which has a strong privacy policy and EU certification: https://us2.ixquick.com/eng/aboutixquick/
To use Ixquick you can just go to their home page: https://us2.ixquick.com/
Note that https is supported.
Firefox users can also install the Ixquick search engine plugin: https://addons.mozilla.org/en-US/firefox/addon/12389/
For me though, I prefer to set Ixquick as the default search via the Firefox address bar. To do so you type about:config in the Firefox address bar, accept that you will be careful, then in 'Filter' put: keyword. That should let you find keyword.URL. Double click on the value and set it as: https://us2.ixquick.com/do/metasearch.pl?query=
Ixquick will now be used when you do a a search from the Firefox address bar. You can follow the same steps to set any search engine of your choosing, just change keyword.URL value to suit. An alternative to consider is Scroogle http://www.scroogle.org/cgi-bin/scraper.htm
You can also generate a custom search/display string under 'My Settings' on the Ixquick page, to further refine how the meta search is conducted and displayed.
Happy searching!
Handy Applications
noorbeast — Sun, 2010-06-27 15:24
Here you will find applications that others have found useful, listed under different categories.
Editing sudoers - Be safe
noorbeast — Sun, 2010-06-27 11:44
Sudoers is one of those core files where if you make a mistake it is easy to lock yourself out of your own system. Though not as common these days, some systems use vi as the default editor for the sudoers file.
Don't get me wrong, vi is a great editor, but hardly intuitive for someone who is new to Linux. If you do not consider yourself a power vi user, and want to be safe, as you can lock yourself out by messing up the editing of the sudoers file, then use nano or a graphic editor like gedit, leafpad or mousepad instead, by setting your editor of choice like this in a terminal: export EDITOR=nano visudo
Much safer.
MTR - Combined ping and traceroute for network diagnostics
noorbeast — Sat, 2010-06-26 22:55
For tracking down where packets are lost on an internal/external network, try mtr at the command line and let it run for a while (should be installed by default on most linux distros).
mtr is a combination of ping and traceroute. Use mtr like this in a terminal: mtr google.com
Conky - Monitoring in style
noorbeast — Sat, 2010-06-26 21:48
Conky allows you to create interesting and innovative monitoring and notifications on your desktop. As a resource for the latest in Conky and Conky scripts, go to: http://conky.linux-hardcore.com/
Be sure to check out some of the beautiful work by londonali1010, a talented english lady, who is also an editor for the site: http://conky.linux-hardcore.com/?page_id=3331
Conky will soon support real transparency, which is needed for some window managers, such as KDE 4.
But there is a workaround trick for using conky pseudo transparency: http://mylittledesktop.blogspot.com/2009/08/how-to-make-conky-play-nicel... Official documentation for in-built conky variables is at: http://conky.sourceforge.net/variables.html
Official documentation for the new lua script support for conky can be found here: http://conky.sourceforge.net/config_settings.html
As an example, you can use the in-built conky variables to monitor a network like this ${upspeed wlan0} and ${downspeed wlan0}, where wlan0 is the interface that is being monitored, though you still have to set the font colour and position.
You can specify the location of a particular element in a concky script like this: ${goto 150}${voffset 280} Another recent trend is to use a template file, which is a bit like CSS for web pages, where the layout is separated from the content. If you get stuck with conky, here is a good trouble shooting thread: http://newyork.ubuntuforums.org/showthread.php?t=1280453