Blog xaie

Entries tagged as ‘linux’

Upgrade to Ubuntu 9.10

15 November 2009 · Tinggalkan sebuah Komentar

Kubuntu 9.10 ScreenshotAs if continuing to my own tradition, that is to upgrade to every x.10 release, I just manage to upgrade my Linux install to Kubuntu 9.10. Yay, another 600-`somthing` megabytes wasted. I would like to report my experience so far, and if you don’t like about it you are more than welcome to navigate away from this page, on my seemingly dead blog.

First, the download, as usual, filled with guilt and curses. Mainly moaning about my slow internet connection and various hate-themed blog drafts on the subject never made it here just because the connection was too crappy while downloading.

Next, the live CD session was a good thing. I’ve seen worse from the Kubuntu dev team *cough*8.10*cough* so I didn’t budge at the very least. Kubuntu 9.10 featuring a sane interface, IMO, and everything seems shiny. The QtCurve is a big factor in this release because in the very first minute with Karmic Koala I switched from Oxygen to QtCurve because I’m too lazy to waste my time by getting senile over inconsistency between Qt and GTK apps. Karmic Koala with QtCurve made my day, or night, whatever.

Next, as upgrading on every-other Kubuntu release made me learn, is `that GRUB menu` issue. Because I want to allocate more space for linux partition, (don’t worry here I did backup my stuff, I think..) and I want to use the sexxxxy ext4, so reformat it is. The usual drill for Windows partition: backup, scan, defrag, have been done before I made the final plunge. *aargh!*

I was half surprised, although it is obvious because I just formatted my partition so I’m going to see new files but my gotcha moment came from the missing /boot/grub/menu.lst file. Instead, I was greeted by a shell-script-like grub.cfg file with fancy *.mod files scattered all around. Okay now, I have to confess that I didn’t follow GRUB development progress like EVERY Kubuntu user, so I did (a little, a little bit.. coz you know, I have to maintain my image as a resourceful IT dude *hehehehe..*) freaked out for 5 seconds or so. The vulnerability feeling sucks, even for a minute. I have to get online, Google for a while, before learning the NEW and IMPROVED(tm) way to do the same old stuff. Bastards.

After the mandatory apt-get update, pulling in a few important apps, setting up ssh, compiling FPC + Lazarus, mucking around with python installation, and sudo nvidia-settings, and a futile attempt browsing the games package (in short: getting used to the new environment) I realized my audio didn’t work. Somewhere along the line between my first login to a few sudo apt-get install killed the sound. I recalled there was audio on login but somehow sox cant play my ogg files now.

The solution to my audio problem was to create the .asoundrc, .pulse/default.pa, and .pulse/daemon.conf file, add myself to pulse group, and crank the volume using alsa-mixer, a minute of BIG DEAL. So I’m a little bit experienced with PulseAudio, so what? Pull in gmpc (and its dependency) from the repository and in no time I can listen to music streaming from my server computer.

Now I’m sitting here, headphone in my ears, sipping coffee while one hand typing this post.

Kategori: Orang bego punya kegiatan
Ditandai: , ,

Lupa-lupa Ingat: Double SSH Stupidity

1 September 2009 · Tinggalkan sebuah Komentar

Login menggunakan Open SSH dari komputer A ke komputer B, pada saat asik kerja tiba-tiba ingat perlu file dari komputer A. Karena tidak tahu letak persisnya di mana, SSH ke komputer A untuk find file yang dimaksud. Gunakan scp (!!!) untuk kirim file ke komputer B.

Baru sadar setelah ketik exit. :D :D cengengesan maksudnya :D :D

PS: Sedang terlalu fokus, terburu-buru, apalah..

Kategori: Orang bego punya kegiatan
Ditandai: , ,

Stupid Debian Kernel

5 Juli 2009 · Tinggalkan sebuah Komentar

I freaked out when my server computer didn’t boot to my new Debian install. I guess something about this generic kernel just ain’t right; I mean at least on this computer, because somehow it ran just fine on VirtualBox.

For a quick hack I tried booting from some live cd (I think it was a Slax) so at least I can mount it and get an older kernel from my other computer, extract the old 2.6.22-generic kernel from backup archive (that was coming from an Ubuntu 7.04 partition, because that’s my only kernel backup) and get that damned grub to play nicely by setting it to default. Why? Because I’m using an old CRT monitor, so old that I can’t see anything before 3 to 5 minutes after the first time i press power-on button or reset; I know.. I know it’s time to get a new one;).

Now at least I can get online from LAN-sharing because I can’t get Huawei E220 to work yet. Something that was as trivial as ‘wvdial MyNetProfile &’ have to wait because I know that I have to get/compile a better kernel. So, yeah busy. But the bright side of this whole situation is nothing of value deleted from this install …….. yet (O’ UNIX gods, please guide my fingers).

Aaaarrrggghhh!!!!

Kategori: Orang bego punya kegiatan
Ditandai: , ,

ssh_mp32ogg.sh

17 Juni 2009 · Tinggalkan sebuah Komentar

‘cos those MP3 wont convert by themselves.


#!/bin/sh

# -----------------------------------------------------------------------------
# It is a simple script to convert mp3 files (one at a time) to ogg on my
# other computer, because that's where the LAME codec is installed.
# Last edit: 5 June 2009
#
# It requires sox (with LAME installed) on the other computer.
#
# Usage: ssh_mp32ogg.sh [-s SERVER] [-u USERNAME] [-r BITRATE] infile outfile
# -----------------------------------------------------------------------------

mp3_fn=;
out_fn=;
server="CHIKUZA.KRYIE";	# default server
server_usr="ariel"	# default user @ server, must be exists
out_rate=4	# output bitrate to ~ 128

for cur_arg in "$@" ; do
  if [ -z "$mp3_fn" ] && [ -f "$cur_arg" ] ; then
    mp3_fn="$cur_arg";
    echo "Input file is $mp3_fn";
  elif [ -z "$out_fn" ] && [ ! -z "$mp3_fn" ] ; then
    out_fn="$cur_arg";
    echo "Output file is $out_fn";
  fi
done

while getopts s:u:r: OPTION; do
  case "$OPTION" in
	s)	shift `echo "$OPTIND -1" | bc`;
		server="$OPTARG";
		;;
	u)	shift `echo "$OPTIND -1" | bc`;
		server_usr="$OPTARG";
		;;
	r)	shift `echo "$OPTIND -1" | bc`;
		out_rate=`echo "$OPTARG / 32" | bc`;
		;;
  esac
done

# do the format conversion
cat "$1" | ssh $server_usr@$server "sox -S -t mp3 - -C $out_rate -t ogg -" > "$2"

Kategori: Ilmu · Orang bego punya kegiatan
Ditandai: , , ,

Holy crackamoley Batman! I just know how to use escape keys in OpenSSH!

22 Mei 2009 · Tinggalkan sebuah Komentar

Few minutes ago I just found out that I can actually send SSH session into background by suspending it. From now on I can use one terminal for everything I need.

How is it done? That sneaky escape_char is the key. A quick glance at the ssh manual should explain you all about it, but I found it hard to practice; I just can’t understand what “The escape character is only recognized at the beginning of a line” is supposed to mean.

I mean I know that sentence in English, duh, but what the heck is this “at the beginning of a line” is all about? Are we talking about the shell prompt here or what, Vim? I recall that every time I send a command it occupy its own line, is this a trick to confuse newbie? Even though I know that you CAN type multiple-line commands, but that is not what I’m concerned about.

I tried to type ‘~?’ literally, but that didn’t work. As I just found out (by bashing my keyboard like a space chimps) “the beginning of a line” mentioned here is to put empty command before entering ~. So all I have to do in my terminal is this:

$ < press Return / Enter >
$ < just press key combination to '~', which in my case Shift + ` >

It will be easier that way especially because I’m accustomed to reuse commands from history, walking through the command each character/word at a time, or plain-ol’ Ctrl + C.

For practice purpose I recommend you to try the ~? command. It will print the other available commands, lookup the manual to find out more.

All this time… can you imagine that??

Kategori: Ilmu · Orang bego punya kegiatan
Ditandai: , ,

kidsxp_ico2png.py

21 Mei 2009 · Tinggalkan sebuah Komentar

Because I got ICO files and I want them in PNG.


#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os, glob

# location of the files
sourceDir = "/media/yamazaki/Work/Pictures/Icons/KidsXP/"
# output directory
targetDir = "/tmp/kidsxp_png/"
# the real processor of this script: imagemagick
convertCmd = "convert %s[9] -resize %s %s"
# which categories to process? all of 'em?
processDirs = ("actions", "apps", "devices", "filesystems", "mimetypes")
# extract it and move into known usable sizes
knownSizes = ('16x16', '22x22', '32x32', '48x48', '64x64', '96x96', '128x128')

def processDir(path, thissize):
  print "Processing source path : %s" % path
  dummy, category = os.path.split(path)

  for item in glob.glob(path + '/*.ico'):
    dummy, itemName = os.path.split(item)
    tgtDir = os.path.join(targetDir, thissize, category, '')
    tgtName = itemName[:-3] + 'png' # "xyz.ico" filename to "xyz.png"

    print "Writing %20s -> %s" % (itemName, tgtDir + tgtName)
    if not os.path.exists(tgtDir):
      os.makedirs(tgtDir)

    cmd = convertCmd % (item, thissize, tgtDir + tgtName)

    # execute
    os.system(cmd)  # ooh! the horror!!
  ##
  print
##

for item in processDirs:
  s = sourceDir + item
  if os.path.isdir(s):
    for size in knownSizes:
      processDir(s, size)
  else:
    print "Skipping %s" % (s)
##

Kategori: Ilmu
Ditandai: , , , ,

PulseAudio on Kubuntu 8.10

24 Maret 2009 · Tinggalkan sebuah Komentar

This part was supposed to be a part of A Few Days In KDE 4 post, but I think it deserves its own post.

First of all, when I played with my new Kubuntu I realized that I forgot to backup PulseAudio settings. Damn. Anyway, this might be a good read for everybody else trying to get PulseAudio working, which I did in 20 minutes or so (most of the times spent downloading PulseAudio and everything else needed to make it work) to get my previous setup.

For a starter, I have to enable ALSA to use PulseAudio output, so I typed this into ~/.asoundrc:


pcm.pulse {
  type  pulse
}

ctl.pulse {
  type  pulse
}

This should enable PulseAudio audio playback on ALSA (the one I’m using right now and in the past).

Next I have to (re)configure PulseAudio server in this computer, just create another file at ~/.pulse/default.pa and put this in it:


load-module module-alsa-sink
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/24

The first line should load the ALSA module to make PulseAudio use ALSA. The next one is to use native TCP protocol nothing fancy really, with a restriction on clients able to ’send’ their sound to this computer. In this case I’m accepting sound from my local LAN (machines starting with “192.168″ on their IP) and localhost (127.0.0.1); of course with extra precaution put on my firewall to block all entrance using PulseAudio port through unwanted network interfaces.

I tried to start PulseAudio for the first time by typing pulseaudio on the console. Right now not only that I know my settings working but I also got ~/.pulse-cookie created by PulseAudio. This is important because this is the cookie that allow the client computer, the one that provides playback, the one with MPD playing my songs, to connect to this computer. This is like public key in SSH, if you know what I’m talking about. Anyway what I have to do is to copy it to the remote machine to make PulseAudio authentication work; scp to the rescue!

At this stage PulseAudio should run as your everyday program, while what I want is to start as a daemon. So to make PulseAudio start as a background program, I created another file called ~/.pulse/daemon.conf and put this in it, a self-explanatory line:


daemonize=yes

After that when I started pulseaudio it works in the background, perfect. Now I can listen to music like I did before :D .

Kategori: Ilmu
Ditandai: , ,

A Few Days In KDE 4

18 Maret 2009 · Tinggalkan sebuah Komentar

I managed to install KDE 4 since the last post, it was not so hard but of course not without quirks. As I managed to post this thing on my new install of 8.10, been trying it for a few days, adjusting to new concepts and UI, etc. I can say that I’m disappointed with the new KDE, I prefer KDE 3.5 but I’ll survive this one; no.. and I still like this one over Gnome.

Getting Ready

First of all the installation process itself was not right after the ISO download. Before logging off I created a backup of my home directory, a simple tar command followed by scp took 4 ~ 5 minutes to backup everything to a safe place before restarting the box.

As a personal custom before installing new OS, I usually start the whole thing with diagnostic process, starting with defragging my XP installations (both of them), with mandatory scandisk on each system just to be safe, all took me 2 ~ 3 hours (slow, I know.. :) ). After I’m satisfied with my hard disk condition I rebooted to Kubuntu to copy the ISO file to my server box, which in turn will host my HTTP-based installation but a quick glance at my CDs pile found me a nice yet unused CD-RW, so I scratch that idea away. I thought a CD installation is better anyway because I might want to install this one on another machine. Burning the ISO image took 20 ~ 30 minutes including verification, of course I test the CD by mounting and browsing it for a while before logging off, yet again.

I restarted the box, alter the BIOS boot sequence and after a few seconds presented with the language selection menu only to be followed by the Live-CD boot menu. I added nofstab to the end of Live-CD boot parameters because I don’t want it to mount my filesystems because I want to resize my previous Linux installation to a comfortable 5 GB (from 3 GB :D ).

My First KDE 4 Experience

The new interface looked great, I enjoyed it for 5 minutes or so before I experienced my first KDE 4 crash notification; not good. The screen flickers, oh God, what can I say.. almost drive me nuts. I noticed my network already up (God bless the dude who invented DHCP), I login to my server box, get myself online and search the Google how to kill fix this. Either my Google-fu was strong that day or it was a common problem I don’t know, I found a solution to kill the ‘Detecting RANDR changes’ service in a minute (which is a good thing because the next minute I might gone postal).

Making Rooms

I started the install process, a nice one I might add. It detected my hard disk layout right away, and of course I chose manual partitioning. The interface reminds me to Partition Magic, somehow for a few seconds I hesitated to delete my Linux install although I know I did backup everything: documents, logs, home directory, including deb packages.

Anyway after a few seconds of self-cursing I deleted my old Linux partition, and resize the previous partition to make room for a larger ‘unallocated’ partition. I reformat the new and larger partition as ext3, and set its mount point to ‘/’ before moving forward. After a few minutes, formatting file system was a success and I have to accept that my old Linux partition is gone, with everything that I forgot to backup; if any.

Post Installation

The installation took, roughly, 30 minutes for me without any problem along the process. Nice. After a disturbing startup sound getting cut-off after a few seconds (I know this is not supposed to be like this, not that I’ve installed it on my harddisk) I played around with KDE 4. Nice interface and all, but I do miss things from KDE 3.5 though.

After get bored with playing around on the interface (all those shininess only lasts for a few hours) I have to restore any important settings from my previous setup, things such as SSH known hosts, a few tiny python scripts to get things going, and a plethora of articles, books, and saved pages to finish since I don’t have the time to read them all, yet.

Kategori: Orang bego punya kegiatan
Ditandai: ,

Easy Way to Move Directory Through SSH

20 Desember 2008 · Tinggalkan sebuah Komentar

I used to mount my server’s home directory using sshfs to move quite a lot directory from and to my server’s machine. It was then, and this is now :


tar cf - directory_to_move | ssh user@hostname 'cd destination_dir; tar xf - .'

This command will do the same thing as scp but when paired with gzip or bzip you can add a nice compression (gzip or bzip) on the way. The directory structure and permission should be intact thanks to the benefits of tar.

This ssh thing never cease to amaze me.

Kategori: Ilmu · Orang bego punya kegiatan
Ditandai:

Komputer lama jadi server

21 Desember 2007 · & Komentar

WinXP Pro SP2 server desktop from VNCOke jadi gw punya komputer tua dengan spesifikasi: Pentium 4 1,7GHz, 256 SDRAM, NVidia GForce4MX, 80 GB HDD, 1 CD-RW, on-board soundcard, dan 4 port USB v1.0. Komputer ini gw setup sebagai komputer server pribadi, untuk melayani beberapa komputer dan sebuah notebook yang sama-sama lebih baru daripada komputer ini.

Di komputer lama ini gw install dua OS (system), yaitu Mandriva Linux 2006 Free Edition (Mandriva) dan Microsoft Windows XP Pro SP2 (WinXP Pro SP2). Sebenarnya pada awalnya hanya ada WinXP Pro SP2, karena gw pernah bekerja menggunakan komputer ini dan pekerjaan gw semua serba Windows. Mandriva baru di-install kira-kira satu tahun sebelum gw memutuskan untuk membeli komputer baru.

Sekedar informasi, sebenarnya WinXP Pro SP2 agak jarang dijalankan karena hampir semuanya sudah bisa dilakukan di Mandriva. WinXP Pro SP2 (masih) ada karena ada beberapa program yang hanya jalan di system Windows (oke, sebenarnya karena gw malas coba-coba dengan Wine :D ), seperti FMA untuk ponsel, untuk membaca kamera digital, dsb.
(lagi…)

Kategori: Orang bego punya kegiatan · Pendapat gak penting
Ditandai: , , , , , ,