Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

27 April 2010

Genius Pen 450 in Lucid (test case: database design sketch)

I have a cheap and working tablet digitizer, i.e GPen 450. It was did quite well both under windows and Grafpup (a puppy linux derivat). Back to 3 or 4 years ago, other distro didn't include the correct driver for GPen 450, and to my research, only Grafpup supported it out of the box. 

Now with the Lucid in the machine, I'd like to try plugged it, and unfortunately (I guessed this actually), the GPen did recognized as an input device, but still Lucid missing a right driver. So, googling took me to Ubuntu Forum, and finally there's a clue, and a mean to compile the wizardpen device driver. The forum also showed me the location in launchpad, which contains a precompiled bianry. so here is the direct location. Download the correct one, and install via sudo dpkg -i  xserver-xorg-input-wizardpen_0.7.3-1ubuntu1_i386.deb. One more step is to execute sudo wizardpen-calibrate /dev/mouseXX or /dev/eventXX, choose one which is the right link of the GPen. (One way to know which the device is enough with ls -l /dev/input/). 

Callibration was done, and to try the pressure sensitive, I tried Inkscape and MyPaint. Another good replacement for the popular Windows Journal is Xournal, below is the shoot:


Xournal also has the ablitity to export the drawing directly into PDF, also we can annotate existing PDF using this Xournal. 

You can download the PDF result here, it's a quick sketch of doing database normalization for [Public] Health information system introductory.

27 March 2010

Ubuntu Couple

Well, almost 4 months we've been using Ubuntu Karmic Koala, mainly in our tiny cheap Intel powered machine, ie Eee PC 900 (Intel Celeron) and AOA110L (Intel Atom). Ubuntu was the best OS for these little machine so far, at least until the 9.04 version (Jaunty). As I myself am an up-to-date guy, so every 5-6 month my ritual is doing apt-get dist-upgrade, for my AOA. After tryng the latest beta/rc version and found it stable enough, I then did a fresh install into my wife's Eee PC.

For these weeks, I often use my Hackintosh to do some works and fun, while in my wife's Eee PC, karmic is the ultimate OS of choice, she left windows XP far behind. Yes, my wife used Ubuntu already, for almost two years now. Beginning with some troubles with Xp viruses and badware, hd space junks, you know, Eee PC 900 only has 4+16 Gig of space, so every byte counts! Started with Ubuntu 8.10, OpenOffice 3.0, Dia, PSPP, XAMPP, Wine as hub for SPSS, WinQSB, EpiInfo, Arcview, MindMap, and so on, and even some native Windows programs run better in Wine. Continue to Ubuntu 9.04, all happy story. As she took a magister class, she is now a power user already, while her friends, and some of my friends just know very little about linux. Even worse, most of them have null knowledge about it.

Some problems occured, and some of them resolved by some tweaking and hacking, e.g repeating asks password for mounting [internal] partition and using wvdial instead of nm-applet, as nm-applet failed give me the proper DNS. Some problems still remain, such as no warning about critical  battery, mis-behave i915 modeset, some apps crashed, etc.

Not so long ago, I've updated my AOA into lucid alpha. The performance significantly increased, with the latest 2.6.32 kernel, and the most impressive is the OpenOffice 3.2. Opening document is now alot faster than before. Klik on OOo icon, you count 1,2,3,4,5, and OOo ready to go. YMMV, though. I plan to install it to my wife's Eee PC, but I have to wait until it's finally released (in 04-2010), so it means less than a month, because the release usually is near the end of the month.

So, migrating to Linux is not so hard, as long as you have a geek or two behind you to ask, and if you don't have, just keep on googling, or much better, join the [ubuntu] forum.

As in my wife's case, the biggest problem of Ubuntu/Linux world is the apps. Formatting document, printing something, editing simple image, sometimes needs more than a full day to resolve. She said that the most frustating thing is formatting layout. OpenOffice has all the required tool, but sometimes just behave so strange, like inconsistent bullet form, space, tabulation, etc. I believe that those problems won't be exist if we stick to standard form/layout. Hard to manage cross reference, lay outing end-note, etc., etc. I myself rarely use Office apps, so I just suggested some useless clue. Anyway, she sticks on Linux, no matter how hard the OO was. Good.

Is this something to be proud of? Sure. Here, linux users are minority. Woman linux user? I've never met, except her.

05 December 2009

Squid Proxy Authentication With PHP/MySQL

Many methods to do authentication in Squid, ie basic, ncsa, ntlm, kerberos, radius,.... But what about authenticate a user by looking in a MySQL table? More convenience if the language is PHP, as everybody language in the Web B-). So, after some quick googling results many clues, I picked one here and added some lines for data retrieval from MySQL. Here they are:
#!/usr/bin/php
mysql_connect("localhost","root","password");
if (! defined(STDIN)) {
        define("STDIN", fopen("php://stdin", "r"));
}
while (!feof(STDIN)) {
        $line = trim(fgets(STDIN));
        $fields = explode(' ', $line);
        $username = rawurldecode($fields[0]); //1738
        $password = rawurldecode($fields[1]); //1738
        $db=mysql("auth","select * from user where nama='$username' and passwd='$password'");
        if(mysql_num_rows($db)>0){
                fwrite(STDOUT, "OK\n");
        } else {
                // failed miserably
                fwrite(STDOUT, "ERR\n");
        }
}
?>

Very simple as we write. Next, chmod the script, eg auth.php with execute permission. Copy/move the script into any folder accessible by squid, just place it in /etc/squid is very well.

Edit /etc/squid/squid.conf, add the following lines:
auth_param basic program /etc/squid/auth.php
auth_param basic children 20
auth_param basic realm FKM HotSpot
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

And allow only authenticated user:
acl AuthenticatedUsers proxy_auth REQUIRED
http_access allow AuthenticatedUsers
http_access deny all
Restart squid. One major drawback is we have to manually set the browser using the squid address and port, the authentication can't be done in a transparent proxy mode.

12 November 2009

How To Disable Journaling on HFS+ Partition Via Linux

As we all know there are many ways to accomplish disabling journaling on HFS+ partition, ie via Onyx, disk utility, or command line diskutil, but all of those tools run on Mac, while sometimes we can't boot Mac for any reasons. So, with the latest Karmic distro, I accidentally found a way to disable journaling on HFS+. How?

The first requirement to deal with HFS+ partitios is installing some tools, I forgot precisely the package name, but you always can find it in synaptic by keyword HFS. Note  that there are two commands, ie fsck.hfs and fsck.hfsplus, the name reflects it usage. Both commands need parameter -f if used for repairing journaling HFS+ filesystem.

# fsck.hfsplus -fy /dev/sdxy
# fsck.hfs -fy /dev/sdxy
# mount /dev/sdxy /mnt -t hfsplus -o rw

The first command is the default when I had some problems on Mac boot, doing some repairing (twice or more fscking), and then remove some stalled files and dir, remove extensions.mkext manualy, copy some files from linux/fat/ntfs partition into HFS+ and so fort. But all of those can be done if journaling is disabled.

So, how to disable HFS+ journaling from Linux? Simple as we type the second command above! Found it accidentally when I tried to repair my unbootable Mac partition. Magically, when I mount the partition on another running Mac, the journaling was disabled after I did fsck.hfs on it.

Normally, to disable journaling on Mac is:

# diskutil disableJournal /dev/disk0sx [or mount point]


But now, I can do that from Karmic with fsck.hfs, dunno what the side effect yet.

10 November 2009

A New Way to Recover Leopard

Something bad happened. My mac didn't boot, stuck on waiting root disk. Hmm, so I boot into karmic, and doing fsck.hfsplus -fy /dev/sda2, some error but unsuccessuly repaired. Some research on Google advise me to use DiskWarrior, or use Mac Install DVD, which both I don't own (and at the moment I have no external DVD drive to boot from, borrowed by a dude).


The mac partition was still readable but unfortunaely unwritable, because of journaling activated before. Quick thought, I created a new primary partition via Gparted, and made it as hfsplus w/o journaling. I then copied some important folders and files (almost all files and folder except Applications and Users) into the new partition via terminal (cp -arf ...). Creating some links into private folder, and reboot.

Grub2, enter console mode (press c), typing this:

set root=(hd0,4)
xnu_kernel /mach_kernel rd=disk0s4 -s
xnu_kextdir /System/Library/Extensions


and then press Ctrl-x to boot, I think the switch -s didn't work as usual (Karmic beta), but my surprise, the mac entering single user mode. Well, standard procedure: fsck -fy, so much invalid entry, but successfully repaired. And then executing mount -uw /, what? the file is missing? Whatta... mount is missing. So I manually mount / via mount_hfs, and then I soft linking mount into mountd.

Okay, mount read/write success, and then logout, logout again, enter login screen. Everything saved. Remain tasks are to copy/move a bunch of files and apps from old mac partition into the new and fresh partition.

Once again, Linux saves the day!

Update (11/10/09-05:37)
Times to work, so copied XAMPP from the  old into the new. XAMPP Control states that: start mysql error manager of pid file quit without updating.... And mysql won't start.

Googling as always, again no solution suitable to my case. Someone suggested to reinstall the XAMPP package. So, I started my own experiment. Quick looked into /Applications/XAMPP, all file ownership was myself (because I copied them using finder drag and drop), so I began to recover with:

chown -R nobody /Applications/XAMPP


Check again with XAMPP Control. Still no luck. Trying from terminal by this command:

/Applications/XAMPP/xamppfiles/bin/mysqld_safe --skip-grant
/Applications/XAMPP/xamppfiles/bin/mysql_install_db
(and then copy all databases from the old to the new, using terminal)


Enter phpmyadmin, add user root into table user in mysql database, run flush privileges from SQL windo. All should be normal again.


24 October 2009

Leopard Recovery Via Ubuntu

As you know that my working machine is now contains only two OS, theye're Leopard 10.5.8 and Karmic Beta. So, while Chameleon is the best for booting Leopard, Karmic itself replaces Grub with Grub2, which couldn't just chainloader the Chameleon booter.

According to the Grub 2 wiki, chainloader actually is supported, but don't know why, in my AAO, it just says 'Starting up...', and nothing further. So, booting Leopard became a tedious task. Once I revert back to grub, and everything go normal, but I really dislike 'outer' solution. I mean, if Grub 2 is an official boot loader for Karmic, so I'm better using it, not grub legacy, you see, I'm pretty standard.

Whatever, grub2 is now my bootloader, while Leopard boot supported minimally using xnu_kernel command and friends. Although splash graphic is supported, again I failed to show the splash of Leopard, regardless the Image location/parameter.

Also, via xnu_kernel I couldn't add some kernel parameters, like -f -k -v -s, so how could I enter leopard's safe mode? I couldn't.

So, as my AAO is an illegal Mac, sometimes bad things occured. Only way to successful boot is force loading extensions, by adding -f parameter. Ok, grub2 just rejects the parameter, so I had to manually remove /S/L/E.mkext and doing fsck.hfplus from Karmic. All can be done if my filesystem of Mac is hfsplus non-journaled.

By setting the partition in non-journaled mode, I can mount it in read/write mode, doing fsck and even copy-paste some stuffs from Linux, windows, or Mac partition.

So, steps taken so far, in the case of frozen boot process (Laopard boot):
1. From Grub2 menu, choose Karmic recovery
2. From root konsole, type fsck.hfsplus -fy /dev/sda2 [the same as in Mac -s), replace sda2 with suitable mac partition
3. type mount /dev/sda2 -t hfsplus /mnt -o rw,force
4. type rm /mnt/System/Library/Extensions.mkext
5. do copy paste data if you like, or just reboot

12 October 2009

Restore/Repair File Association in Ubuntu (Karmic)

Yesterday I did sudo apt-get upgrade, all completed, and my network-manager (3G modem) sets the DNS in resolv.conf correctly. One improvement.

Ten minutes later I was tinkering with quickly, but when I did quickly tutorial, what arose was gedit opening the HTML file of the turorial series. So I opened nautilus and try to play a FLV video, damn, opened with Gedit! The right click open with just give me two options to open with: gedit and openoffice word! What a ...

Well, just thought about mime or something. So googling to correct it, then I came to ubuntu forum here, but no success. Another debian forum suggested to downgrade shared-mime-info. Hmm, I dislike downgrading.

So I tried myself efforts. First, doing sudo update-mime-database and pointing at /usr/share/mime, didn't solve the problem. Second, deleted .local/share/applications, as ubuntu forum suggested, no work either. Third, quick looked at .local/share/, I found the foolder named mime there, so I tried with update-mime-database .local/share/mime, and the problem solved.

10 October 2009

Koala and Leopard Live Together, Happily....

As you may notice that the Karmic Koala will be realeased in less than 2 weeks from now, but I've tried the beta version, wiping my previous Jackalope. I've done some dist-upgrade, but didn't run very well, so I moved some folder and continue to fresh installation.

The problem is with Leopard, it didn't boot, or crashed at boot stage. If it finally success coming to Login screen/GUI, the speaker said tik-tik-tik, just like I presses the \7 key, appeared from opened terminal window.

I suspected the Grub 2 is the source of the problem, but I tried with Grub Legacy, the problem remains the same. Not the grub, but some kexts might be corrupt or what. So, to recover, I've boot from Leopard DVD Installer with param rd=disk0s2 (which is my leo partition) at boot prompt.

The keyboard/mouse driver would be AppleACPIPS2Nub and ApplePS2Controller, or in this case I use the VoodooPS2Controller. Tested by rename VoodooPS2Controller.kext into VoodooPS2Controller.kex, and copy the originals from my previous post, solve the problem very well. So, here I'm writing this from Leopard. The only problem was Leopard boots in verbose mode, no splash, but this will soon be gone, as I can edit the grub.cfg with the correct path of the splash images.

Comments on Karmic Koala, well, it's damn fast. Boot in less than 15 seconds in my hacked AAO 110L from power-off into ready to work Gnome Window Manager. Some minor problem though, NetworkManager sometimes erase DNS record in /etc/resolv.conf. This problem appears only when I used Wireless Boradband/USB HSPA Modem. Yesterday, the resolve.conf just fine when I used WiFI networks. Quick work around was using wvdial to dial the USB Modem. Or when network manager successfully connected to BTS, manually edit the resolv.conf and fill it with some DNS server. I hope this problem will be completely gone in the stable release, but if not, I think that's not a big deal at all. TIMTOWTDI, dude.

Some dude ask about windows, where the hell is my windows menu on Grub? Or I hide it somewhere or just disable it, and boot to windows by typing the commands right into the Grub shell? No, the Windows is missing. The partitions are still exist somehow, as both Linux and Mac can access the windows partitions very well, so I used them as data storages. The folder Windows\System32 also still exists,  maybe I need some DLLs for WINE (both for Linux and Mac) to run some windows only applications, such as Nimbuzz, only available in Mac/Windows.

22 June 2009

Chromium Nightly Build on Jaunty

Resminya, google belum mengeluarkan versi release dari Chrome untuk linux maupun Mac (Chromium di Linux/Mac), namun ternyata kita bisa memanfaatkan nightly buildnya yang tiap hari terus berubah. Juga ternyata kita tidak perlu kompilasi sendiri untuk mendapatkannya. Manfaatkan build yang sudah jadi binary jauh lebih mudah....

Unduh dulu dari sini, terus extract, dan jalankan filenya (chrome), busyeett! dua detik langsung muncul jendela chrome! Otomatis browsing sana-sini jadi cepet.

Kalau biasanya firefox (3.0.10) perlu waktu hingga 10 detik untuk loading, maka kecepatan loading chrome terbilang amat cepat, 2 detik doang!

Berikut adalah tampilannya:

Satu-satunya masalah (nggak masalah sih) adalah tampilannya yang kurang sesuai dengan tema keseluruhan jaunty, aneh saja, gabungan antara biru dengan coklat-orange. Tapi itu nanti...

Satu lagi, flash plugin belum tersedia kayaknya...

Update: Untuk menyelaraskan tampilan, maka sekarang aku pakai clearlooks yang serba biru, cocok dengan karakter chromium :)

12 June 2009

Tandeman Internet pake Leopard/Ubuntu

Istilah tandeman ini jujur saja dicomot dari situs pak Sutopo di sini. Nah, kalau di Windows ada internet sharing, maka di Mac juga ada internet sharing. Berikut adalah gambarnya:
Dari gambar tersebut tampak bahwa yang dishare adalah koneksi dari N93, ISP memakai indosat broadband 3G pasca bayar (Matrix), namun karena coverage 3G belum nyampai, maka revert to GPRS :(

Pada praktik kali ini, komputer yang aku konexkan sebagai klien adalah EeePC 900 milik Dinol yang memakai Ubuntu Jaunty. Settingnya (alamat IP) aku buat manual, baik pada Macosx dan Ubuntu untuk koneksi lewat ethernetnya. Sayang sekali atheros AR5007 di AAOku nggak bisa mancar atau menerima, meskipun sudah aku rebranded ke hardwarenya Apple (lewat ubuntu juga, pakai ath_info, dump, write, dst). Anehnya, lewat analisa dmesg, en1 menunjukkan bahwa ia sudah up, yang artinya sudah on, dan dicek lewat ifconfig juga sudah dapat IP, namun dikonekkan ke ubuntu lewat jalur network manager tidak muncul apapun.

Dari sisi Mac, nyaris tidak ada setting apapun, kecuali setting alamat IP dibuat manual, misalnya 192.168.1.1. Nantinya di Ubuntu disetting lewat network manager, dibuat alamat ethernetnya misalnya 192.168.1.2, 255.255.255.0, gateway ke 192.168.1.1. Routing set manual di konsole ( $ sudo route add default gw 192.168.1.1). Resolver DNS juga aku set manual lewat konsol ( # echo "nameserver 208.67.222.222" > /etc/resolv.conf). Ini adalah alamat opendns umumnya.

Kecepatan akses nggak berkurang drastis tuh, entah karena memang lemot, atau memang mantep, tapi nyatanya posting ini, browsing sana-sini juga lancar-lancar aja, nggak beda jauh dengan kecepatan sorangan wae. Apalagi jika memakai Opera Turbo! Sekarang ini nih, aku juga sedang buka banyak situs memakai Firefox (5 tab kebuka), Opera (2 tab), Chromium (Nightly Build) (2 tab), Safari (3 tab), RSSOwl (banyak sekali tab) dalam satu waktu, dan asiknya lagi, partner yang sedang posting itu dan browsing sini-sana juga lancar-lancar aja.

Memang, akhir-akhir ini Indosat sedang lancar koneksinya, mudah-mudahan seterusnya, dan lebih sip lagi jika coverage 3G diperluas ke Bukit Diponegoro, atau khususon masang satu BTS, yang mobile saja, ke wilayah ini, hue hue hueh...

09 June 2009

Turbo Mode on Opera 10 Beta, jaunty

Menggunakan opera 10 beta sekarang menyenangkan, soalnya tersedia mode turbo, yang mana akan menaikkan kecepatan cukup signifikan, terutama jika koneksi internet lambat, lewat DUN, atau broadband 3G over GPRS :(, karena tidak terkover signal 3G seperti dirumahku.

Turbo mode akan aktif ketika opera menemukan bahwa kecepatan terlalu rendah, selanjutnya tinggal mengatur lewat klik di ikon pojok kiri bawah, dekat status bar. Ikon ditandai dengan gambar speedometer dan faktor pengalinya, misalnya x4, x3, dst.