Two Small Comments About Linux vs Windows

Just read this blog post. I’d like to give comments on these 2 things.

Alangkah bagusnya jika kita menggunakan OSS secara menyeluruh………

……… Oke, back to topic. Intinya, kita tidak bisa menggunakan salah satu saja dari 2 OS ini.

For readers who don’t understand Indonesian, here’s the naive translation:

If would be nice if we use OSS exclusively

……… OK, back to topic. The bottom line is we cannot use  only 1 of those OSes.

As you can see, things are not all  rosy. We wish we could use only OSS. But in reality, we also use non OSS. Idealism which is not strong enough, yes?

And next:

Niat make Linux, Tapi kalo LINUX BISA MAEN BATTLEFIELD 3 dan GAME Cool lainnya.Thanks…

Aha… saya bisa menebak anda…
kan bisa pake dual boot mas… Linux dan Windus dalam satu kompi…

Naive translation:

I want to use Linux. Can it play Battle Field 3 and the other cool games? Thanks…

Aha, I can read your mind. Use dual boot: Linux and Windows in 1 desktop.

This is like saying “Damn, Linux desktops suck for gaming. We can’t play cool games on them. Let’s use Windows”. Which is unfortunately true. Most cool games still are targeted for Windows and gaming consoles. Sure you can use Wine or anything similar, but the rate of success is not guaranteed to be 100%. Do it at your own risk.

Yes, now there is Steam. Kudos for the developer for giving attention to Linux. But still, we need MOAR game developers/publishers to contribute. Square Enix, Rockstar Games, EA Games etc etc, when will you join this movement? :mrgreen:

 

Kernel panic

The last time I upgrade my Arch Linux system was about 2 months ago. So yesterday, I did a “pacman -Syu”, and got about 1.6 GB of updates. Awesome, let’s do it. So I did, and then went to sleep.

After I woke up this morning, I checked my laptop. Yikes, the update process was failed.

error: failed to commit transaction (conflicting files)
glibc: /lib64 exists in filesystem

So I, foolishly repeated the update process, by using additional parameters: “pacman -Syu –force”. Waited for a while, and it was done!

Let’s reboot. Uh oh, something was wrong, because it didn’t reboot. So I turned of the laptop manually and turned it on again.

Ah wonderful. I got another kernel panic 😡

Let’s see how easy I can fix this problem…

 

Installing the development snapshot of FPC on Linux

I’m using ArchLinux. The latest version of FPC (Free Pascal) which is available in the official repo is 2.6.0

$ pacman -Ss fpc
community/fpc 2.6.0-1 [installed]
The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit Pascal Compiler. It comes with fully TP 7.0 compatible run-time library.

So what if you want to use the development version, which at the time of this post, is 2.7.0? Easy.

First, grab the development snapshot:

svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc

Next, build it:

 sudo make install INSTALL_PREFIX=/usr

Hmm it seems to be done. So let’s give it a try. Type fpc on your favourite shell.

$ fpc
Free Pascal Compiler version 2.6.0 [2012/01/02] for x86_64
Copyright (c) 1993-2011 by Florian Klaempfl and others
/usr/lib/fpc/2.6.0/ppcx64 [options]  [options]

Wait a sec. This is FPC 2.6.0, and not 2.7.0. There must be an error.
..
..
..
Actually there is no error at all.

$ ls /usr/lib/fpc/
2.4.4  2.6.0  2.7.1  lexyacc  ppcx64

See, the 2.7.1 directory?

And BTW

$ file /usr/bin/ppcx64 
/usr/bin/ppcx64: symbolic link to `/usr/lib/fpc/2.6.0/ppcx64'

Apparently, /usr/bin/ppcx64 is still pointing to /usr/lib/fpc/2.6.0/ppcx64. So, just change the symlink.

$ sudo ln -sf /usr/lib/fpc/2.7.1/ppcx64 /usr/bin/ppcx64

Now try fpc once again:

Free Pascal Compiler version 2.7.1 [2012/03/02] for x86_64
Copyright (c) 1993-2011 by Florian Klaempfl and others
/usr/lib/fpc/2.7.1/ppcx64 [options]  [options]

That’s it. Now you can use the development snapshot :mrgreen:

Installing Gentoo Is Easy

I think most Linux users think that installing Gentoo is damn hard, because it requires you some deep black magic of Linux, and most mere mortals could not achieve that level of mastery.

The fact is, Gentoo is VERY EASY to install. Just needs these 2 commands (credit goes to Uncyclopedia):

  1. fdisk /dev/hda && mkfs.xfs /dev/hda1 && mkswap /dev/hda2 && swapon /dev/hda2 && mount /dev/hda1 /mnt/gentoo/ && cd /mnt/gentoo/ && links http://www.gentoo.org/main/en/mirrors.xml && md5sum -c stage3-*.tar.bz2.DIGESTS && tar xvjpf stage3-*.tar.bz2 && links http://www.gentoo.org/main/en/mirrors.xml && md5sum -c portage-latest.tar.bz2.md5sum && tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr && nano -w /mnt/gentoo/etc/make.conf && mirrorselect -i -o >> /mnt/gentoo/etc/make.conf && mount -t proc none /mnt/gentoo/proc && mount -o bind /dev /mnt/gentoo/dev && chroot /mnt/gentoo/ && env-update && source /etc/profile && emerge –sync && cd /etc && rm /etc/make.profile && ln -s ../usr/portage/profiles/default-linux/x86/desktop make.profile && cp /usr/share/zoneinfo/US/Eastern /etc/localtime && cd /usr/portage && scripts/bootstrap.sh && emerge -e system && emerge vim && emerge gentoo-sources && cd /usr/src/linux && make menuconfig && make install modules_install && vim /etc/fstab && passwd && emerge grub vixie-cron syslog-ng dhcpcd && cp /boot/grub/grub.conf.sample /boot/grub/grub.conf && vim /boot/grub/grub.conf && grep -v rootfs /proc/mounts > /etc/mtab && grub-install –no-floppy /dev/hda && init 6 && emerge gnome mozilla-firefox openoffice && emerge –sync && emerge portage openssh
  2. reboot

Voilà. Your Gentoo is now ready to use. Very easy, isn’t it? :mrgreen:

Installing Yesod on Linux

Nowadays, there bazillion web frameworks out there. One of them is Yesod, a Haskell web framework.

Before I continue my post, please don’t ask me why on earth I would like to try to write web apps in Haskell. Just don’t ask. :mrgreen:

Anyway, the installation steps are (?) supposed to be easy. Take a look at Getting Started with Yesod. I tried

cabal install Cabal cabal-install yesod

and several minutes after that, I could hear my laptop fan speeding up. Of course it got hot. So apparently building Haskell codes is a quite resource-intensive task. Thankfully there were errors here and there so I could stop the compilation process.

Before I turned my laptop off, I did a quick Google search, and found that actually Arch Linux has Yesod available as 3rd party package. The ugly thing is you have to build all of the dependencies manually. Ouch.

Maybe I’ll try Yesod once again… another time.

Trying Objective-C on Linux

iOS (and Android apps) development is hot, nowadays. If you are going to build native iOS apps, of course you have to know the Objective-C programming language.

One possible questions arises:

Can I learn Objective-C on Linux? I don’t have any Macs. They are damn expensive.

I believe the answer is a symphatic YES. Meet GNUstep, the open source implementation of Cocoa. Native iOS apps use Cocoa, and it is very likely that it is more advanced thatn GNUstep, but nevertheless GNUstep is fine for learning the language fundamentals.

Obviously the next part is Linux flavoured (I’m using 64 bit ArchLinux, to be specific). If you are using another OSes, please check this page, so you can set the development environment up properly.

  1. Install the Objcective-C compiler: sudo pacman -S gcc-objc-multilib
  2. Install the GNUstep packages: sudo pacman -S gnustep-base gnustep-back gnustep-gui gnustep-make

So let’s try to build this “Hello world” program (I took it from here):

#import <Foundation/Foundation.h>

@interface HelloWorld : NSObject
-(void) hello;
@end

@implementation HelloWorld
-(void) hello {
    NSLog(@"Hello world!");
    }
@end

int main(void){
   HelloWorld *hw = [[HelloWorld alloc] init];
   [hw hello];
   [hw release];
}

And this is how I compiled it:

gcc hello.m -o hello -I /usr/include/GNUstep/ -L /usr/lib/GNUstep/ -lobjc -lgnustep-base -fconstant-string-class=NSConstantString

And the output is:
2012-02-15 00:05:04.314 hello[4243] Hello world!

Not bad, eh?

Growing Too Fast?

These are the quotes of Linus Torvald (yes, THAT Linus. The famous original author & chief architect of Linux kernel)

1992:

Your job is being a professor and researcher: That’s one hell of a
good excuse for some of the brain-damages of minix.

http://groups.google.com/group/comp.os.minix/msg/9f3c7c165aacc83f

 

and 17 years later:

We are definitely not the streamlined, hyper-efficient kernel I envisioned when I started writing Linux…

http://news.cnet.com/8301-13505_3-10358024-16.html

Hopefully I take those statements in context. So, the question is: what can we learn from those?

Are you thinking what I am thinking, which is the development process that expands so vast that it deviates the original goal?

 

 

Cara Share Direktori di Windows dengan Arch Linux di VirtualBox

Laptop saya menggunakan OS Win 7 64 Professional. Kadangkala saya iseng menjalankan Arch Linux di VirtualBox. Nah, saya ingin ada direktori di Windows yg bisa terakses juga di Arch Linux. Bagaimana caranya? Gampang. Nggak perlu install Samba :mrgreen:

  1. Jalankan Arch Linux di VirtualBox. Pilih Devices -> Install Guest Additions.
  2. Mount berkas installer:  sudo mount /dev/scd0 /media/cdrom
  3. Install paket linux-headers dan xorg: sudo pacman -S linux-headers xorg (kedua paket ini HARUS terinstall lebih dahulu, karena jika tidak akan menyebabkan error).
  4. Jalankan installer Guest Additions: sudo sh /media/cdrom/VBoxLinuxAdditions-x86.run
  5. Jalankan perintah: sudo modprobe -a vboxguest vboxsf vboxvideo
  6. Edit berkas /etc/rc.conf, tambahkan vboxguest vboxsf vboxvideo di bagian MODULES.
  7. Masukkan user anda dalam grup vboxsf: sudo usermod -a -G vboxsf anta40
  8. Tentukan direktori di Windows yang ingin anda akses, misal C:\works. Dari menu Devices -> Shared Folders -> tambahkan C:\works disini. Jangan lupa set Auto-mount dan Make Permanent.
  9. Reboot Arch Linux. Selanjutnya folder tersebut berada di /media/sf_works. Sekarang saya sudah bisa membuat/mengcopy/menghapus file disini, dan hasilnya bisa langsung terlihat di Windows.