Archive

Posts Tagged ‘linux’

Linux Credits

April 9th, 2010 subogero No comments

I happened to activate the “Source” repos in Synaptic today and then downloaded the Linux 2.6.28 source code. Just for fun.

I also happened to have a look into CREDITS. It turned out to be an interesting read. It seems Linux comes from the happier parts of the world. Let’s see:

++ I'm proud to announce four Hungarian kernel hackers
++ But the happiest part of the Eastern Block seems to be the Czech Republic
++ The North rocks, or rather hacks (Finland, Sweden, Denmark, Canada)
++ The bulk comes from the West (USA, UK, Germany, Netherlands, France, Italy)
++ Eric S. Raymond is there (a.k.a. Master Foo)
++ Japan in da house
++ The Republic of China (Taiwan) beats ...
-- ... the People's Republic of China (only one hacker for 1 billion people)
-- India, just one? Come on! (Even he is Malaysian)
-- Same for Israel. Although I always knew Haifa is the best place there
-- Absolutely zero from Islamic countries.

I have a theory about the effects the “Religion of Peace” has on the human brain. It seems to be confirmed.

Jaunty Keyboard Layout Settings 2

March 18th, 2010 subogero No comments

Finally. I’ve picked up my US keyboard for the ASUS UL20A today. Installation was surprisingly easy, with no warranty-void-if-removed stickers anywhere. Time to play again with keyboard settings. Default layout became US International (with dead keys). I kept Hungarian (qwerty) as well for the occasional őŐűŰ. And now to the most interesting part, the Layout Options.

Ctrl Key Position, Make CapsLock an additional Ctrl.
Hurraaaaah!!!! The bloody CapsLock is eliminated at last!

Key(s) to Change Layout, Both Shift keys together.
A combination of keys far away from each other, never normally used together.

Use keyboard LED to show alternative layout. CapsLock.
Of course. As the bastard is dead, I can use its LED to indicate if the Hungarian layout is active.

This incredible abundance of keyboard settings is amazing. A good reason alone to choose Linux over Windows.

Apple vs Ubuntu

February 11th, 2010 subogero No comments

Apple’s products are simply beautiful. Mac mini, iPod Nano, MacBook or iPhone: anything they do, they do it with style.

Except, they don’t always work, apparently. During the weekend’s skiing/snowboarding trip, one of us wanted to transfer some important photos (showing just-about-to-fall snowboarders) from her iPhone (gorgeous pink cover) to her MacBook (gorgeous flat chassis). No way.

So we connected the iPhone to my Ubuntu-driven notebook, the “Apple Inc. iPhone” icon promptly appeared on the desktop, and in a few minutes time the compromising pictures were transferred to the MacBook travelling on board of a carefree pendrive.

Categories: Uncategorized Tags: , , , ,

Ubuntu 9.04 Jaunty on Asus UL20A

December 11th, 2009 subogero 7 comments

I’ve just purchased an ASUS UL20A-2X022V notebook. Or netbook. I don’t know. It’s actually the best of both worlds. On one hand, it has a small 12″ display, weighs in at 1.5 kg, has no CD/DVD drive, and runs 5 to 7 hours on battery. On the other hand, its small display’s resolution is 1366×768, it has a Core 2 Duo ULV SU7300 processor, 3 GB RAM, a 320 GB hard disk and a fully functional keyboard with all the special keys on the right side.

A short summary of how the different hardware components work with ubuntu:

Component                    Status  Notes
------------------------------------------
Intel Core2 Duo ULV SU7300   OK
12.1" WXGA LED display       OK      resolution autodetected
Intel GMA 4500MHD graphics   OK
3 GB RAM DDR2 800 MHz        OK
HD 320 GB 5400rpm SATA       OK      install with manual partitioning
battery Li-ion 5600 mAh      OK
power management             OK      battery life 5-6 hours
ethernet Atheros 8131        OK      see below
WLAN Atheros 9285 802.11bgn  OK      see below
Bluetooth                    OK
Sound AC'97 16bit            OK      Audacious mp3, speaker or headphone
Synaptics touchpad           OK      scrolling OK too, see below
webcam                       OK      see below
card reader                  OK
Linux kernel                 2.6.28-17

It came with Windows 7 Home Premium, which is a joke. A huge monster of an OS with the functionality of Google Chrome OS: it has a web browser.

First thing was to install ubuntu 9.04 Jaunty Jackalope. As the laptop has no CD drive I had to create a bootable Ubuntu 9.04 LiveUSB on my other ubuntu-box. The tool to use is usb-creator, which uses the iso image of the ubuntu LiveCD.

I installed ubuntu with manual partitioning. I shrank the Win7 partition from 80GB to 50GB (automounted to /windows), added a 2GB ext3 swap partition, a 50GB ext3 root partition and the rest as a /home partition. The boot menu was added, and even Win7 ran fine after a chkdisk.

The network cards were not detected upon installation. Neither LAN, nor WLAN. So there I was with no connectivity, reading with a sad irony all those posts about fixing this with apt-get xxx-backports and the likes.

I ended up downloading compat-wireless-2.6.30.tar.bz2 on another box to a USB stick, and then unpacking and compiling it on the laptop. I realised too late these kernel modules were for a newer kernel. Nevertheless I did “make install”, I did “make unload” and I did “insmod ath9k.ko”. It did not work due to incompatible kernel versions. I sadly rebooted to Windows, but later gave it another try. Miraculously, all network cards worked like a breeze! Don’t ask me why…

Touchpad: everything works, but it’s hard to feel where is the scrolling area. And the left button is too hard.

Keyboard (Hungarian): OK, but it will be swapped for a US layout, whose Hungarian is worse, but speaks better Code.

Webcam: I installed the UCview package to record videos with it. Skype works too.

I downloaded all the updates, then SynapticPackageManaged Rhytmbox/Evolution out, Audacious/Thunderbird in, I installed basic development stuff, and last but not least git-cloned and compiled the newest Midnight-Commander master with utf8-support.

One more thing: it is very very quiet. Summary? Bloody marvelleous!

Linux On Laptops

Categories: Uncategorized Tags: , ,

Compile on Linux for Win32

September 12th, 2009 subogero No comments

This is perverse. I’ve just compiled a native Win32 application on Linux. What’s even more perverse it runs on Linux too with Wine.

To cut a long story short I needed a command line tool to send emails using the MAPI protocol, the only language spoken by Outlook and MS Exchange. Don’t ask me why. It’s by the way my first ever Win32 application using the Win32 API. Or `mapi.h’, to be precise.

I started developing it on a Win32-cygwin platform with gcc, but I wanted to control the sources with git. Which prefers Linux. So I ended up rebooting the box a few times to change between the two. But I’m extremely lazy, so I soon googled for a way to cross-compile Win32 programs on a Linux host. It did not take long. I summarize my findings in a few lines:

What to install:

sudo apt-get install mingw32

How to compile:

i586-mingw32msvc-gcc -L/usr/i586-mingw32msvc/lib \
  -I/usr/i586-mingw32msvc/include -o foo.exe foo.c

The result? See the mapis page.

Categories: Uncategorized Tags: , , ,

The go Page

August 7th, 2009 subogero No comments
Go’s goal

“go” is a general-purpose command-line launcher for Gnome/Linux, an extended “gnome-open” which can open URLs, files or even programs in a new window. A bit like Windows “start”, just better.

“go” will open a new terminal window.

“go <CLI program>” will open it in a new fully independent terminal window.

“go <GTK+ program>” will open it in a fully independent window.

“go <URL>” will open it with the preferred application.

By an “independent window” I mean two things:

The starting terminal is not blocked while the started app is running;

Closing the starting terminal does not kill the started app.

Bonus: start a Google search for “foo bar” in your preferred browser with

google foo bar
Installation:

Download go.tar.gz and extract files in a new directory, preferably “go”.
Type “sudo make” for installation.
Enjoy.

Lessons learned:

How to decide if an argument of a shell-script is a program?

which $1
#prints the location of the command, or nothing if not a command

How to check if a shell-script has no arguments at all?

if [ $# -eq 0 ]

How to check if the last command returned no error in its exit status?

if [ $? -eq 0 ]

The trickiest: how to tell if a command is a terminal- or a GTK+ application?

Search for “libgtk-x11″ in it if it’s a compiled program.
Search for the respective gtk dependency if it’s an interpreter-script:

import gtk # Python
use Gtk2   # Perl

“go” knows these two at the moment, but the list should be extended to all known interpreted languages and graphical toolkits. Actually it should work the other way around, detecting terminal-only applications. But for instance Gimp contains the strings “stdin”, “stdout”, “stderr” and “printf” so I gave up.

I’ve created my first ever very officially looking manual page for “go”, credit goes to Jens Schweikhardt’s very helpful LINUX MAN PAGE HOWTO.

Tao in go

There is more Tao in “go” than in Windows “start”:

Try to start a native Windows program from command line which DOES NOT become fully detached, but blocks your command-line until it closes and returns an exit-status. Hmmm? On Linux, just omit “go”.

On Windows, the commands are scattered around in thousand folders, not listed in the PATH variable. On Linux, on the other hand, all commands are on the PATH, as there are only a few standard places to store them: /bin:/usr/bin:/usr/local/bin. So “go” can access them all.

View the manual page?

man go

Finally, how do you edit the “go” script itself?

go gedit go