Arch Linux Install

Step 1 : Using fdisk partition the drives and wipe the root and boot partitions clean

Step 2: Connect to Internet (I typically use USB tethering from my phone and it works fine. Once the phone is connected, an IP address is automatically obtained by the system)

Step 3: pacstrap /mnt base

Step 4 : pacstrap /mnt grub

Step 5 : genfstab -p /mnt >> /mnt/etc/fstab

Step 5 : arch-chroot /mnt

Step 6 : Write hostname in /etc/hostname

Step 7 : ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime

Step 8 : edit /etc/locale.gen and run locale-gen

Step 9 : mkinitcpio -p linux

Step 10 : Set root passwd

The following steps should be performed if the standard MBR is used. For GPT the steps will be different (Take a look at the Arch Wiki
page for Grub). Somehow, the Arch Wiki does not mention these in the
installation guide directly. It only links to the Grub pages. However, this is ofcourse the most critical operation that one performs during an install :).

Step 11 : grub-install –target=i386-pc –recheck –debug /dev/sdx

Step 12 : grub-mkconfig -o /boot/grub/grub.cfg

Step 13 : Unmount and Reboot

Thats it! All the above steps are from the Arch Wiki installguide, except that they are all in one place.

Fucked up Indian Railways and Fuck you Mr. Railway Minister

The deplorable state of Indian Railways (IR) was once again showcased by the Bangalore-Nanded train accident a couple of days back. What is more shocking is that no one has raised voice against the Railways demanding resignation of the corresponding officials. This has been the fourth of fifth  such accident this year.

A country which fought for the women rights seems to silent even when the fucked up IR time and again suffocates and chars people to death. How many rail accidents happen in other parts of the world? Fuck you IR and Fuck you Mr. Railway Minister.

Some stupid fucks (common citizens) here think that this happens all the time in India so it is not something to be focussed on. It is unimaginable horror to think what the people went through before they finally succumbed. Many of them tried to escape but the doors could not be opened. The IR justifies this by saying that the doors have been locked to prevent theft.

Why cant they put a simple system in place by which the doors can be easily opened? The last such train accident happened last year so they had ample time to learn. In that case too many bodies were found near the doors. And the most disturbing thing is that no person in power says anything about the event. They just convey their condolenses. Put them up your arse.

The real reason for the train accidents may not be known. The AP Forensic team is trying to investigate the case but I am sure their findings are as credible as the fucked up Railway officials themselves.

I hope all the people who perished on the train accident rest in peace. Hope that someday very soon such accidents due to lack of routine maintanence do not take place.

WickedLeak Wammy Desire

Just bought this budget tablet a couple of days back. The standard resolution tablet costs 6500.Add 450 for shipping to hyd. They did not give me the pen that I saw in some other places in the internet. Just got the two connectors – the microusb to USB (female) and the microusb to USB (male).

I had to do a factory reset to make the tablet work. From that time there is no software glitch that I could find. The factory reset was required as the software crashed repeatedly. I don’t think the hardware needs to blamed here, it was just that jelly bean had not been configured correctly.

The display is OK. If you apply the slightest pressure at the back, the finger presses are visible On the screen. However, the biggest inconvenience seems to be the battery. It takes a full 10 hrs to charge completely and it lasts for just over 3 hrs.

A pleasant surprise for me is that, tata photon + works with this device – just have to add an APN with #777. The main reason I bought this was for games and they work superbly with this device. Of course , given Its specs one expects such performance. Everything else is good enough for me.

I have looked at various places over the internet before buying this, so this small review might help somebody out there.

lxde wallpaper slideshow

I concoted this from exisiting code over the internet. This code displays a random image from a specified directory (all subdirectories included) as a wallpaper in lxde. This is working for me under arch linux.

#!/bin/bash
DIR="/put/your/directory/here"

# failsafe - fall back to current directory
[ "$DIR" == "" ] && DIR="."

# save and change IFS
OLDIFS=$IFS
IFS=$'\n'

# read all file name into an array
fileArray=($(find $DIR -name "*.jpg"))

# restore it
IFS=$OLDIFS

# get length of an array
tLen=${#fileArray[@]}

FLOOR=1
while [ 1 -eq 1 ]; do
number=$RANDOM
while [ "$number" -le $FLOOR ]; do
number=$RANDOM
done
let "number %= ${tLen}"  # Scales $number down within $RANGE.
pcmanfm --set-wallpaper "${fileArray[$number]}"  --wallpaper-mode=fit
sleep 10m
done 

Some interesting facts about india

0) Indians consider money to be the most important thing to possess. Honesty (especially) is the most dispensible here. Always try not to be truthful if you want a “happy” life (http://toostep.com/debate/are-indians-money-obsessed).

1) People dislike each other. Honestly, they dont hate each other very often. Only every now and then. This dislike is what most people in India live with daily. They have gotten accustomed to it and they no longer really find it disturbing.

2) India is one of the most corrupt countries in the world. I did not have to say that after point (0).

3) The reason why an Indian lives (can get through a typical Indian day) is because (mostly) he/she has found that some other (arbit) Indian has found the courage to do so. There is never really the question of “What I want?” and living according to that.

5) India has never been limited by resources, it is currently being severely crippled by the attitude of its people.

6) Hyderabad (the city I live in) is a total shit-hole, literally (well, OK, atleast during the rainy season when all the sewage is on the roads!).

7) Some people (especially the poor ones and some rich ones too) survive almost like pigs. One can say that these are some of the most deplorable states in which a human can live.

8) Malnutrition is comparable or worse than Sub-saharan africa. I think countries like Somalia have our rates (http://en.wikipedia.org/wiki/Malnutrition_in_India).

9) Driving: Get an expensive car. You get more respect on the road. If you have a smaller car then God be with you. Well, HE has to be there with you even if you have an costly car anyways. FACT: India has the highest number of road accidents in the world. Dont think it is because of the population: China has less (http://www.dw-world.de/dw/article/0,,5519345,00.html).

10) Very few people give a damn to whats going on around. Indians have the greatest sense of apathy in the world.

11) Indians should be the least creative in the world with a whopping 4 (or 5?) Nobel and 0 Fields medals. Yet, India invented zero and blah, blah. (Should learn something from rajini: past is past).

12) Yet, India has a great culture, tradition, India is great blah, blah. generally written by people who do not understand what they are saying. This is all one can say: India was great (a long time ago that too).

A small question

Let {X} be a set. Let {\mathcal{G}} be a non-empty collection of subsets of {X} such that {\mathcal{G}} is closed under finite intersections. Assume that there exists a sequence {X_h \in \mathcal{G}} such that {X = \cup_h X_h}. Let {\mathcal{M}} be the smallest collection of susbsets of {X} containing {\mathcal{G}} such that the following are true:

If {E_h \in \mathcal{M}} {\forall h \in \mathbb{N}} and {E_h} {\uparrow} {E} then {E \in \mathcal{M}}
If {E}, {F}, {E \cup F \in \mathcal {M}} then {E \cap F \in \mathcal {M}}
If {E \in \mathcal {M}} then {E^c \in \mathcal{M}}

Does {X \in \mathcal{M}} ?

DFT revisited

I was reading a book on image processing by Bernd Jahne and found what he wrote about the Discrete Fourier transform very interesting. The DFT can be computed as {\hat{f} = A f} ({A} has been defined in a previous blog ), so it seems like a linear transformation. A new interpretation is that the rows of {\hat{A}} (or the columns) ({\hat{A}} has been defined in a previous blog ) can be thought of as spanning the vector space of all N-tuples of complex numbers denoted by {\mathbb{C}^N}. First of all, it can be checked that N-tuples of complex numbers form a vector space. On this vector space, an inner product can be defined as follows :

\displaystyle <v,w> = \sum_{k = 0}^{N-1} v_k {\bar{w}_k}

With this definition of inner product on the vector space, one can easily show that, {<\frac{1}{\sqrt{N}}u_i,\frac{1}{\sqrt{N}}u_j> = \delta  (i-j)} where {u_k} is a row (or column) of  {\hat{A}} .

Therefore, if {C \in \mathbb{C}^N} then {C =  \sum_{k = 0}^{N-1} \alpha_k (\frac{1}{\sqrt{N}}u_k)} where {\alpha_k =  <C,\frac{1}{\sqrt{N}}u_k>}. Clearly the {\frac{1}{\sqrt{N}}u_k} span {\mathbb{C}^N}. It can also be checked that {\alpha_k} for {k \in  \{0,1,..,N-1\}} is the 1D Fourier transform. Hence the DFT of a vector {f} is just a projection of {f} on the rows of {\hat{A}}.

In two dimensions, we consider the set of all {M\times  N} complex matrices. This is again a vector space over the field of complex numbers. The basis “vectors” now are the matrices {(B_{u,v})_{m,n} = D_{m,n} =\frac{1}{\sqrt{MN}} exp(\frac{-2\pi  imu}{M}) * exp(\frac{-2\pi inv}{N})} for all {u  \in \{0,1,...,M-1\}, v \in \{0,1,...,N-1\}}. The inner product for two complex matrices is defined as :

\displaystyle <A,B> = \sum_{m=0}^{M-1}\sum_{n=0}^{N-1} A_{m,n} {\bar{B}_{m,n}}

Any complex matrix can then be written as a linear combination of the Basis matrices {B_{u,v}}. {C =  \sum_{u=0}^{M-1}\sum_{v=0}^{N-1} \alpha_{u,v} B_{u,v}}. Then it can be shown that {\alpha_{u,v}} is the 2D Fourier transform for {u \in \{0,1,..,M-1\}, v \in  \{0,1,...,N-1\}}. So, we are projecting {C} onto the Basis vectors {B_{u,v}}. By this reasoning it can be shown that the 2D Fourier transform for a matrix {C} can be written as {A_M C A_N}, where {A_M} is the {M\times M} DFT matrix and {A_N} is the {N \times N} DFT matrix.

NOTE: I was only mentioning {\hat{A}} as I was lazy to write the basis vectors. Hope this did not confuse.

Follow

Get every new post delivered to your Inbox.