Hari's Corner

Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then

My FreeBSD journey - part 1

Filed under: Tutorials and HOWTOs by Hari
Posted on Wed, May 5, 2010 at 10:23 IST (last updated: Tue, May 18, 2010 @ 12:55 IST)

This is probably going to be a series of short notes on my FreeBSD 8.0 installation. This is more a personal reference rather than a full-fledged guide, but I hope some people will benefit from it. Use the FreeBSD handbook as your main source of information.

Note 1: that this is a desktop user's perspective.

Note 2: I've simplified a lot of this because I did have to struggle to find out a few tricks. That's why I am documenting this now.

Initial Configuration and Setting up the Boot Loader

After the FreeBSD installation, I was left with a non-booting system as I chose not to install the FreeBSD loader in the MBR. However, the GRUB super disk came to the rescue and I was able to boot Vista no problem.

Then I downloaded and installed EasyBCD, a GUI configurator for the Vista boot manager and that way I restored the MBR to a working state.

Setting up the default user

I added the newly created normal user to the group "wheel". This is a great convenience factor as I can su as root whenever I want. For this I edited the /etc/groups file and found the line:
wheel:*:0:root
and added the user as follows:
wheel:*:0:root,myname
(Note that there should be no space between the commas.

Networking and hostname setup

Since I added a default network, I wanted to avoid the long delay on boot which occurs when you're not connected to a network. To this end, I appended my hostname to the loopback IP 127.0.0.1 /etc/hosts.

Also in /etc/rc.conf I disabled MTA, by added a line
sendmail_enable="NONE"

This speeded up the boot process quite a bit.

Xorg and GDM setup

After generating the initial X configuration file, using X -configure I noticed that the mouse and keyboard wouldn't work with the setup. I edited out the keyboard and mouse devices section and added this in the serverlayout:
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen         0  "Screen0" 0 0
        Option      "AutoAddDevices" "True"
        Option         "AutoEnableDevices" "True"
EndSection

Having configured Xorg successfully I wanted to load GDM automatically on boot. To make Gnome and GDM work properly, I had to edit the /etc/rc.conf file and add these lines:
dbus_enable="YES"
gnome_enable="YES"
powerd_enable="YES"
gdm_enable="YES"

powerd is necessary for ACPI functionality to work properly. Also without hal and dbus Gnome won't work properly.

For shutdown and reboot to work, add this line to /etc/fstab:
proc    /proc    procfs   rw    0       0

Now shutdown and reboot should work from within GDM.

Sound and wireless networking

To make wireless and sound work, I had to dig a bit into the FreeBSD handbook and wireless proved to be quite a nuisance until I realized that I had to create a wlan0 interface. My laptop has the Intel 3945ABG which uses the if_wpi FreeBSD driver and requires the wpifw firmware as well.

I enabled the kernel support for wireless and sound by editing /boot/loader.conf:
legal.intel_wpi.license_ack=1
wpifw_load="YES"
if_wpi_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
firmware_load="YES"
wlan_amrr_load="YES"
pci_load="YES"
wlan_wep_load="YES"
wlan_tkip_load="YES"
wlan_ccmp_load="YES"
snd_driver_load="YES"
(I realize that I probably don't need all of that and some of them will be loaded as dependencies.)

Now since I use WPA-PSK encryption I created the /etc/wpa_supplicant.conf file as follows:
network={
  ssid="mySSID"
  psk="myPassPhrase"
}

Then I added these line in /etc/rc.conf to automatically run wpa_supplicant and configure the interface:
wlans_wpi0="wlan0"
ifconfig_wlan0="WPA DHCP"

I struggled with the above bit as directly using the wpi0 interface failed and I had no clue how to resolve it.

So far it's been quite hard and as you can see it's not as friendly as modern Linux distributions. FreeBSD makes very little assumptions about your default setup and simply dumps you into a *nix shell when you first log in. Everything from there is what you know.

The journey is by no means complete as I still have to install my software and see if I can set up everything else the way I want to as in Linux. Whether I am successful or not will be documented in part 2 of this.

FreeBSD is not for the faint-hearted. :-P
Comments (3)  

Blogger removed FTP support recently

Filed under: Bits and Bytes by Hari
Posted on Mon, May 3, 2010 at 19:45 IST (last updated: Mon, May 3, 2010 @ 19:47 IST)

A random piece of news that I recently stumbled upon was the fact that Blogger recently removed their FTP support, essentially ending an era of "hosted" blogs (blogs which were generated through the Blogger.com service but served from the blog author's own hosting/server). This is just another reason why I am glad I never used their blogging service in the first place.

To be fair, google have provided a migration service for such users. However this news must be hard to take for all those people who have relied on Blogger's FTP service all these years. While the actual number of people who used the FTP service might be a miniscule fraction, I think that this just shows the arbitrariness of free services on the Internet and the implications of sudden policy changes on their part.
Comments (4)  

The divine flavour of Cassata ice cream

Filed under: Life and Leisure by Hari
Posted on Sun, May 2, 2010 at 17:44 IST (last updated: Sun, May 2, 2010 @ 17:44 IST)

Mmm... I had one today. The divine taste of a good old Cassata ice cream features in my version of heaven. It's my favourite kind of dessert when I dine out, but it is not commonly available in a lot of restaurants and the regular ice-cream shops don't have these.

Cassata
http://www.flickr.com/photos/danchitnis/ / CC BY 2.0

I don't know how popular they are outside India and in what variants they are available but I know that I cannot have enough of this. What I especially like is the crispy layer of cake merged with the icecream and all those bits and pieces of nuts and fruity bits. The best part is the fruity flavour that's left in the mouth afterwards.

There seems to be one variant that I can fathom: the one featuring the cake predominantly. According to Wikipedia it's Italian sweet and I guess the ice-cream evolved from that.
Comments (5)  

Snake files defamation suit on behalf of all reptiles

Filed under: Humour and Nonsense by Hari
Posted on Thu, Apr 29, 2010 at 13:51 IST (last updated: Thu, Apr 29, 2010 @ 14:00 IST)

Papa Hari News Service

A snake, a full-grown adult male of the Naja Naja (Indian Cobra) family, which claimed that human beings potrayed reptiles as evil, slimy and undesirable creatures in movies and the media today took the exceptional step of filing a defamation suit on behalf of the entire reptile family in the Papa Hari High Court of Justice. Talking, or rather hissing to news reporters, the snake claimed that the portrayal of snakes in movies amounted to racial discrimination and bias.

"Why are we portrayed as evil and hss... ssslimy?" hissed he, "I hssss.. sssee thissss as defamatory and an insstance of racial dissss-crimination."

A cartoon snake of dubious origin grinning foolishly at the cameraMeanwhile crocodiles and other members of the broad family of reptiles came out in open support of the aforementioned snake. "At least snakes have an aura of mystery about them," complained the croc, "But crocodiles are portrayed as outright despicable and nasty with no redeeming qualities whatsoever. This has to stop!"

Many television and movie producers were shocked at this development and were quick to dismiss the racial discrimination charge. "How can we discriminate racially against snakes and other reptiles. On what basis is the charge made? Skin colour or texture? Lack of warmth of blood? Or what? Let them go lay their blooming eggs!" screamed a movie producer whose recent movie featured a haunted house and a snake which was supposed to stalk and terrorize any inhabitant of the place.

"It's well known that snakes are timid and docile creatures," said a prominent animal rights activist, "We should embrace them as members of Nature's family!" When asked whether this was sound and prudent advice, the activist hastily added, "I meant figuratively, not literally! You don't want to harm a snake by hugging it." When pointed out that there was a good chance that the snake might attack or bite the person indulging in such an activity the activist pondered for a while and retorted, "Oh, that too!"

Meanwhile a low budget children's magazine which features such prominent characters as Rajashekhar Snake, Kandaswamy Monkey, Ezhumalai Lion and Murugan Crocodile quickly decided to change all its animal characters into human beings; not a difficult task since the aforementioned animals were attributed human qualities in the first place. "We simply dropped the animal references from the character names. The rest of the story is left unchanged. Only somebody has to redraw all the characters", said the editor of the magazine, sighing as one who gives up a long running tradition.

"Simply put, snakes don't hunt down human beings for the fun of it, nor do they seek revenge or smell out clothes and attack its owner; they cannot hear and listen to instructions from the sorcerer and so on and so forth," said the lawyer representing the snake, in a vague reference to a popular Tamil daily soap where such events as bulls attacking people specifically wearing red clothes and snakes being set on a scent of a human being from their clothes and relentlessly hunting down the owner of the clothes were recent storylines. "If you leave them alone, they just mind their own business."

In the meantime, the snake also assured that they were launching a new educational forum to remove misconceptions and other incorrect notions about snakes in general. When pointed out that such channels as National Geographic, Animal Planet and Discovery already provided such education, the snake merely hissed in derision.
Comments (3)  

Legal ethics: how can a lawyer defend the guilty?

Filed under: People and society by Hari
Posted on Mon, Apr 26, 2010 at 16:25 IST (last updated: Mon, Apr 26, 2010 @ 16:34 IST)

Note: I've used the masculine gender here, because it's inconvenient to refer to he/she, his/her all the time and them/their is a clunky grammatical device.

It's been a while since I wrote on legal topics, but thought I would explore one more subject which is an interesting topic of discussion both in legal circles and by lay people.

The simple answer is: yes. A lawyer can defend a guilty man and is well within his rights to do so (and in fact, has a legal duty to present his client's case to the court). A defence lawyer who refuses to present his client's side of the case on insufficient grounds may be guilty of professional misconduct.

Surprised? Actually you shouldn't be. If you've read my earlier article on presumption of innocence, you would realize that the question itself is faulty. How can a man be guilty before a court of law decides so? Sure, guilt-in-fact is one thing but the law says nobody can be convicted until the fact of guilt is proved by the due process of law.

Let us assume that a lawyer actually knows of his client's guilt. Now this would mean that the lawyer is automatically disqualified from defending him in a professional capacity because he would then become a witness in the case. If you have seen a man commit a crime or you are in possession of facts which you acquired through personal experience which amounts to evidence for or against the man, you are a witness.

But what if the lawyer has merely a strong suspicion that his client is lying? If so, then the next question is, are the suspicions justified by facts or are they mere prejudice? This is a harder question to answer and in most cases, it would be up to the lawyer to decide based on his past experience and knowledge. However, unless he is justified in disbelieving his client's case wholly or in such matters which seriously affects the proposed defence, he still has a duty to put forth the defence before the court. This seeming contradiction between the lawyer's duty towards the client and duty to the court to assist in the inquiry of truth is a strange legal paradox worthy of a deeper philosophical debate.

There are a couple of reasons for this:

The deeper issue here is that it is far too easy to imagine unsavoury things about a person who is accused of a serious crime. The more serious the crime, the more one will tend to read into the accused's character or make assumptions about the truth of his statements. Circumstantial evidence might be extremely strong, and yet it can be highly misleading as well. And for many unfathomable reasons an accused might prefer not to state all the facts and this might count against him in a trial.

Yet a lawyer must put aside all such considerations based on conjecture and purely deal with what he knows. In addition a professional criminal lawyer should never get personally involved with his clients and leave the truth of the facts to the judge or jury.

The other angle to the question which I've deliberately refrained from talking about is the rights of a convicted person to appeal in a higher court because that is another topic altogether. :-)
Comments (1)  

Site moved to new host again

Filed under: Site management by Hari
Posted on Fri, Apr 23, 2010 at 18:32 IST (last updated: Fri, Apr 23, 2010 @ 18:32 IST)

I've now moved to a new host. If you're reading this message you're seeing the new location.

If you have any intermittent problems accessing any part of this site or images, it is most likely a DNS issue and might take up to 24 hours to resolve. :-|
Comments (5)