Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Friday, June 20, 2008

irssi notifications over Jabber (or IRC barking)

Thanks to daubers (the brains behind the XMPP doorbell) who suggested it, I now have irssi highlights sent directly to my Jabber client. Quite a handy thing since only yesterday I logged in to find several PMs awaiting me from 4 days ago.

For the base I used an existing irssi script called fnotify, which was designed to write notifications to a file. I found this script from Aaron Toponce's blog post.


mkdir -p ~/.irssi/scripts/autorun
cd ~/.irssi/scripts
wget http://www.leemhuis.info/files/fnotify/fnotify -O fnotify.pl
chmod +x fnotify.pl
ln -s ../fnotify.pl autorun/fnotify.pl
nano fnotify.pl


Change line 56 (which reads something like open(FILE, ...)) to:


open(FILE,"| sendxmpp -i me\@example.com");


Replace the JID with your own, and make sure to put a \backslash before the @ sign as above.

sudo apt-get install sendxmpp


When it is installed, tell sendxmpp what account to use for sending messages:


echo me@example.com verysecret123 > ~/.sendxmpprc
chmod 0600 ~/.sendxmpprc


Replace with your JID and password of course ;)

Now, in irssi:

/win 1
/run fnotify.pl

(switching to window 1 is necessary to see any error messages if they appear)

If it loads successfully, get someone to say your nick or send you a private message. It should appear in your Jabber client within a few seconds.

A consequence of this for me is that IRC now barks too :)

Friday, September 21, 2007

GNOME 2.20 released

...and it looks like I will be sticking with GNOME for another 6 months after all!

Even the most annoying thing about Epiphany seems to be fixed - the address bar. Also I no longer have to sync my Tomboy notes with an automated SVN commit. I'm close to forgiving it for being written in C#...

Do read!

Saturday, June 09, 2007

How to recover an Ubuntu/Linux PC

People often claim that Linux is more stable than Windows. Without hard statistics, this can't really be proven. One thing I do know however, is that when things go wrong it is much easier to recover a Linux PC than a Windows one, without restarting. In this post I will explain what to do, in easy steps, to get your Linux back running as safely as possible.

1. Kill a single graphical application
If you know the problem is a single application that you have open that maybe just froze then it is simple to fix. Press Alt+F2 and type 'xkill' (without the quotes) then press enter. This runs the xkill program, and the next application that you click on will be forced to close. If you change your mind, press the right mouse button to exit from this mode.

It may be worth setting a keypress that will automatically start xkill when you need it. In Ubuntu/GNOME, go to System->Preferences->Keyboard Shortcuts

2. Restart the graphical interface
If you are still having problems, or the whole of the graphical interface is not responding, press Ctrl+Alt+Backspace. This will attempt to stop the graphical display, and then restart it. Any applications you had open will be killed.

3. Switch to a console to end the application
If this didn't work, or you know a certain program is causing the problem, you can kill that program without using the graphical interface. Press Ctrl+Alt+F1. If your PC is running, but slowly, this may take a minute. Eventually you should end up at a text login screen. Log in with your usual username and password, and wait for the prompt to appear.

If you know the name of the program causing the problems, type: killall <program name>. If it continues, you can try to force it to stop, with: killall -KILL <program name>. For system process you may get "Permission Denied" errors. Prefix the above commands with "sudo ", ie. sudo killall...

If you are not sure which program is making the PC unresponsive, use the 'top' command. It shows a list of running programs, and their name, and in the CPU column it shows how much of the computer's processor they are using up. Once you identify the application press 'q' to exit top, and use the commands above to kill the program.

If all is now working, Ctrl+Alt+F7 will switch back to the graphical interface.

4. Emergency reboot procedure
If the steps above all failed, there is one last way to reboot your computer, and it is much safer than pressing the reset button on your PC's case, or pulling out the power cable.

It is important that you type these key combinations in the correct order, allowing the PC some time to complete the command between each one. The SysRq key on your keyboard is often also labelled as "Print" or "Print Screen".

Ctrl+Alt+SysRq+R
Switches the keyboard mode.
Ctrl+Alt+SysRq+S
Writes all data to the disks, necessary to avoid data corruption, unsaved files will still be lost.
Ctrl+Alt+SysRq+E
Tries to end processes in a nice way. Allow a little bit of time before you use the next command.
Ctrl+Alt+SysRq+I
Tries to forcefully kill processes that have not closed.
Ctrl+Alt+SysRq+U
Temporarily makes the hard disks read-only, this makes it safe to reboot.
Ctrl+Alt+SysRq+B
Force reboot.

5. Surrender
If that didn't reboot your PC, press the reset switch, or pull the plug, and cross your fingers :)


If you have any other methods, tips, or feedback to share, post a comment and let me know!

Tuesday, May 22, 2007

ObsidianLake: Another quarrel with my good friend...

In Paul's recent post about whether Linux is ready for the desktop, he debates whether there is a demand for Linux, and asks:

"Should or will Linux become a commercial product?"

I think we should look at how Linux started out, where it is now, and where it is heading.

For a start, the Linux kernel was started with entirely different goals to the components that make up the rest of a GNU/Linux system. Linux was not begun with intention of being free (as in freedom). It was a personal project of Linus. For GNU on the other hand, the philosophy came first. Ten years ago there was little commercial worth in either of these ventures, only once they were combined into a usable system would things start to gain interest and momentum.

GNU/Linux in the present day is doing quite well. It has taken a long time, but it is now ready for the desktop. GNU/Linux is earning recognition from both hardware and software makers, and the number of users is snowballing. I have to say this is in no small way helped by Ubuntu and a couple of other easy to use distributions. It is important to note that all of the most popular ones are free. Now that Linux is comparable to Windows in practically every way, what else is there to compare on, except the price? This is why I believe that free distributions will always be the most popular. Commercial distributions have their place almost only in the enterprise market.

Into the future? GNU and Linux will remain free, and Microsoft will have no choice but to switch away from its reliance on Windows being the dominant OS if it is to survive. Windows was the first easy to use OS, and it brought the possibilities of computers to those who would otherwise never have had it. This is the only reason it is on 99% of PCs today. Now that GNU/Linux is a competitor, with the added advantage of being free, Microsoft have no choice but to re-think their business. Very soon Haiku is also going to raise the BeOS community from the (un)dead, and this will only stir the mix even more.

Concluding by returning to the original question, is Linux a commercial product? No, at least, not while we are talking about the home-user's desktop. Should it become commercial? Well, supposing it did, it would lose one of the best things it has to attract people on the OS centre-ground - its freedom.

Sunday, May 20, 2007

Making Scite the default editor in GNOME (Ubuntu)

For too long I was fighting with gedit, the default text editor in Ubuntu. While it is not too bad, Scite is far more powerful, and much better.

To install Scite, you can type the following in Terminal:

sudo aptitude install scite


I had the option of changing the editor associated with each of the file types in Nautilus (which is what I did on my desktop), but I was sure there must be a better way. I found it...

sudo aptitude install scite
cd ~/.local/share/applications
echo -e "[Default Applications]\ntext/plain=scite.desktop" >defaults.list
killall nautilus

Works a treat. Also, here is my Scite settings file:

line.margin.visible=1
default.file.ext=.lua
open.dialog.in.file.directory=1
check.if.already.open=1

Tip: A per-folder settings file can be created. For example, I have created a 'SciTE.properties' file in the gloox src folder, so Scite will automatically use the correct indentation for gloox, and insert spaces when I use the tab key.

Update: I found later that this only tells scite to open plain text files. If you are dealing with code (as I am) add the following lines too:


text/x-csrc=scite.desktop
text/x-c++src=scite.desktop
text/x-chdr=scite.desktop


If you want to add other file types, find the MIME type by right-clicking on a file and selecting 'Properties', the MIME type you need to know is listed there.

Ubuntu on my new laptop (+ how-to)

Yes, my laptop (Toshiba A100-062) did arrive, and yes I had installed Ubuntu within the hour :)

I installed the latest version, 7.04, and had no trouble at all. A far cry from the way Linux used to be, absolutely everything worked out of the box. Once that would have been something uncommon, especially on a laptop. Certainly a pat on the back goes to the Ubuntu developers, and all who contribute directly or indirectly to it.

One of the first things I did was install Beryl, a 3D window manager. A full-quality video of it is here (if you're on Windows and it won't play, you need the Ogg Theora codec, try VLC video player, I think it works there).

A couple of things I would like to document here, in case they help anyone...

Memory card reader

At first I thought it wouldn't work (since that is what a lot of people told me). Sure enough, putting an SD card into the slot did nothing. However I forgot to remove it, and I rebooted with it still in the slot. It seems this was enough to trigger Ubuntu to recognise it, and mount the card.

It worked absolutely fine, until I tried a new card. The one that works is 256MB, and the one that doesn't is 2GB, so perhaps it is incompatible with the reader.

A couple of filed bugs for Ubuntu caught my eye:
Ubuntu Bug #53923
Ubuntu Bug #105284

I get the output posted there while the card is in the slot (Ubuntu tries to load it, fails, and tries again and again...).

ubuntu kernel: [ 3545.540000] end_request: I/O error, dev mmcblk0, sector xxxxx

I still have to test the card in this reader in Vista, so I can be sure it is not just a hardware incompatibility.

None of the workarounds posted in comments to those bugs worked (though I admit I did not try compiling new drivers, I am using the Feisty tifm module). I expect this will be fixed in an update.

Update: It decided to start working all by itself... :D Don't ask me what it was all about.

Second update: In fact this problem seems to be a completely intermittent problem. Sometimes it will work, sometimes it will not. When it doesn't work, I have yet to find a way to fix it, except to repeatedly remove and re-insert the card. Hopefully the next kernel will indeed fix this.

Touchpad
I knew there was a program called 'GSynaptics' which allows extra configuration of your touchpad. Being me, I had to install it. I got an error that I needed to set SHMConfig to "true" in xorg.conf. Not very helpful. Here is what I really had to do:

If you have a section that says "Synaptics Touchpad" in /etc/X11/xorg.conf already, you can just add the line:

Option "SHMConfig" "true"

to the section for the device. You must be root to edit this file, so run 'gksudo gedit /etc/X11/xorg.conf' for a GUI or 'sudo nano /etc/X11/xorg.conf' in Terminal.

If you don't have such a section, add this somewhere in /etc/X11/xorg.conf:
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "SHMConfig" "true"
EndSection
Close all your applications, log out, and press Ctrl+Alt+Backspace to restart the X server. If you haven't already, install GSynaptics.

Supend to RAM (Sleep), Hibernation and Resume

Although initially working, and working at the time I made this post, I have added this section when I discovered that somehow suspend/resume was broken. I fixed it by doing the following:

Change these options in /etc/default/acpi-support:

SAVE_VBE_STATE=false
POST_VIDEO=false
DOUBLE_CONSOLE_SWITCH=true

Note: I also changed: MODULES="tifm_core tifm_sd tifm_7xx1"
This probably isn't right, but I'm too lazy to change it back right now :). I am concerned that it may lose write-cache data for the SD card if you suspend to RAM. Maybe it won't, but you have been warned!

Next, reboot, and immediately press F2 to enter the BIOS. Change "Enable support for legacy USB devices" to 'Disabled', then Save and Exit.

Test suspend/resume, it should work. If you have a problem with the keyboard/touchpad not working after resume, download the patch (and apply it with the instructions) from this blog post.

Suspend/resume now works fine for me.

LCD Brightness

Maybe not an issue for most people. For some reason the LCD brightness controls in most places don't seem to work, yet controlling the brightness manually is possible.

Create a file /usr/bin/setbrightness:

sudo nano /usr/bin/setbrightness


Paste into it this:

#!/bin/bash
sudo sh -c "echo $1 > /proc/acpi/video/VGA/LCD/brightness"

Press Ctrl+O to save, and Ctrl+X to exit. You can now change the brightness with:
`sudo setbrightness 10` (this is the lowest brightness)
Possible values are: 10 25 35 50 60 75 90 100 (other values will be ignored)

To allow any user on the system to use setbrightness with no sudo:
`sudo chmod a+w /proc/acpi/video/VGA/LCD/brightness` (without the quotes)
This may not last between reboots though.

Links (the places from which I gathered all the information I used):
Debian Etch on a Toshiba Satellite A100-159
Ubuntu: Synaptics Touchpad

Also, how to automatically switch off the touchpad while you are typing (I haven't tried it yet):
Disable Touchpad While Typing - Ubuntu Forums
Ubuntu Tutorials - Temporarily Disable Touchpad While Typing
Disable Touchpad Tapping While Typing - Ubuntu Forums
Toshiba Satellite Laptop Success Story -Ubuntu Forums (Where I found the suspend/resume fix I wrote above, slightly modified for the A100 with Intel graphics)

Sunday, May 06, 2007

New Laptop

Finally I ordered a laptop for myself. I've been saving up for a while, but now I will be able to use my GSoC money towards it also. It should be arriving this week.

I'll be probably doing most of my development on it, so the first thing I will do is install Ubuntu alongside the pre-installed Vista. Yes, because I still need access to Windows for testing things, I will probably keep Vista, but reduce its partition size and dual-boot it.

Seeing as I have never used Vista before (only looked over someone's shoulder) you can be sure I will be posting a Vista vs Ubuntu right here very soon :)

Microsoft gives guidance on OS design

Some of you may have tried Windows Vista. It has a great new feature 'User Account Control', or UAC.

UAC allows users with administrative privileges to use the PC without the privileges enabled, until they are required. When a program requires the extra privileges, Windows pops up a dialog, describing what program is asking for administrative rights, and you must enter your password to continue. This is a great feature, and it makes using the computer for everyday tasks much more secure. For example, if your web browser was compromised, it would be limited in what damage it could cause, unless you had previously granted it administrative rights.

You may wonder why I am telling you this (you probably already know about UAC). However Microsoft have publicly said last week how great UAC in Vista is (though it hasn't stopped Apple making fun of it!). In fact they recommend that other operating systems should support it too!

"If you look at it from an architectural direction User Account Control is a great idea and strategically a direction that all operating systems and all technologies should be heading down," -- Peter Watson, Microsoft Australia's chief security advisor.


Chief security adviser? He must have used Linux, even briefly, at some time, right? This is a feature that Linux has had since the beginning, in the form of 'su' and 'sudo'. Before you think otherwise, no, Windows Vista was not even the first OS to bring it to the desktop! Here is a screenshot of Ubuntu:

Ubuntu 7.04 Released

I was originally posting a single, long post, of interesting news since I last posted. I decided to split it up though, so here goes...

Well, Ubuntu version 7.04 ('Feisty Fawn') has been released, and I'm running it :) Not too much has changed, except that this time I decided to opt for the standard Ubuntu, and not Xubuntu which I have been running up until now.

There is no particular reason for this. I still love Xubuntu, I'm just going for a change, that's all. Putting up with GNOME, too :) That said, I am not finding resource usage /that/ much higher than Xubuntu. I find that Xubuntu's interface is actually far more intuitive, and far more customisable - perhaps this is from being an ex-Windows user. However the GNOME interface wins in features, and it is well polished.

EDIT: I also forgot to add that the next version has been announced too, and it will be 7.10 'Gutsy Gibbon'!

Dell will offer Ubuntu


Dell are set to offer Ubuntu pre-installed on their consumer PCs. This news comes not long after Michael Dell was discovered to be running Ubuntu 7.04 (which was still a release candidate at the time) on his laptop. This is a huge step forward for Ubuntu, and desktop Linux. Perhaps the age-old argument "Is Linux ready for the desktop?" finally ends here...

Linutop


A small, power-efficient, inexpensive computer/device, that runs not only Linux, or even Ubuntu, but... Xubuntu! Linutop has many possibilities, especially with being so portable. Media streaming (if the CPU proves able), it is also a handy as just a portable PC. It has no internal storage, but comes with a 1GB USB key containing the OS and software. It has ethernet, USB and audio ports, and of course connects to an external monitor.

Monday, November 13, 2006

Six reasons to use Xfce

I saw this blog post by Paul-Sebastian, and I just had to post this about my favourite DM for Linux.

1) Speed
Xfce is lightweight and fast. It is not bloated by little-used features and options. Yet, when the need arises, there are plenty of plugins available... including support for GNOME panel applets! At the same time, Xfce can run on computers that would grind if GNOME or KDE were loaded.

2) Stability
Xfce is stable, development may not be as fast as some other DE's, but this is paid off for by the end stability.

3) Standards
Xfce aims to be fully compliant with freedesktop.org specifications, meaning it will work flawlessly with other applications that do the same.

4) Usability
Xfce is a very intuitive interface. It is not hard to locate settings, or customise the panels. I found it by far the easiest to use for users moving from Windows.

5) Applications
Xfce comes with a minimal set of applications, like the file manager Thunar. Thunar is a very fast, simple file manager, and also very customisable.

6) Good looks
Xfce comes with *loads* of themes, that, once applied, work with all GTK2 applications on your system - giving a very consistent UI throughout.
Xfce also supports the X composite extension, on graphics cards that support it.

7) Mice
The mice want it!

(Couldn't resist #7 :D)

PS. Don't just take my word for it... Xfce on ArchWiki

Saturday, October 28, 2006

Life on Edgy

It looks the same, it feels the same... well, the login screen is updated, and the boot splash. I wish I had recorded my boot time running Dapper, but I timed Edgy at 29 seconds from the boot menu to the login prompt. Not bad. It then takes 7 seconds for my desktop to appear after I login.

I found that Edgy now comes with a generic kernel, ie. it supports SMP, but SMP is automatically disabled when the processor does not support it. This means new installations automatically make the most of the CPU they are installed on.

I found, to my surprise (hough I have to admit I was hoping for it) that my ATI Radeon now works, with hardware acceleration, and OpenGL. Graphics now feel a lot faster than they used to, and a whole load of programs and screensavers that refused to run now move like lightning.

It meant I could afford some customisations, so here is my chance to show them off.





Yep, reminds me of Vista too. Only thing is, it runs faster :)

My windows are no longer inflexible rectangles. When I drag them, they bend, and wobble when I let them go. It had my 4 year-old brother laughing like you've never seen.

Letting go of a window also causes ripples to spread across the desktop:



and my four virtual desktops are accessed by choosing a side if a rotatable cube (yes, that is TuxRacer you see :P):



I plan on writing a how-to for this, and post it the Ubuntu forums or wiki. Currently there doesn't exist one for Xubuntu/Xfce, as it takes some hacking. It's well worth it though :P

EDIT: I just noticed the distortion in some of the images. That's not how it looks, but the tool I used to take screenshots. Use your imagination to know what it looks like really :)