Tuesday, June 30, 2009

More thoughts on the alias command

The following is taken from the Linux Information Project.
For people accustomed to MS-DOS commands, the following aliases can be defined so that a Unix-like operating system appears to behave more like MS-DOS:
alias dir="ls"
alias copy="cp"
alias rename="mv"
alias md="mkdir"
alias rd="rmdir"
alias del="rm -i"

However, some experienced users of Unix-like systems contend that this may not be a good idea and that it might just make Linux seem more confusing, rather than simpler. Instead, they advocate having Linux users become accustomed to the UNIX terminology right from the start.


I have underlined the above paragraph because it seems to me there is quite a bit of conflict within the Linux community about interoperability, not simply between Dos and Linux, or Unix, but between the variants of Linux also known as distributions. At the end of the day, it is the user which suffers.

We all know about code and how some coders like keeping their code secret, while others give their code away for all the world to see. The open-source community has grown precisely on this principle of freedom and openness, but by and large, code is still in the hands of coders, and the needs of individual communities are compromised as a result. Would you really want a world in which the only novels were written by scientists, or the only music was composed by mathematicians?

The reason why Ubuntu is so successful, is not just the easy to understand shell but the personality behind the shell which appears to be benign and the shell wants us to learn along with it, and not simply to install but to compile from source. This does not mean the Ubuntu CLI is the easiest, or best shell, and BASH still suffers from being too mathematical while the Linux support is too clinical for a lot of users. (Some might say, the problem is rather one of syntax and meaning, while others might say the problem is not simply about math but which maths, and not language, but which language?)

Now imagine being able to create different schemas of commands (using aliasing) that might confer unique advantages depending upon the target user? In other words, creating a linguistic or adaptive personality behind the computer that at the end of the day allows the user to remember and grasp the concept behind the command, and therefore to make more use of the power of the command line?

Favourite your top Ubuntu commands and add fixkey

[PLEASE SEE Better PPA Fixkey Method the below is for informational purposes only.]

In Fix Software Sources Bad Behaviour we reported two methods for accomplishing the same task of fixing keys. The first, involved manually entering two lines in a terminal. The second involved one entry. Now there is a third faster method. Aliasing.

ICE20.com describes aliasing in BASH this way:

Many of us use certain commands over and over again, or we have preferred combinations of options which we always give to certain commands. We can create shortcuts to these commands by giving them an alias in our ~/.bashrc file. The format is:

alias new_name='command -options'



There are some examples provided at the above site, but the one we want to create is this:

alias fixkey='sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com'

Which will execute a command string when you type fixkey.

1. All you have to do is backup your ~/.bashrc file

cp .bashrc .bashrc.bak

2. then open it in a text editor

gedit ~/.bashrc

3. Scroll down to the relevant section.

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.


#if [ -f ~/.bash_aliases ]; then
#. ~/.bash_aliases
#fi


4. Uncomment so it looks like this

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi


5 Save and exit.

Bash documentation recommends creating a separate file for aliases like this.

6. Create the  ~/.bash_aliases file

gedit ~/.bash_aliases

7. Enter the following code

alias fixkey='sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com'

8. Save and exit.

9. Refresh bash. by either logging out, closing the terminal or entering $ bash

10 To fix an errant key, using fixkey. Open Terminal
fixkey XXXXXXXX

WARNING: I  tried the above first leaving the sudo command out and entering it directly in .bashrc expecting that one should be able to simply sudo fixkey in this instance, but this merely turns up a "command not found" dialogue and so I included sudo  in the command string in order for it to execute. This might not be the case with the .bash_aliases file. Any advice on this would be welcome. please see Better PPA Fixkey Method

NOTE: I don't recommend going off and aliasing everything you do, as you terminal will quickly begin to resemble a unique creature which might bork when you install a new piece of software with the same command structure. (How exactly does this problem of potential commandline scripting conflict get resolved? For example, the above is substantially similar to the following posting at Commandlinefu. Depending on whether your starting point is the 'addition' of a key, or 'fixing' a key after the fact. Of course both fixkey and launchpadkey can coexist) Rather, I suggest we share commands at places like Commandlinefu or Ubuntu Forums and see if there is any agreement within the broader Ubuntu Community at what to do about reducing relatively complex or time-consuming CLI tasks into easy to remember, attractive or familiar commands. In fact creating more human, or themed commands using the aliasing capabilities of bash, could be the next frontier. I imagine the day when we will be sharing and exchanging CLI matrices or schemas as easily as trying on a new hat or pair of shoes. If the shoe fits, wear it, if not, give it away. - DRL


SEE Environment Variables

Customise Ubuwiki and share your files offline

A short while ago we announced the release of Ubuwiki for Africa. The idea is very simple. A lot of us take connectivity for granted. We also fail to take bandwidth considerations into account and the result is known as the Digital Divide. PDF is a great format for sharing books. Ogg-Theora is the open-source format for sharing music. WoaS or Wiki-on-a-Stick is "a wiki living in a self-modifying XHTML file". We want it to become the "MP3 of Data" or in Opensource terms, the Ogg-Theora of Data.


Originally Ubuwiki, essentially a modded WoaS "containing repurposed content" was a forked development of WoaS. The two projects have now combined forces and there are plans to develop the format even further. What we want you to do, is modify Woas or Ubuwiki and to share the modified files with your friends. Create online and offline data-sharing. Encourage users to share information with those who don't have bandwidth. Here is an example of a modification from the official WoaS forum "i use woas with this extention for tabs. i also did some dirty code modifications to use it with ie8 and embedded images. further i did some css modifications."


mywoas




Zentwitter on Ubuntu

ZenTwitter is an amazing small script which is able to update twitter accounts without the need of having a browser window open all the time. It uses zenity and curl. (note: if you want to just use your terminal for tweeting see this posting)

Installation

Just dump it into your ~/bin directory, open it in the editor of your choice to change the username/password, make it executable (chmod a+x) and add a launcher icon to the panel/menu/desktop of your preferred window manager.

Download: ZenTwitter.tgz

Screenshots
zentwitter01zentwit2

Ubuntu Capistrano

logo-ubuntu-machine

This looks amazing. If you need to set-up a server, Ubuntu Machine has Capistrano recipes that will automate the setups. Now wouldn't it be amazing to see some desktop customisations coming out as Capistrano recipes? In fact I would love to reduce my entire setup to a script, and carry my Ubuntu computer around in my pocket. Or better yet, upload my data, and publish my installation which could then behave like ET and phone home?

Sunday, June 28, 2009

Ubuntu International

ubuntufr

ubuntude

irishubuntu

turkye

ubrazil

ubuntuindia

Setting SVN through Proxy Server

Subversion is a version control system, which allows you to keep old versions of files and directories (usually source code), keep a log of who, when, and why changes occurred, etc., like CVS, RCS or SCCS. Subversion keeps a single copy of the master sources. This copy is called the source ‘‘repository’’; it contains all the information to permit extracting previous versions of those files at any time.

(copied from svn man pages)

To install svn just type this in terminal:
$ sudo apt-get intall subversion

To some setting svn through proxy server:
$ nano ~/.subversion/servers

And add this following lines:
http-proxy-host = your.proxy

http-proxy-port = 8080 #your proxy port

http-proxy-exceptions = localhost #etc

http-proxy-username = your_user

http-proxy-password = your_password

Save the file. Now your SVN will worked through your proxy server.

The other setting can be tweaked manually, just edit servers and config in the ~/.subversion directory

courtesy of Abz Notes http://abz89.wordpress.com/2009/01/23/setting-svn-through-proxy-server/

Can't enable visual effects, looking for compositing?

This stumped me. Low-budget computer with a fairly decent motherboard that has onboard graphics and I can't get the most basic compositing on my Ubuntu Hardy? Surely there is a solution that doesn't cost money? Well, if you need a compositing window manager in order to enable such things as the AWN dock and you can't enable Visual Effects in Preferences > Appearance, don't give up hope.

Metacity (Gnome's default window manager) can do compositing, though it's turned off by default. Hit alt-f2 and type "gconf-editor" and ENTER to launch the GConf editor. Under Apps > Metacity > General, put a check next to Compositing Manager and close the application.

You should find that you screen rebuilds and you can now activate AWN without having to buy a graphics card.

NOTE: In researching this, I found an alternative compositor or tool named xcompmgr which apparently provides basic compositing support and gcompmgr which is a GUI frontend. If anyone has tried comparing the two options, I would be interested in hearing from you. Metacity vs Xcomp Manager (xcompmgr)

Thursday, June 25, 2009

ASCII art in Ubuntu

888          8 8                       8    8 8                 w
8 8d8b. .d88 8 .d8b. Yb dP 8 8 8 8 88b. 8 8 8d8b. w8ww 8 8
8 8P Y8 8 8 8 8' .8 YbdP 8b d8 8b..d8 8 8 8b d8 8P Y8 8 8b d8
888 8 8 `Y88 8 `Y8P' YP `Y8P8 `Y88P' 88P' `Y8P8 8 8 Y8P `Y8P8

There are two ASCII art viewers in the repostory. Aview and Cacaview. Both are CLI programmes, so you have to open a terminal. Exploring the world of ASCII art is very 1999, but the retro-adventure is well worth the time and effort. You'll also find the venerable Lynx Browser, which is an ASCII browser for paper-thin net browsing, and a whole bunch of tools for generating ASCII images which could do with a brush up.

Try Cacafire a port of AALib's aafire which displays burning ASCII art flames or the Cacademo. Wish there was an easier method for creating ASCII video. I can't help thinking that there are lot of places which haven't been explored in the world of Alphanumerics and ASCII art is about to enjoy a resurgence as a design statement.

If you want to cut to the chase, Jerome Desmoulins website has an online ASCII art generator.

Or even better Sporkforge.com

Install figlet if you want an easy way to create ASCII "figs" on the command line.
sudo apt-get install figlet
figlet <text>

None of the above would be possible without the Ubuntu Forum discussion on the subject

Wednesday, June 24, 2009

31 Ubuntu HOWTOS from SayLinux

31 of the 130 Ubuntu HOWTOS from Say Linux

  1. Unzip or Unrar Many Files at Once in Linux

  2. Track MySQL Queries with mysqlsniffer on Ubuntu

  3. Set Gmail as Default Mail Client in Ubuntu

  4. Fix "Password required" Error When Using Unrar in Ubuntu

  5. Add the Trash Can Icon to Your Ubuntu Desktop

  6. Hide Removable Drive Icons from Your Ubuntu Desktop

  7. Assign Custom Shortcut Keys on Ubuntu Linux

  8. Monitor Your Website in Real-Time with Apachetop

  9. Reinstall Ubuntu Grub Bootloader After Windows Wipes it Out

  10. Display Number of Processors on Linux

  11. Delete Files Older Than x Days on Linux

  12. Upgrading Ubuntu From Edgy to Feisty (6.10 to 7.04)

  13. Save 15 Keystrokes - Use Ctrl+Enter to Complete URL

  14. Installing Rainlendar2 on Ubuntu

  15. Install Samba Server on Ubuntu

  16. Share Ubuntu Home Directories using Samba

  17. Create a Samba User on Ubuntu

  18. Set Windows as Default OS when Dual Booting Ubuntu

  19. Change your Network Card MAC Address on Ubuntu

  20. Install MySQL Server 5 on Ubuntu

  21. Install MySQL Server 4.1 on Ubuntu

  22. Install Subversion with Web Access on Ubuntu

  23. Change the GRUB Menu Timeout on Ubuntu

  24. Show the GRUB Menu by Default on Ubuntu

  25. How to Customize Your Ubuntu Kernel

  26. Enable Remote Desktop (VNC) on Kubuntu

  27. Disable the System Beep on Ubuntu Edgy

  28. Disable the Login Sound on Ubuntu

  29. Install TrueCrypt on Ubuntu Edgy

  30. Keyboard Shortcuts for Bash ( Command Shell for Ubuntu, Debian, Suse, Redhat, Linux, etc)

  31. See What Updated Packages Are Available from Ubuntu Command Line


Rest available from Saylinux.com

Sunday, June 14, 2009

Everything Ubuntu brings custom search engine

Stumbled across Everything Ubuntu quite by accident. The site appears to have been launched within the past two months and features a customised Google search engine as its main feature plus a handy page of very cool apps. Thanks to Everything Ubuntu, I found Digikam and Aptana. Now wouldn't it be amazing if we had a visual universe of Ubuntu apps to feast our eyes on? A great interface so you can just point and click, before you decide what you want to apt-get from the repos, and install?

[caption id="attachment_471" align="alignleft" width="425" caption="Great start to building a truly customised Ubuntu search"]Great start to building a truly customised Ubuntu search[/caption]

[caption id="attachment_472" align="alignleft" width="425" caption="We love them, and want more!"]We love them, and want more![/caption]

Saturday, June 13, 2009

Mark Shuttleworth turned into comic book character

[caption id="attachment_465" align="alignleft" width="425" caption="Everybody Loves Eric Raymond, is an irreverent often bizarre take on  Linux. This is the fourth time Mark Shuttleworth has appeared in the cartoon which has all the sensibilities of a television soapie and even less humour."]Everybody Loves Eric Raymond - humourless take on Ubuntu Linux?[/caption]

Wednesday, June 10, 2009

HOWTO Resolve 32-Bit Dependencies on 64-Bit Ubuntu with getlibs



This is taken from Slack-Tux, Lazy Penguin, and is a HOWTO  by Chris Olstrom, thanks Chris.



One of the more irritating aspects of running a 64-bit distribution is that there are still a large number of applications that are not compiled as native 64-bit binaries. This leads to dependence on 32-bit libraries, and managing these 32-bit dependencies can be a nightmare. There is no shortage of users who have introduced more problems than they have solved by forcing the installation of 32-bit libraries.

Cappy has released a handy script to detect and install libraries and other dependencies for 32-bit applications on 64-bit Ubuntu GNU/Linux. Handy things it can do include fetching missing libraries either by name, and figuring out which ones are needed when presented with a given binary.

Note: This script makes use of the Debian package management system, and is unlikely to function properly on distributions that are not Debian-based.

Installing getlibs

Installation couldn’t be simpler. Download getlibs, and double-click the .deb package. If you download getlibs via Firefox, you should get an ‘Open with gdebi’ option or something equivalent. To install via commandline, try:


$ wget http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb
$ sudo dpkg -i getlibs-all.deb


Installing Libraries with getlibs

Usage is pretty straightforward. If you know the name of the library you need, you can feed it to getlibs, and it should fetch it.

$ sudo getlibs -l libogg.so.0 libSDL-1.2.so.0
Matched library libogg.so.0 to libogg0
Matched library libSDL-1.2.so.0 to libsdl1.2debian-all
Reading package lists… Done
Building dependency tree
Reading state information… Done
libogg0 is already the newest version.
The following NEW packages will be installed:
libsdl1.2debian-all
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 213kB of archives.
After unpacking 20.5kB of additional disk space will be used.
Do you want to continue [Y/n]?


Alternatively, provide getlibs with the location of a given binary, and it should figure out what is missing (if anything) and install it. For example, say the binary for Second Life was located at /opt/32/secondlife/secondlife.bin:


$ sudo getlibs /opt/32/secondlife/secondlife.bin


At which point it should match any libraries that are not currently installed and fetch them, assuming they are available (see above for output example).

Sources

Monday, June 8, 2009

Google Gears on Ubuntu 64bit

64bit is often poopooed by developers who wish it would simply go away, since it adds another dimension of complexity to the development process. Consequently you are bound to see posts that tell you 64bit support is not available. I found Issue335 at Code.Google.Com

James Duncan writes "I have been enticed to install Gears by the offline support in Gmail, Google Reader and Wordpress, but was unable to easily find a current build to install. To save people trawling through the net, I have listed the builds available here."

"The files are linked as XPI files, so a simple click on the links below should bring up the install dialogue. I will update this post as new versions come out."

gears-linux-x86_64-opt-05210.xpi (Current as of 18/05/09)
gears-linux-opt-05110.xpi (2/Feb/09)
gears-linux-opt-0.4.9.0.xpi (27/Jul/08)
gears-linux-opt-0.3.25.0.xpi (18/Jun/08)
gears-linux-opt-0.3.8.0.xpi (07/Mar/08)

OpenOffice.org 3.1 For Hardy, Intrepid, Jaunty

Want OpenOffice.org 3.1 for Hardy, Intrepid, or Jaunty? Open a terminal window and follow these quick steps.
sudo nano /etc/apt/sources.list.d/PPA_OpenOffice.org.list

Copy and paste the following deb lines:
deb http://ppa.launchpad.net/openoffice-pkgs/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/openoffice-pkgs/ppa/ubuntu jaunty main

Follow the rest of the instructions
from Rebel Zero

http://www.rebelzero.com/ubuntu/openofficeorg-31-for-hardy-intrepid-jaunty/136#more-136

Friday, June 5, 2009

64 bit dev Chrome for Ubuntu Linux released

Mashable reports a Google Chrome release for Linux, and its a deb for Ubuntu in 32 and 64 bit. Here is the direct link to the 64bit download.

" Well the wait is finally over. Sort of. The search giant has released a buggy, crash-prone development version of Chrome for Mac and Linux (download it here if you dare). Of course, most eager users will probably be very confused by the “DON’T DOWNLOAD THEM” warning Google added to this Chrome release.

In a blog post today, Google stated that they are releasing this version so that developers can play with the release, provide Google with bug reports, and help them solve issues. Google specifically stated the following:
“In order to get more feedback from developers, we have early developer channel versions of Google ChromeGoogle Chrome reviews for Mac OS X and Linux, but whatever you do, please DON’T DOWNLOAD THEM! Unless of course you are a developer or take great pleasure in incomplete, unpredictable, and potentially crashing software.

How incomplete? So incomplete that, among other things , you won’t yet be able to view YouTube videos, change your privacy settings, set your default search provider, or even print.”

Wednesday, June 3, 2009

Fix software sources bad behaviour

Every now and then you will run into the problem of not having the correct keys for the software sources that you enter into Synaptic. A lot of the time, this is because nobody bothered to give them to you, or you just haven't figured out how to request them using gpg.

This is what the error looks like:
W: GPG error: http://ppa.launchpad.net hardy Release:
The following signatures couldn't be verified because the public key
is not available: NO_PUBKEY EF4186FE247510B

Fixing this is simple. Open a terminal and replace the word KEY in both lines with the key you want to get (for example, EF4186FE247510BE). Do this for each key.

Code:

gpg --keyserver hkp://subkeys.pgp.net --recv-keys KEY
gpg --export --armor KEY | sudo apt-key add -


Then
Code:

sudo apt-get update

Works like magic. Thank you to Michy99 from Ubuntu Forums for pointing this out. I also found a method for querying keyservers and adding keys from the index the long way. The tutorial is at RebelZero.Com and it is probably more security conscious than the above method.

UPDATE: I found a one line method for rectifying the problem. A lot faster than either of the above methods.

Allaun recommends using the NO_PUBKEY value (e.g. C5E6A5ED249AD24C) to add the key with the following command.
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C5E6A5ED249AD24C

Tuesday, June 2, 2009

Gaybuntu released

Freedom means infinite customisation and the Ubuntu community has been quick to cater to diversity with specialised distros for all manner of niche markets. So it was only a matter of time before Gaybuntu, or unofficial "GLBT Linux" came along. Produced by Gaylinux, yes Gaylinux does sound better, GLBT Ubuntu can be downloaded  from http://gaylinux.googlepages.com/home

GBLT_Linuxind-custom

"This is the first gay linux testing release based on the very stable release of Ubuntu Jaunty and Linux Mint. I hope you find the operating system pleasant to use as we strive as a community to make it a beautiful, simple linux experience.  Please tell me what you like or don't like,  and I will take your consideration seriously.


For ease of use I removed compiz for it was interfering with some video overlay, and open office. I replaced open office with abiword and gnumeric. I also added frozen bubble and made some nice backgrounds for aislriot card game. There is an increase in performance as a result. I created a purple theme just for GBLT Linux and added some nice backgrounds," says the maintainer Bret Colin

Good Luck Bret.