Ajitabh Pandey's Soul & Syntax

Exploring systems, souls, and stories – one post at a time

Author: Ajitabh

  • Nokia X – A Review

    Few days back I purchased a Nokia X (Black) from flipkart using the mobile application and it cost me Rs 6877/-, which was a very good price available especially looking at the fact that the Nokia Store itself is selling for approx Rs 7500.

    About the Phone – Nokia X

    The Nokia X is a dual SIM phone with 3G services available on SIM 1 and 2G on SIM 2. The phone is powered by a Qualcomm Snapdragon S4 dual core processor running at 1.2 GHz and 512 MB RAM. The internal storage on the phone is 4Gb and there is a micro SD card expansion slot available which can take upto 32Gb micro SD card.

    I found the performance of the phone very good as compared to some of the cheap Chinese quad core / 1Gb phone out there in the market.

    The phone display is 10.16 cms and the main camera is 3.2 mega pixels with a resolution of 2048×1536. If you are not using video calls then the secondary camera on front may not be missed by you. I don’t miss it. The primary camera photos/videos are very good quality for a normal person. Specially the shutter speed is pretty fast. The 3.2 mega pixel Nokia quality is very good.

    The phone has a plastic body and a solid Nokia build. Its feels quite light and is very handy.

    I have been using this phone from few days now, and I must say that I like it very much.

    The User Interface

    Nokia X uses windows tiling interface. You can resize and move tiles around to have a customized look and feel of the phone. Personally I find the user interface quite refreshing change from the standard android UIs which appear almost same in every other android phone.

    Multitasking and Fastlane

    Fastlane is a screen with quick access to most recently used apps, photos, notifications, calls etc. It appeared first in the Symbian based Asha series. To see this screen you can swipe right or left. In order to edit what appears there, long press any application and edit it or click on the settings icon to customize Fastlane. What gets recorded in Fastlane, is configurable. There is a difference in speed when you launch a recently used application. This clearly indicate that multiple applications are running simultaneously and Fastlane can be used to switch between them.

    The Applications

    Nokia X runs the Nokia X platform, which is based on the Open Source version of Android. In a nutshell, this is Nokia’s own android and does not have any support for Google Play Store. However, there are a lot of applications available on Nokia Store. For any application which is not available on Nokia Store, several third party stores can be installed (by enabling the third party stores in the security settings). I have used 1Mobile Market for installing some of the applications (like Yahoo Mail, Flipboard, 2048, Flickr, What’s App etc) which were not available on Nokia Store. But the application on Nokia store are growing fast.

    I downloaded the Gmail / Youtube etc applications from 1Mobile Market, but it did not launch displaying that the Google Play services on which it is dependent are not installed

    There are instructions on internet on installing the Google Plays by rooting the device, so if you are keen on going google way, you can take this step forward.

  • RPi – Static IP Address on Wifi

    There is a GUI tool in the desktop called “wpa_gui” which can be used to connect to the wireless network provided you have a supported wireless card attached to the RPi. However, if I want to run a headless RPi I would need a static IP address. Unfortunately “wpa_gui” does not provide me a means of configuring static IP address on the “wan0″ interface and my ADSL router does not support associating a static IP address with a MAC Address. This means I have to use static IP address configured on my wireless interface on the RPi and have to do it the old fashioned way (read I am loving it).

    Open up the “/etc/network/interfaces” file and make the following entries. The commented lines are the one’s which were added by the “wpa_gui” and we don’t need them. If you have little Debian experience, you will find these lines self explanatory:

    auto lo
    iface lo inet loopback
    
    #auto eth0
    iface eth0 inet static
    address eth0 192.168.1.52
    netmask 255.255.255.0
    gateway 192.168.1.1
    
    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet static
    address 192.168.1.51
    netmask 255.255.255.0
    gateway 192.168.1.1
    wpa-ssid "My SSID"
    wpa-passphrase "My Passphrase"

    I have added a static IP address configuration line for the eth0 interface also, so that in case someday I connect my RPi to physical connection I will just bring my eth0 interface up and have an IP address. The reason I have commented the “auto eth0” line is because in case a physical interface is up, the default route of the system is always through the physical interface i.e eth0 in this case. So, if my WiFi is up, I want my packets to go in/out through WiFi by default and not through “eth0” (by the way it does not matter if you have connected the cable physically or not, if the physical interface is up, it is the default route out). Of-course we can prevent that, but it is going to be a little bit complicated, so we are going to just comment out auto line to make sure that the “eth0” does not come up. It is also possible to have both “eth0” and “wlan0” run simultaneously, but again it is a bit complicated for this post and I do not need that anyway.

    Now you can restart the networking or reboot the RPi and your WiFi should come up with the static IP address.

  • Setting up a Git Repository on A Remote Server

    Git is a wonderful distributed version control system and we can have a personal repository quickly set up without any technical difficulties. However at times we may need to work on shared development model where multiple people need commit access to the code. In such cases we would need a centralized repository store.

    By following  the given steps we will be able to set up a shared git repository accessible over SSH.

    • First a user needs to be created to hold the git repository (multiple repositories can also be set up under the same git user). Next a password need to be set up for the same user. Since this user will  never log on using shell, a password which is secure, random, very long string is a good option.
    $ sudo /usr/sbin/useradd -c "Git Version Control" -d /home/git -m -s /bin/bash git
    $ sudo passwd git
    • Next login as git user and create the project directory to hold the repository and then initialize that directory as a barebones (blank) git repository
    $ mkdir -p /home/git/projects/myproject1.git
    $ cd /home/projects/myprojects.git
    $ /usr/bin/git --bare init
    • Set up the .ssh directory for the git user to hold the authorized_keys file with the public ssh keys for the user allowed to log in a git user and access the repository
    $ cd /home/git
    $ mkdir .ssh
    $ chmod -R 700 .ssh
    $ touch .ssh/authorized_keys
    $ chmod 644 .ssh/authorized_keys
    • Finally change the shell of the git user to git-shell so that interactive logins for the user are not possible and only selected remote git commands are allowed.
    $ /usr/bin/chsh -s /usr/bin/git-shell

    Add the public key of the user(s) to the authorized key file. These users will be able to access the repository. Now all that needs to be done is to clone the repository and start working. Following command can be used to clone the repository on a *nix box. The 7652 is the port number where ssh daemon is listening. If your port is the default, 22, you can skip this port number.

    $ git clone ssh://git@myhost.mydomain.com:7652/home/git/projects/myproject1.git/
  • Time-zone Setting in Linux and BSDs from Shell

    Often the default time-zone in a linux and bsd system does not match our preferences. On a system which we have installed ourself, we may have selected the appropriate time-zone during installation, but as systems administrators we often get our hands on a system which is pre-installed and after taking over we want to change the time-zone to something which we are comfortable understanding and co-relating various system events in the time of our comfort.

    The time-zone of  the system is determined by a file called “/etc/localtime”, which a binary file. In order to change the time-zone, we need to replace this file with an appropriate file of our time-zone. All time-zone files are found in “/usr/share/zoneinfo”.

    On some systems “/etc/localtime” is a copy and in some cases a hard link of one of the time-zone found in “/usr/share/zoneinfo” directory. In OpenBSD, “/etc/localtime” is a symlink to one of the files in “/usr/share/zoneinfo”. I prefer the symlink approach, you can pick any of the methods to make appropriate “/etc/localtime” file available.

    In order to change the time-zone of my system from UTC to IST, I did the following.

    $ sudo ln -sf/usr/share/zoneinfo/Asia/Kolkata /etc/localtime

    In case you accidentally delete the “/etc/localtime” file, the timezone of the system reverts to UTC and upon having the correct file present again, it will reflect the correct timezone again. See below (I did this on a RHEL 6 machine) –

    $ date
    Wed Dec 18 13:56:05 IST 2013
    $ sudo rm -f /etc/localtime
    $ date
    Wed Dec 18 08:36:29 UTC 2013
    $ ls -l /etc/localtime
    ls: cannot access /etc/localtime: No such file or directory
    $ sudo ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
    $ date
    Wed Dec 18 14:07:03 IST 2013

     

  • FreeBSD 9.1 on Thinkpad T420

    beastieVery recently I was thinking of trying FreeBSD operating system on a laptop as a desktop system. FreeBSD is an excellent UNIX class of operating systems primarily used as a server on internet. Among other things the operating system posses excellent memory management features, ZFS and LLVM etc.

    I have installed various BSD class of operating systems earlier also, but when I installed FreeBSD 9.1 this time, I noticed that the default disk partitioning options have changed in the installer. By default if the automatic partitioning option is chosen, FreeBSD creates GPT (GUID Partition Table). I decided to proceed with all default options except the timezone settings were changed to IST.

    At the end of the install, the system refused to boot from the hard disk. I thought this is because the BIOS may be configured to use the UEFI (Unified Extensible Firmware Interface) being configured in BIOS as the laptop had windows 7 installed in it. I tried changing the setting to – disable, EUFI/legacy, legacy – but still the laptop did not boot. Upon my research on the internet I came across – https://wiki.freebsd.org/UEFI. Here it was mentioned that –

    Partitions not seen. When using GPT, FreeBSD will create a protective MBR. This MBR has one partition entry covering the whole disk. FreeBSD marks this partition active. This causes at least some UEFI implementations to ignore the GPT. To fix this the partition needs to be marked inactive. This should be fixed as of r251588, to be confirmed.

    Running

    fdisk /dev/sda0

    from the live mode in FreeBSD confirmed that there is an MBR partition created and the flag 80 (active) has been set on it. I booted from a linux CD and ran

    fdisk -l /dev/sda0

    to confirm that this is indeed the case. So I used linux fdisk to remove the active flag (toggle option), but this did not help me.

    At this moment I decided to drop this issue here and take the easy way out in order to get the operating system installed. During the installation this time I chose manual partitioning –

    • deleted all partition
    • changed the partitioning scheme to MBR (the default was GPT)
    • created a FreeBSD partition on it with further two partitions (slices) within the FreeBSD disk area
      • one as type freebsd-swap
      • other freebsd-ufs (mounted at /).

    During the end of the installation an option to go to shell for additional installation is provided. I selected that option and then ran the

    sysinstall

    utility and selected options as follows –

    sysinstall -> Configure -> Packages -> FTP -> Main Site

    Selected all the desired software and finished the installation. The reboot took me straight to FreeBSD.

    Enabling UTF-8

    The available locales can be checked using the locale command. In order to find out the UTF-8 locale which are installed –

    # locale -a | grep UTF-8|grep US
    en_US.UTF-8

    In order to add the support for this locale, following lines need to be added in /etc/login.conf –

    :charset=UTF-8:\
    :lang=en_US.UTF-8:

    Finally run the –

    #cap_mkdb /etc/login.conf

    Now in order to use these following two environment variables can be set –

    LANG=en_US.UTF-8
    GDM_LANG=en_US.UTF-8

    Installing X windows and Windows Managers

    Since I wanted to get a graphical desktop on the laptop, I need to install X windows, a window manager and some other graphical tools like browser etc.

    # pkg_add -r x11 ratpoison awesome stumpwm firefox

    Configuring X and starting is done as below –

    # X -configure
    # cp /root/xorg.conf.new /etc/xorg.conf
    # cat ~/.xinitrc
    export LC_ALL=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    export LANG=en_US.UTF-8
    exec /usr/local/bin/ratpoison

    Following two lines needs to be added to

    /etc/rc.conf

    for the X to work correctly –

    hald_enable="YES"
    dbus_enable="YES"

    and then finally

    startx

    to launch the X. May be later on I will install one of the display managers to facilitate graphical login.

    So I am ON with freebsd and now I can start learning/exploring this further and may be try some of the other BSDs along with this as multiboot. I have not really worked on BSDs from quite sometime. I expect this to be a good refresher.