Monthly Archives: March 2012

Turnkey: Build LAMP Server in Under 10 Minutes

Turnkey to LAMP

Many of us have wanted to work on our own homemade Linux Web server, but struggled due to the lack of appropriate versions, and the knowledge to set up PHP support or even  dynamic DNS. Well, fear no more; it is no longer rocket science to set up a LAMP stack at your home or office, thanks to virtual appliances from Turnkey Linux. In this article, I walk you through a simple, effective way to set up your own LAMP virtual server, using a preconfigured ISO.

Turnkey Linux is a virtual appliance library that integrates and polishes the very best open source software into ready-to-use solutions. Each virtual appliance is optimised for ease of use, and can be deployed in just a few minutes on bare metal, in a virtual machine, or on the cloud.

Before we get into setting up our own LAMP Virtual Server using a preconfigured ISO, let us evaluate our options.

Prerequisites

  • Virtual Machine software: VMWare Player or Oracle VirtualBox? For the purposes of this article, we will use the free VMWare Player 3, which you can download from here.
  • Download the LAMP server ISO image from Turnkey’s website.
  • Once the above ISO has been downloaded, place it on your desktop or home directory.
  • A host operating system — Linux, Windows, BSDs or whatever. Unfortunately, I’m using a Windows host as I write this article, since I don’t currently have any Linux host at my disposal.

Installing into a VM

  1. Launch VMWare Player.
  2. Click the Create a New Virtual Machine option.
  3. You will now be presented with the New Virtual Machine Wizard, as shown in Figure 1, asking for the install source (your optical drive, or an ISO image), or whether you would like to install the OS later. Choose the last option, and click Next.New Virtual Machine WizardFigure 1: New Virtual Machine Wizard
  4. In the Guest Operating System screen (see Figure 2), choose Linux, and Ubuntu, and click Next.Choosing a Guest Operating SystemFigure 2: Choosing a Guest Operating System
  5. Give the VM a name, and click Next.
  6. Now, you need to allocate disk space. As you can see in Figure 3, I have chosen 8 GB; feel free to choose whatever is appropriate for your environment, and click Next.Disk ConfigurationFigure 3: Disk Configuration
  7. In the final screen of the wizard (Figure 4), click Customize Hardware.Final screenFigure 4: Final screen
  8. We need to set up our Turnkey LAMP ISO as the media to boot from (see Figure 5). Click New CD/DVD, and in the Connection section, choose Use ISO image file; click Browse and navigate to the location of the Turnkey Linux LAMP ISO, and choose it.Set up an ISO image locationFigure 5: Set up an ISO image location
  9. Now, click OK twice, and click Play Virtual Machine.
  10. At the Turnkey Linux bootloader screen (see Figure 6), choose Install to Hard disk and hit Enter.Install to hard disk –- LAMP Stack Boot splashFigure 6: Install to hard disk –- LAMP Stack Boot splash
  11. Follow the on-screen instructions, and choose to install with auto-partitioning. Choose the second option that shows up, Guided Partitioning — Use Entire Disk.
  12. When it comes to choosing the GRUB installer, choose Yes.
  13. When the installation is done, click Yes to reboot.
  14. Enter the passwords for the root and mysql users, when prompted.
  15. The Backup and Migration utility (TKLBAM) doesn’t require setting up an Amazon EC2 instance. It works with local installations just as well. However, if you wish to store your backup data on Amazon, you need to subscribe to Amazon’s cloud storage service. Click Skip for the time being…
  16. You will now be prompted to install security updates; please choose Install, as it is a one-time operation. Once the updates have been applied, you should see a screen like the one shown in Figure 7.TKL LAMP Appliance Services ConsoleFigure 7: TKL LAMP Appliance Services Console

Checking it out

Do a test connection to the appliance by visiting the IP address mentioned in the console, which may differ for your installation. Figures 8 and 9 show the server home page and Apache service status.

Turnkey Linux LAMP home page

Figure 8: Turnkey Linux LAMP home page

Apache Web server status

Figure 9: Apache Web server status

To make things even more user-friendly, Turnkey Linux has included the famous Webmin (Web-based server administration for managing Linux servers) as part of this appliance. To access the Web Console, from the home page click the Webmin icon. You will be asked to accept the security settings; do so and you will be taken to the Webmin login page.Log in as root, with the password you set during the first boot. The Webmin home page is shown in Figure 10.

Webmin home page

Figure 10: Webmin home page

Now wasn’t that a breeze? You now have your personal LAMP stack up and running, ready to serve your websites…
I hope you found this tutorial informative and feel free to share your feedback.

 

ref: Anil Mahadev

Backups and More with rsync

Time to rsync

Learn how to use this powerful utility that almost all experts use in their day-to-day work, to perform tasks like back-ups, and much more.

The rsync utility can be used cross-platform—Linux, Mac OS X and Windows (with Cygwin, of course) — and, in combination with cron and SSH, it can easily be scripted. This makes it one of the essential utilities in one’s toolkit, even if not planning to use it for backups. Another advantage is that it is bundled with almost all major Linux distributions today.

The killer feature, really, is differential backups — rsync, with its unique algorithm, allows you to transfer only the changes made in a file/directory tree, instead of re-transferring all data. This is very beneficial when synchronising large files or directory trees with gigabytes of data. rsync only transfers changed portions, and applies the changes to the file/directory tree copy on the other system, somewhat like the patch utility. It can even be used to synchronise files locally (on the same system), if you want to make backups on the local machine itself (say, to a different drive, like a USB drive). Overall, it is a simple, easy and efficient solution, where we don’t even need to install any complicated backup software.

Setting up and configuring

Normally, rsync can directly be used by specifying source and destination directories, but we usually set it up in daemon mode (an “rsync server”) at one end, so that it can receive requests for synchronisation. It can be set up in one-way or two-way synchronisation methods, as a standalone daemon configuration or as inetd configuration. The type of configuration used depends on the amount of traffic that our daemon is going to receive.

For significant traffic throughout the day, it is better to have a standalone daemon, otherwise the inetd configuration will do. Also, it is obvious that for two-way synchronisation, we have to run rsync in daemon mode at both ends. To configure rsync in daemon mode, modify the /etc/rsyncd.conf file as follows:

motd file = /etc/rsyncd.motd
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
    [path_1]
    path = /directories/here
    comment = something to comment
    uid = nobody
    gid = nobody
    auth users = username
    secrets file = /etc/rsyncd.scrt

As you can see, this file has two sections — global parameters and path-specific settings. All file specifications like motd (message of the day) file, log file, pid file, lock file, etc., come under global specifications, while parameters that follow the [path_1] tag are path-specific settings
([path_1] is the name of that particular path). More than one such path can be set up in a configuration file. Though I have only specified relevant and important settings here, you can take a look at the man page if you want a complete list of path-specific and global configuration parameters.

However, here is a brief explanation of some of them:

Parameter Explanation
path The physical directory in the filesystem to be made available
uid The user that should execute the actual transfer process
gid The group name or ID that accompanies the uid parameter
auth users The names of users, as specified in the secrets file, that are allowed to connect to this path. These do not refer to the actual users of the system.
secrets file The name of the secrets file, specifying the user names and passwords that are asked on connection to the client

Now that rsync has been configured on the server, you can start the stand-alone daemon with the command: rsync --daemon.

rsync client

The rsync server can now be used from the client with the following command:

rsync -avz host::path_1 /directory/at/destination

This command will copy all files from the remote module named path_1 to the local destination folder on the client. This type of command is known as a “pull” command, while one with the remote path as destination is known as a “push” command. This will make it prompt for the password configured for the respective module, which can be bypassed by using the --password-file option (for use in scripts).

Now, let’s look at another example, of a local copy of files, with some of the optional switches:

rsync --verbose --progress --stats --compress --recursive --times --perms \
--links --delete --exclude *.pdf /home/user/Folder1/ /home/user/Folder2

Some of the options like --verbose, --progress and stats are self-explanatory. Compression (--compress) is one of the features rsync provides to speed up data transfers, which is actually useful when synchronising with remote hosts. The next few options specify the following:

  • --recursive — to recursively copy all sub-folders;
  • --times — to maintain previous timestamps
  • --perms — to keep the permissions intact
  • --links — to copy symbolic links as links (not to de-reference)

There are a number of other choices that you can use, like --copy-links and --safe-links — the first copies the linked directories/files instead of the links themselves, while the second altogether avoids links pointing outside the tree.

The --delete option specifies that one wants to delete (earlier copied) files in the destination folder, if they have been deleted in the source directory since the previous synchronisation. Finally, --exclude *.pdf prevents all PDF files from being copied.

Note: The presence or absence of the trailing slash in the source/destination path is very important; it makes quite a difference to how files are copied. In the above command, the trailing slash in the source, /home/user/Folder1/ means that the contents (files and sub-folders) inside Folder1 are to be copied to the destination folder. Without the trailing slash, rsync first creates the Folder1 folder at the destination, and then copies Folder1‘s contents into that new folder. Always keep this in mind, else you can end up with quite a mess to sort out if you’re backing up two or three project folders, like (in /home/ankit/Projects) projA, projB, projC. Or if, for example, your rsync commands are as follows:

rsync --recursive --delete /home/ankit/Projects/projA/ /media/BACKUP/currentprojects
rsync --recursive --delete /home/ankit/Projects/projB/ /media/BACKUP/currentprojects
rsync --recursive --delete /home/ankit/Projects/projC /media/BACKUP/currentprojects

Now, in the currentprojects folder on the backup drive, you will have a folder projC, containing that project’s files — but the files and sub-folders from the projA and projB folders will be mixed together in the currentprojects folder, not inside individual projA and projB folders… and this will be because you wrongly used the trailing slash for those folders. If you
have to recover files from this backup, imagine the mess and confusion, and the effort required to sort things out!

GUI tools

There are a number of GUI tools available for rsync, most of which obviously cannot match the flexibility provided by the command-line itself. Still, some of the tools, like Grsync and Gadmin-Rsync, do a good job of implementing the basic functionality. Another really good application based on the rsync, cron and diff commands is Back in Time, which resembles the Time Machine feature of Apple’s Mac OS. It provides more sophisticated features, and an interface understandable even by non-geeks.

The Interface for Grsync

The Interface for Grsync

The GNOME view for Back In Time Application

The GNOME view for Back In Time Application

In conclusion, we can say that rsync is a simple, yet really powerful application, which when used with tools like cron can provide flexibility and performance comparable with complex and even enterprise back-up tools.

Recipes for Networking

In this article, we’ll explore networking under GNU/Linux. You’ll find it interesting to manage the entire network through certain valid keystrokes known as commands. Imagine that you have to access the contents of several other machines from a mount point in your machine. Then imagine shutting down, rebooting, and installing applications on those remote machines, all at one time? Could you configure the WLAN and LAN interfaces from the CLI? This tutorial gives you some insights to the exciting bytes on controlling your network under GNU/Linux.

First we will learn the ‘Hello World’ of a networked machine.

Let us ping!

ping is a universal command that is available on every operating system to test the reachability of a network. When you shoot your terminal with the ping command and an IP address as its argument, the machine will try to send some bits of raw data towards the machine owning that IP address. If some machine exists with that IP address, it will send back certain bits. Thus the machine receives the bits and it confirms that a path is available from the current machine to the other through a network. We can check the existence of certain machines on the network by just pinging.

To see which machines are up in the current network, let’s write a bit of shell script. Open vim as the root:

# vim /usr/bin/netup.sh

…and key in the following lines in it:

#/bin/bash
for i in 192.168.1.{1..255}; // checks 192.168.1.x class of IPs.
do
ping -c2 $i > /dev/null;
[ $? -eq 0 ] && echo $i is up.

trap "exit"  SIGINT  // To force exit when Ctrl+C  keystroke is applied.
done

Save the file, and make it executable by running the following command:

chmod a+x /usr/bin/netup.sh

Now, run the script as:

[slynux@gnuxbox ~]$ netup.sh
192.168.1.1 is up.
192.168.1.3 is up.
192.168.1.4 is up.

Configuring your network

Now, let us look at how to configure your machine on the network. You can configure it using two methods. It can be configured manually by the ifconfig command for static IP addressing or it can be done via the DHCP (Direct Host Control Protocol).

Static IP addressing is the one that you explicitly instruct the system to use by giving an IP address for a given Ethernet or wireless interface. In case you’re using the DHCP, simply issuing the dhclient command will fetch the system an available IP address from the DHCP server in your network. Note that it may not be the same IP address that your machine fetches each time you issue dhclient.

Interface cards

Machines are networked either via network cables or using wireless protocols. LAN cards used for networking are known as Ethernet and wireless LAN (WLAN) cards. We interface the network via this outlet. In *nix platforms, Ethernet cards or WLAN cards are denoted as eth0, eth1, etc, or wlan0, wlan1, etc, respectively.

ifconfig

We have ifconfig, a.k.a the interface config, for setting up a network on the machine. To get information about the availability of interface devices available on the current machine, open a terminal and execute the following as the root:

[slynux@gnuxbox ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:1C:23:FB:37:22
          inet6 addr: fe80::21c:23ff:fefb:3722/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:9724 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2720 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2400589 (2.2 MiB)  TX bytes:645396 (630.2 KiB)
          Interrupt:17

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:76320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76320 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:87151068 (83.1 MiB)  TX bytes:87151068 (83.1 MiB)

wlan0    Link encap:Ethernet  HWaddr 00:1C:BF:87:25:D2
          inet addr:192.168.1.143  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:bfff:fe87:25d2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:45302 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37510 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:31091293 (29.6 MiB)  TX bytes:9734025 (9.2 MiB)

Here I have three interfaces — eth0, lo and wlan0, where:

  • eth0 corresponds to the Ethernet card
  • lo corresponds to a loopback device that points to the localhost network
  • wlan0 corresponds to the wireless LAN card

Static IP addressing

For static IP addressing, issue the following command as the root:

ifconfig <device name< <ip address>

For example:

ifconfig eth0 192.168.0.2

ifconfig -a gives you details of all interface devices and configurations. In order to receive details of only one Ethernet device, execute ifconfig eth0. The following is an example output:

[root@gnubox slynux]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1C:23:FB:37:22
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:23ff:fefb:3722/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:9724 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2720 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2400589 (2.2 MiB)  TX bytes:645396 (630.2 KiB)
          Interrupt:17

Now, let us go about setting the subnet mask. This is done easily with ifconfig, as follows:

ifconfig eth0 192.168.0.2 netmask 255.255.255.0

Now that the IP address and subnet mask is configured (or reconfigured), how do you get your Ethernet up (i.e., available) and down? The ifup and ifdown commands help you with that as follows:

ifup eth0
ifdown eth0

Wireless networking

In order to hack a wireless card, we have another utility called iwconfig. It works similar to ifconfig, but it has lots of additional features that are bonded to wireless cards. If we are using a wireless network with static IP, we can attach our wireless card interface to a network as follows:

iwconfig wlan0 essid slynux

…or:

iwconfig wlan0 essid slynux key 8c140b2037

…where ‘slynux’ is the ESSID (that is, the name of the wireless network) and ‘8c140b2037’ is the security key. Of course, you need to replace these variables with the values that hold good in your network. You can also scan and check the availability of wireless network(s) in your vicinity using the iwlist command as follows:

[root@gnuxbox~]# iwlist wlan0 scan
wlan0  Scan completed :
          Cell 01 - Address: 00:08:5C:52:E9:83
                    ESSID:”slynux”
                    Mode:Master
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=92/100  Signal level:-39 dBm  Noise level=-78 dBm
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s
                    Extra:tsf=00000000fc021187

The above command will list out the various wireless networks available with a number of properties.
Then we can set the IP for the interface card using the ifconfig command itself:

ifconfig wlan0 192.168.0.5

If you are using dynamic addressing, you can obtain the IP address as follows:

dhclient wlan0

The settings that you’ve configured with the ifconfig tool are available until the system reboot. But it’s a waste of time if you need to configure it on every system start. And hence we take the aid of network configuration scripts. On an Ubuntu (or any other Debian-based) system, this file is located at /etc/networks/interfaces, and contains data similar to the following:

auto lo
iface lo inet loopback

iface eth0 inet static
address 164.164.32.101
netmask 255.255.255.240
gateway 164.164.32.97

It is necessary to learn this scripting in order to play with your network. The syntax for these are as follows:

  1. Add the following lines if you want to configure eth0 as the DHCP:
    auto eth0
    iface eth0 inet dhcp
  2. Add the following files if you want to configure static IP:
    auto eth0
    iface eth0 inet static
    address <ip_address>
    netmask <netmask>
    gateway <gateway_ip>
  3. If it is a wireless network, add the following lines along with the above lines:
    wireless-essid <network_name>
    wireless-key <key>

Now, to restart the network daemon, execute the following as the root:

/etc/init.d/network restart

Spoofing a MAC ID

It is a real hassle for cable Internet customers that they are restricted to using a single machine for Internet access. If you want to plug your laptop in your friend’s cable Internet connection,
you have to call the service provider to refresh the MAC address.

The MAC address is permanent to the hardware and cannot be changed. Since we operate the hardware via the software abstraction layer, it is quite possible to do some software-level cheating for the network card’s MAC ID. We can simply spoof it to some other MAC addresses.

You can obtain the original MAC ID from the ifconfig output. Mine is as follows:

 eth0      Link encap:Ethernet  HWaddr 00:1C:23:FB:37:22

Now, let’s change the last part of the MAC ID from 22 to 23:

ifconfig eth0 hw ether 00:1C:23:FB:37:23

Now, run ifconfig again:

[root@gnubox slynux]# ifconfig eth0
eth0    Link encap:Ethernet  HWaddr 00:1C:23:FB:37:23
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:17

Easy enough? Well, let’s consider the following instance: suppose you are in a Wi-Fi campus and the access to the wireless network is restricted using MAC addressing. You can simply look at your friend’s laptop MAC ID and spoof it. Yes! You are now free to access the network. Have fun!

DNS (Domain Name Service)

DNS is responsible for name resolution. When you point your browser to http://www.google.com, it points to a server on the Internet. How does that happen? As you are aware, all networked computers are assigned with IP addresses. But how do you access the Web page hosted in Google’s remote machine by simply typing a name like google.com?

That phenomenon is achieved using domain name resolution. There are some servers on the Web called name servers (or DNS) that resolve certain names to corresponding IP addresses, like google.com to its corresponding IP address, in our case. So, we should have the IP addresses of the DNS servers (generally provided by the Internet service provider) handy so that we don’t have to remember everyone else’s when we browse the Web. When we point our browser to google.com, it consults one of these name servers to find out the IP address and thus load the Web page. But where do we configure the IP addresses of these name servers?

If your network is configured with DHCP, there is no need to specify the name server explicitly. For static IPs, it is, however, necessary. We enter the DNS servers’ IP addresses in the /etc/resolv.conf file. Mine looks like the following:

nameserver 208.67.222.222
nameserver 208.67.220.220

Note that you don’t really need to use the DNS addresses provided by your ISP. For safety purposes, I use OpenDNS—the IP addresses are listed in the above snippet. You can learn more on why OpenDNS is a much safer bet at http://www.opendns.org.

SSH (Secure Shell)

SSH can be defined as the blood of *nix networks. SSH enables users and administrators to make remote logins to other machines that are connected through any kind of network. If you know the user name, password and IP address of another machine on the network, you can remotely log in to that machine and work on it as if you are actually working in front of that machine. The following is an example in which I’m authenticating to a system with the IP address of 192.168.1.3 as the user test:

[root@gnubox ~]# ssh test@192.168.1.3
The authenticity of host ‘192.168.1.3 (192.168.1.3)’ can’t be established.
RSA key fingerprint is 9f:61:ae:ac:8f:75:bb:3a:02:4a:f4:6c:7d:b9:0d:07.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.3’ (RSA) to the list of known hosts.
test@192.168.1.3’s password:
-sh-3.2$ echo I am on 192.168.1.3 Machine
I am on 192.168.1.3 Machine
-sh-3.2$

You can open the CD tray of the other machine, close the tray, shutdown, reboot the machine — depending on the privileges the user name you’ve logged in with, has.

sftp is an extension to the ssh protocol that helps us to use the SSH connection to transfer files between machines. The following is an example:

[root@localhost ~]# sftp test@192.168.1.3
Connecting to 192.168.1.3...
test@192.168.1.3’s password:
sftp> ls
Desktop    Documents  Download   Music      Pictures   Public     Templates
Videos     a.out      test.bin     file.cpp   t.c
sftp> get t.c
Fetching /home/test/t.c to t.c
/home/test/t.c                                100%  239     0.2KB/s   00:00
sftp>

To download a file from the remote machine we use the get command, and to upload a file, we use put. In the above snippet you can see that I’m downloading a file named t.c using the get command, after logging in to the remote machine using sftp.

sshfs is another extension to SSH, which empowers you to mount directories on a remote machine as a filesystem to a specified mount point:

root@localhost ~]# sshfs test@192.168.1.3:/home/test /mnt/test
test@192.168.1.3’s password:

In the above snippet, I’m mounting the home directory of the user ‘test’ on 192.168.1.3 to my local machine under the /mnt/test directory.

Proxy server configuration

Many of us on a college campus or office network access the Internet through a proxy server. How do you set the proxy server details in your shell environment? You can set the proxy for different protocols as follows:

export http_proxy=”http://192.168.0.1:3128” ; // HTTP proxy
export ftp_proxy=”192.168.0.1:3128” ; //FTP proxy

If you want these settings to be permanent, each time you log in add these lines to your ~/.bash_profile file.
That’s all, folks! Hope you have enjoyed learning the secrets of networking. Happy hacking till we meet again!

Here Comes Linux Kernel Version 3.3

Monday, March 19, 2012 Linus Torvalds has finally announced the seventh release candidate (RC7)for Version 3.3 of the software. Torvalds noted that a host of small issues prompted the decision to go with RC7 rather than a full release of 3.3. “Now, none of the fixes here are all that scary in themselves, but there were just too many of them, and across various subsystems. Networking, memory management, drivers, you name it,” he wrote.

Linux 3.2 was released more than 10 weeks ago.

Interestingly, Android has been baked into the Linux 3.3 kernel thus making it more straightforward for developers to create cross-platform applications. “Although Android and mainline Linux have always shared plenty of code, the underlying kernels have been separate; this new release means manufacturers will be able to simply throw their hardware-specific drivers into a Linux-based gadget and have a functional Android device,” SlashGear said in a report.

“For a long time, code from the Android project has not been merged back to the Linux repositories due to disagreement between developers from both projects. Fortunately, after several years the differences are being ironed out. Various Android subsystems and features have already been merged, and more will follow in the future. This will make things easier for everybody, including the Android mod community, or Linux distros that want to support Android programs,” states the Linux 3.3 release notes. 

Ref: Monika Bhati, EFYTIMES News Network

“For a long time, code from the Android project has not been merged back to the Linux repositories due to disagreement between developers from both projects. Fortunately, after several years the differences are being ironed out. Various Android subsystems and features have already been merged, and more will follow in the future. This will make things easier for everybody, including the Android mod community, or Linux distros that want to support Android programs,” states the Linux 3.3 release notes.

Get Started with 5 Useful Open Source Tools for Windows

These user-friendly open source tools will make your life that much easier… …and exciting.


Many believe that open source is only for geeks who would rather marry their computers or trade their kidneys to get the latest gizmo. Well, jokes apart, there is certainly a feeling that open source is difficult to follow and is not for every one. In this article, I aim to disprove this prevailing myth by listing five open source tools that are great for daily use, yet are user-friendly — and, no, there’s more to open source tools for Windows than just Firefox, VLC, OpenOffice.org and GIMP.

The following five tools merely demonstrate what open source has to offer us. Anyone with elementary computer knowledge can use them…

1. Rainmeter

How do you customise your desktop? It isn’t only Linux users that have this privilege. Though Windows is a proprietary OS and does not allow you much scope for customisation, the open source tool Rainmeter gives you the much-needed freedom.

Rainmeter is not just an application, but a toolkit that lets you write and extend functionality. It has small windows called skins to display information, which are its basic building blocks. Using these, you can view systems resources, weather forecasts, emails, your FB status, tweets and RSS feeds, as well as make notes, launch applications, control your media player and more.

To get started, visit the site, download the installer and run it. After installation, you will see the default theme with various skins arranged along the screen. (A theme is a file that controls the layout of skins on your desktop.) Right-click the skins for a context menu based on the skin you are using. This lets you manage and even edit the skins.

You can even create your own skins — and you needn’t master a weird programming language to do so; the toolkit has its own language that is far easier to comprehend than regular programming languages (more on it at on the application website).

Even if you don’t want to edit or create your own skins, there are already thousands of skins freely available for download. Since Rainmeter is open source, the community backs you up whenever you need assistance. So what are you waiting for? Go grab Rainmeter now and amaze others with your desktop.

2. GNU Cash

How many of you have asked yourselves the question “Where does my money go?” every month-end? We don’t realise how much we’re spending until the wallet is empty. For example, if you planned to buy something big and were saving for it, you get a reality check at the month-end — you weren’t actually saving, because your money has to go towards your credit card bill! This is why we need financial planning — to prioritise our needs and track expenditure and savings.

The GNU Cash financial accounting software is one open source tool which does just that. It can help both individuals and organisations, allowing you to track bank accounts, stocks, income and expenses — while even assisting you to actually save money.

You can download the latest release from the application website . It’s available for almost all common OSs, including GNU/Linux, BSD, Solaris, Mac OS X and MS Windows. Installation is pretty simple: Next, Next, Finish.

When you launch it, you get a window titled “Unsaved book”. Go to File –> New File for a window to set up a new account; from here, you can create accounts for assets, liabilities, etc. Once you select your currency, you can select the categories to add in your account; each category has a set of accounts. Select the categories suiting your needs.

You can always add accounts later. Now you can save the account as a file (which is good for individuals) or to a database. A file is good if you’re not sure about databases. Now you’re ready to go! Remember to update your account regularly to track daily expenses and savings. You can view reports under the Reports link.

There is a lot more to GNU Cash; you can use it for small businesses too, with the provision to manage invoices, vendors, employees, customers, etc. Hope this introduction sparked your interest in this tool. Happy saving!

3. Umlet

College students, software professionals or any one of us often need to draw a diagram to express an idea, design or concept. After all, a picture is worth a thousand words, and is the best way to convey your thoughts. If you’ve ever tried to draw a diagram using MS Word, you probably know it’s better to write out those thousand words instead.

Well, sarcasm apart, here is an easy-to-use open source diagramming tool: Umlet, the free UML tool. Download the zip file from the application website. Unzip it to get the .exe and .jar files; run either to get started. The .jar file can run on any platform with Java 1.6+ installed.

When you open Umlet, you get a window divided in three parts. On the left is your drawing canvas, the upper right half has the default drawing elements, and the lower right is the Properties pane. You can drag and drop elements to the canvas to draw your diagram. Resize the elements directly on the canvas, and change text using the Properties pane. You can easily add new elements via the custom elements link, which offers a graphical as well as code interface to create custom elements.

You can copy diagrams and paste to other documents, or also mail them directly. The tool is highly configurable, and in case of a doubt check the official FAQ page.

4. Audacity

Audacity is an open source tool to record and edit sounds. It has features for converting tapes and LPs to digital recordings, and recording streaming audio playing on the computer. It offers a lot to general-purpose users: music capture, converting favourite tunes to mobile ring-tones and more. Download it from here. The current release 1.3.14 is a beta; the stable release 1.2.6 doesn’t support Windows XP/Vista. Choose which one you want and install it.

To edit sound clips, open them via File –> Open to get a graphical representation of the clip. Now select the part to edit. You can add various effects (the Effect menu). More professional users can add effects manually using the Draw tool and the other tools available.

To record sounds, select the proper input device and click the record button; then save it to the desired file format. This tool has various other features you can put to good use.

5. Winmerge

Winmerge is an open source graphical tool to compare files/folders and merge differences. Currently available for Windows, it will soon be available for other platforms. Get it from here.

After installation, you can open files or folders to compare them. Comparing folders will show up files that differ; for files, the view shows the differences in yellow, by default. A few icons at the top are very useful, especially for bigger files. The “Next Difference” and “Previous Difference” buttons visit the next/previous differences found, eliminating the chance of missing one while manually scrolling. Other features are self-explanatory.

To merge differences, you can use the “Copy Right” or “Copy Left” button. The Copy and Advance button merges and moves to the next difference, in one go. As of now, Winmerge supports Windows, UNIX and Mac text file formats, and is usable for code and other text files.

So that’s it. Hope you liked the compilation and it inspires you to use these tools — or even better, get involved in the open source movement! All queries and feedback are welcome.

 

ref:Nitish Tiwari

Setting up a LAMP Server Remotely


LAMP time!

It’s been said a million times over — Linux is awesome on servers! With over 60 per cent of the Web’s servers gunning away on the mighty penguin, the robust, resilient, scalable and stable Linux plays a major role in keeping the Internet running like a well-oiled machine. In this article, I will describe how to set up a LAMP (Linux, Apache, MySQL and PHP) server from scratch, remotely. The only step requiring physical access is installing Ubuntu Server. The rest can be done the geeky way, via SSH! Read on if getting your hands dirty gives you a kick!


Let us first install Ubuntu Server, and then, from another system, connect using the PuTTY SSH client to install FTP support and phpMyAdmin, and get a phpBB website up and running.

Setting up Ubuntu Server

Download the ISO from the Ubuntu website. Burn a CD, or prepare a USB boot disk, as per your preference. Boot the server machine from it. The boot menu is shown in Figure 1. Select Install to the Hard Disk. The installer will boot and ask you to select your language. Select English and continue.

Ubuntu Server boot menu

Figure 1: Ubuntu Server boot menu

I will fly through the next few screens, since they’re all what you usually see during any standard OS installation. For the keyboard layout, the default US layout works for us. The installer will then load components and configure hardware. It will also try to configure the network interface using DHCP. If that fails, you will be asked to manually enter network information like Host IP, Gateway, Subnet Mask, etc. It will also prompt you to enter the hostname; use a name you would like the server to be known by on the network. For this article, I have used ‘mylamp’ with IP address 210.22.23.24.

Next comes partitioning. I used the Erase Entire Disk option; if you have any specific partitioning requirements, feel free to use Manual partitioning. After this stage, under Clock Configuration, you will be asked about your system time setting. The new user (non-root) creation screen is next; enter your full name, user name (I used ‘lampuser’) and password.

The installer will now show you a software selection screen; select LAMP Server and OpenSSH Server.
Wait as the progress bars fill up — first for the base system, then for the package installation, and then for the GRUB bootloader. Once all these are done, it will tell you that it is time to reboot and take your new server for a ride!

Reboot prompt

Figure 2: Reboot prompt

Server installation is now complete. Remove the disc and return to your desktop. Let us now remotely configure the server for a LAMP website.

Preparing for deployment

Whether your desktop runs Windows or Linux, you can use the PuTTY SSH client. Download it, fire it up, and enter the connection details for your server (Figure 3).

PuTTY connection screen

Figure 3: PuTTY connection screen

Click Open to connect to the server. This will bring up a terminal prompt that asks you to enter the username. It may throw up an error similar to the one in Figure 4. Just click on Yes. Once the password is accepted, you will be greeted with a shell prompt. The first thing to do is set up a FTP server so we can upload files to the server. Next, let us install phpMyAdmin to manipulate MySQL databases.

Server host key alert

Figure 4: Server host key alert

FTP service

FTP support is by the vsftp daemon; installation is straightforward: sudo apt-get install vsftpd. After installation, tweak the configuration file to point the default path to /var/www (the Apache ‘Webroot’ for hosted content/sites). Edit /etc/vsftpd.conf as the root user, with a text editor and Make sure the settings match those shown below:

write_enable=YES
local_enable=YES
local_root=/var/www
file_open_mode=0777

Restart the FTP service to bring the configuration changes into effect: sudo restart vsftpd.

Installing phpMyAdmin

phpMyAdmin is a great tool for administering MySQL databases. Install it using the following command: sudo apt-get install phpmyadmin.
We can now exit the PuTTY session, using the exit command.

Deploying a LAMP website

For the purpose of this article, let us deploy a standard version of phpBB — the most famous AMP-powered bulletin board system and forum content management system (CMS). I will not go into the installation details, since the aim here is to learn how to generally deploy a LAMP website remotely — however, you can refer to this article for installation instructions. Download the archive from the phpBB home page and extract its contents.

Now, using an FTP client, connect to the server with the username and the password used in the PuTTY session. Create a folder called phpBB on the server, and copy the extracted files and folders to the root of that directory. Open a browser and navigate to http://210.22.23.24/phpmyadmin (replace the IP address with yours) to bring up the phpMyAdmin page (Figure 5).

phpMyAdmin status page

Figure 5: phpMyAdmin status page

Create a new database named phpbb — go to the Database tab and use the Create New Database section at the bottom. You can now proceed to a site-specific installation by navigating to http://210.22.23.24/phpbb. Follow the instructions on the page.

We have now successfully set up our server, and learnt how to remotely control it! I hope you had fun learning, during this process. Until next time, cheers!

Ref: Siddharth Mankad

Demystifying the Cloud with eyeOS

Demystifying the Cloud with eyeOS

It’s another day in your life with technology and you keep hearing people talk about “Cloud this…” and “Cloud that…” or  “Just store it in the cloud!” So what exactly does the term mean for you? I attempt to explain this concept through a unique open source operating system called eyeOS.

Literally, the “cloud” is a metaphor for an architecture of systems, hardware and networks, which aim to provide computing as a service.  Different aspects of computing like storage, processing, etc., are provided as services to the end-user. A very common example is Google Apps. All our email, documents, spreadsheets, presentations, maps, searches or bookmarks (the list goes on) are processed, stored and used “up there”, so to speak. Whenever we need to access or modify that data, we log in to the Google Apps cloud.  Google provides us the ability to process this data  as a service — for instance, Gmail is a component in that service architecture, and in Google’s business model as a whole.

Cloud computing has been around for a while, and the term is more closely used in the context of enterprise computing, but it’s not restricted to that. It’s true that corporations benefit from cloud computing, since all they have to do is hire the services, and not the hardware and infrastructure — a very visible example of a cloud service provider is Amazon. Cloud computing helps businesses reduce costs by quite a large margin. In human terms: let some cloud service provider handle all the dirty work; you pay the money, and get your job done.

What’s in it for me?

Google Apps is just one example. These days, there are many browser-based operating systems, which again, is cloud computing at its core. These operating systems offer you the benefit of using them anywhere on the planet, without worrying about synchronising your data or settings across multiple computers. All you need is a PC with an Internet connection and a supported browser. What if you wanted to set up a cloud-based OS server on your own, for use on your LAN at home, or in your business? Here’s introducing eyeOS.

Introducing eyeOS

This is a cloud-based operating system powered by Apache, MySQL and PHP (AMP). Yes, a W/LAMP-based cloud OS! eyeOS allows you to have your own cloud computing system — files and desktop environments can be shared across locations. These could be different systems on the intranet, or, with a global span, across the Internet. All you need is a Web server that has AMP capabilities.

eyeOS includes the following features:

  • Desktop: The desktop is similar to that of a regular operating system. It can be themed based on your preferences; it can run applications, and supports translations of up to 30 languages.
  • Office-related tasks: eyeOS supports MS Office and OpenOffice.org documents, spreadsheets and presentations. On top of that, it has a simplistic Personal Information Management (PIM) system that supports calendars and contacts (with a basic import/export facility in vCard format).
  • System and file management: Again, there is a pretty impressive spread of features in this domain. Uploading/downloading multiple files to the cloud, compressing in ZIP/TAR formats, and a dedicated picture viewer for slide-shows is a decent plus. As eyeOS is a cloud system, multiple users are easily managed by the simple UI offered to configure the system. Moreover, apps can be installed using the inbuilt package installer. To make things easier, multiple instances of the installed apps can be run at the same time.
  • Networking: The beauty of cloud computing is the fact that networking is at its core. There is an internal (proxied) FTP client, messaging client, bulletin board and an RSS feed reader that comes bundled by default.

Installing eyeOS

First of all, go to the eyeOS website and download the tarball. There are two main steps involved, which we will tackle in the simplest way possible:

  1. Installing AMP (Apache, MySQL, PHP)
  2. Installing and configuring eyeOS

The prerequisites follow:

  • Hardware: A PC with a Pentium-class processor at the minimum, 256 MB of RAM, 200 MB of free hard disk space for the installation of eyeOS; more will be required, depending on the number of users, and the volume of their files and data.
  • Software: A Linux distribution (I used Ubuntu 10.10 Desktop Edition), Apache, PHP, and MySQL.

Installing AMP

In Ubuntu, go to System > Administration > Synaptic Package Manager. Search for, and install Apache, MySQL, phpMyAdmin, and PHP. Once the installation is done, we will need to configure PHP and MySQL for eyeOS.  We will first need to create the eyeOS database for the system. Start the terminal, and issue the following commands:

mysql  -u root

This command will ask for a password; enter your password, if you had assigned one during the installation of MySQL. At the mysql prompt, type:

CREATE DATABASE eyeos DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
FLUSH PRIVILEGES;

Now that MySQL is set up, let’s modify the php.ini file (located at

  • /etc/php5/apache2/php.ini

). The following lines are to be edited to the given values:

memory_limit = 128M
display_errors = Off
post_max_size = 200M
upload_max_filesize = 100M

The last task in this sequence is to install curl. Run the following command in the terminal:

apt-get  install php5-curl

Before restarting Apache, for the changes to take effect, run the following commands:

a2enmod rewrite
sudo gedit /etc/apache2/sites-available/default

Edit the file to set the <Directory /var/www/> variable AllowOverride to All.

Finally, restart Apache with the following command:

/etc/init.d/apache2 restart

Deploying eyeOS

Now, extract the tarball you downloaded earlier into a older called eyeos in /var/www, by running the following commands in the terminal:

cd /var/www
mkdir eyeos
cd eyeos
cp /path/where/you/downloaded/the/tarball>/eyeos-2.2.0.0.tar.gz .
tar -zxvf eyeos-*

Start your browser, and navigate to http://127.0.0.1/eyeos. This will bring up the login page as shown in Figure 1.

The eyeOS index page

Figure 1: The eyeOS index page

However, since we haven’t yet configured eyeOS, navigate to http://127.0.0.1/eyeos/install. You should see something like what’s shown in Figure 2.

A clean start screen of the install wizard

Figure 2: A clean start screen of the install wizard

Click the “Install eyeOS 2 on my Server” link to proceed with the installation. This brings up the screen shown in Figure 3.

The system automatically checks for dependencies

Figure 3: The system automatically checks for dependencies

Every item on the checklist should be green or orange. If there are any red items (there shouldn’t be, since we just installed and configured AMP), then modify that parameter in php.ini, or install the required extension using Synaptic. The items in orange are optional. Scroll down the list; once all items are green/orange, click the large arrow to continue to the database configuration screen (shown in Figure 4).

Database configuration and root password setup

Figure 4: Database configuration and root password setup

At this screen, enter the database details. Enter root for the user name, and the corresponding password. If you want, you can create a new user called eyeos, using phpMyAdmin (you can navigate to phpMyAdmin at http://127.0.0.1/phpmyadmin). Enter localhost in the Host field, and eyeos in the Database field. Enter a root password for eyeOS. Click the arrow to continue. The system will configure itself, and voila! It’s ready to use. Remove the install directory from /var/www/eyeos.

Now, navigate to http://127.0.0.1/eyeos, and log in using root, and the password you assigned for root during eyeOS configuration. You will be greeted by the eyeOS desktop shown in Figure 5.

The eyeOS desktop

Figure 5: The eyeOS desktop

From here, you can create new users, administer the system, and perform maintenance tasks. Welcome to the world of cloud computing; you have just set up your very own cloud OS server! Have fun.

 

Ref:- Siddharth Mankad

Mobile Phones To Get Cheaper.

Saturday, March 17, 2012: Telecom users have some goods news coming from the Budget.

Finance minister Pranab Mukherjee, while presenting Union Budget in Lok Sabha on Friday, announced relaxation in custom duty on mobile phone parts.

With this, mobile phones will get cheaper in India. Mukherjee also proposed to exempt memory cards parts from basic excise duty.

The move is likely to provide boost for manufacturing of mobile phones in the country. Mobile Phones Telecom Industry Reacts To Budget “Exemption of mobile phone parts from basic custom duties will bring down the manufacturing cost of mobile phones.

It will also aid in deeper penetration of mobile phone manufacturers into the untapped portions of the Indian market,” Pradeep Jain, managing director, Karbonn Mobiles said. Sunil Dutt, managing director, Research In Motion (RIM) India, told Business Line, “The proposed full exemption on mobile phone parts may further make the smartphone affordable to larger section of the masses.

The increase in disposal income as a result of relaxed IT slabs will further enhance the penetration of smartphones.” The Government has also announced deduction of 200 per cent tax liability on expenditure made in research and development (R&D).

Welcoming the announcement, SN Rai, co-founder and director of Lava Mobile, said, “For telecom industry it is a good budget. The Government has provided benefits for companies like us to invest on a core of R&D because for manufacturing and R&D services there is an increase in deduction of income tax from 150 per cent to 200 per cent.”

Reference: Monika Bhati, EFYTIMES News Network

Ease Your Ubuntu Experience


So you have made the leap, and are flying away from Windows… welcome to Ubuntu! You must have performed a few common activities like using the Ubuntu Software Centre, installing media codecs and drivers for your graphics card, etc. So what’s next? This article offers tips on how to make your work on Ubuntu 10.10 Maverick Meerkat faster, and more convenient.


In this article, I have seven tips for you, which I have found very helpful in my daily usage of Ubuntu. Without much ado, let’s get right into them.

Install Synapse, a fast, light application launcher

Forgot, or don’t want to remember, what sub-menu your favourite application is in? Use an application launcher instead! A little window that appears on pressing a key combination, it lets you search for an “activity” and press Enter to launch it. If you’ve forgotten the name of the application, you can even enter a semantically-related term: for example, Web, Internet, or browser, for the Firefox browser; word or word processor for OpenOffice.org Writer; spreadsheet for… you get it!

The Synapse application launcher window

Figure 1: The Synapse application launcher window

App launchers abound, but I’ll suggest Synapse (see Figure 1). It’s light, fast, and easy to use, as well as a small download (less than 1 MB!). You’ll need to tell Ubuntu where to find Synapse, since it’s not available by default. In Ubuntu Software Centre, click Edit –> Software Sources. Enter your password when prompted, click Add and enter the following line: ppa:synapse-core/ppa.

Click Add Source. Back in Software Centre, click the Reload button. After reloading, search for, and install the synapse package. I recommend you also install zeitgeist, which gives Synapse the smarts to list commonly/recently used applications, thus tailoring the list to suit your daily usage.

Once both are installed, add Synapse to your GNOME Startup Applications, so it will start automatically when you log in. Go to the System menu –> Preferences –> Startup Applications. Click Add. In the Name entry, type Synapse app launcher or any short name you choose; in the Command entry, enter synapse. Click the Add button and you’re done.

From your next login onwards, you just hit Ctrl+Spacebar to activate Synapse.

Speed up OpenOffice.org

OpenOffice.org could be faster (couldn’t everything?). To reduce the time it takes to open, add the OpenOffice.org Quickstarter to Startup Applications, using the procedure explained above, but change the Name to OOo Quickstarter and the Command to ooffice -quickstart. From your next login onwards, when you launch an OpenOffice.org component, you’ll see that it opens faster than before — because it is preloaded when you’re logging in. This does consume some memory, and slows down your login a little, so depending on the amount of RAM on your system, and how fast a processor you have, you might want to undo this later — if so, just return to Startup Applications, select the entry you’d created, and click Remove.

Note: The OpenOffice.org Quickstarter leaves an icon in your panel. You can close the Quickstarter at any time by clicking the icon and choosing the Exit option. You especially need to do this if you’ve just installed a new plugin, and must restart OOo; exit both OOo and Quickstarter, then restart them, so your new plugin will work.

OpenOffice.org Quickstarter in your panel

Figure 2: OpenOffice.org Quickstarter in your panel

Additionally, if you have a lot of RAM on your system (modern computers come with 2 to 4 GB of RAM) then you can increase the memory reserved for OpenOffice.org, to a maximum of 256 MB. Visit Tools –> Options in any OOo component; select the Memory option on the left. Type in 128 or 256 in the Use for Openoffice.org entry. Click OK and see the difference in OOo’s performance.

Control your CPU speed with the scaling applet

To use a car analogy, your processor operates in various “gears”, depending on the workload of your system. You can manually put your processor into top gear, and your computer performs heavy tasks faster. To do this, right-click the top panel, and select Add to Panel. From the list of applets, select and add the CPU Frequency Scaling Monitor applet.

Right-click the applet and choose Preferences. Choose which processor or core (listed as CPU0 and CPU1 on a dual-core system, for example) you wish the applet to monitor. For multi-core/multi-processor systems, you should add one applet per core to the panel, and choose the relevant CPU in each applet’s Preferences.

Click to change your CPU frequency

Figure 3: Click to change your CPU frequency

You can change the processor/core speed by clicking the applet. You can choose Performance when doing “heavy” tasks like watching videos or copying big files. Geeky fun! However, this could consume more power, and heat up the processor (reducing battery life, and the overall life of your system). A good choice is Ondemand, which lets Linux auto-boost your CPU speed when it needs more processing power, and drop back to minimum speed afterwards — a good balance between performance and power-saving, extending the battery life and cool running.

Label your partitions

The Nautilus file manager labels partitions as “10 GB filesystem”, “150 GB filesystem” and so on, which can be perplexing. Give them sensible labels like “Backups”, “Movies”, whatever. From the main menu, head to System –> Administration –> Disk Utility. Select Hard Disk. Select the partition you’d like to label; check that the partition is unmounted first, then click Edit Filesystem Label (see Figure 4).

The Disk Utility window

Figure 4: The Disk Utility window

Enable useful Compiz effects

Ah, Compiz! Who doesn’t love Compiz for eye-candy? Now you’ll love it for its usefulness. First, install the Simple CompizConfig Settings Manager by searching for “simple ccsm” in the Software Centre. Launch Simple CCSM, and click the Effects tab. Enable the Expo and Scale effects. Now click the Desktop tab. If you don’t need the Ubuntu-default four desktops, reduce Desktop Columns to two; this will save memory. Now click the Edges tab. You’ll see the image of a computer screen. Click one of its red-coloured edges. A large pop-up menu will appear; select Scale: initiate window picker for all windows.

Now, when you move the mouse pointer to the chosen edge, your windows conveniently arrange themselves (see Figure 5). I use this as an alternative to Alt+Tab for switching between applications. Assign actions to other edges if you like! Your left edge could be the window picker and the right could be Expo, for instance. And oh — at any time, press Esc to return to the desktop!

Move pointer to left edge to arrange windows

Figure 5: Move pointer to left edge to arrange windows

Move window buttons from left to right

Why do Americans drive on the right? Why does Ubuntu put the close, minimise and maximise buttons on the left? Shift the buttons to the right if you like them the old way. Press Alt+F2 for the Run Application window, or better, use Synapse! Type gconf-editor as the command to run, and press Enter. Navigate to apps –> metacity –> general. Change the button_layout option to menu:minimize,maximize,close (no spaces between commas!) as seen in Figure 6. Hit Enter.

Use the configuration editor to relocate window buttons

Figure 6: Use the configuration editor to relocate window buttons

Enhance Nautilus with Nautilus scripts

You can install third-party scripts that add functionality to Nautilus’ right-click menu. First, head to gnome-look.org and navigate to the Nautilus scripts page. There, you have hundreds of scripts. I recommend that you at least get “Send to”, “Send link to Desktop”, “Backup” and any of the “Rename multiple files” scripts. There are also scripts that can convert multimedia files, download pictures from a camera, upload to Facebook, GMail or Flickr, burn a disc… and remember, each functionality is available by just right-clicking one or more files or folders. Beat that, Windows!

Extract the downloaded scripts, and copy them to your .gnome2/nautilus-scripts folder. Note that this is a hidden folder. Navigate to your home folder, and press Ctrl+H to make hidden folders visible (and the same key combination to hide them again when done). Navigate into .gnome2/nautilus-scripts and paste the copied scripts.

Home folder with hidden folders un-hidden

Figure 7: Home folder with hidden folders un-hidden

There are hundreds of possible tips and tweaks for your Ubuntu desktop. I have covered a few that will speed up your workflow. There are many websites that deal with customising your GNU/Linux desktop, both for utility and cosmetics. You’ll realise that your desktop is truly yours — an expression of individuality. That freedom is only available in the free-software world.

Ref: Suhit Kelkar.

Recover Deleted Files in Linux

Have you accidentally deleted an important file because you have the habit of using Shift+Del instead of only Del? Well, don’t panic. I had this very problem some time ago, and found some utilities that helped me recover the so-called “permanently deleted” files; so thought of sharing this useful discovery.


You must be wondering how we could recover a deleted file, because the very word “delete” implies “permanently gone”. However, when you delete a file (accidentally or intentionally), its contents are not removed from your hard disk; the blocks that the file occupied on the storage device (like a hard disk) still contain the data, until the blocks are overwritten with new data. Deleting a file by its name only removes the reference to the inode of the file, and not the inode itself. (For more information, refer to the Wikipedia article on inode.)

It is always recommended that you unmount a device immediately after you realise you’ve deleted important files, to prevent the data blocks of those files from being overwritten with other data. Thus, you should ideally shut down the system, and do the recovery process by booting from a Live CD/USB, and then searching the partition that contained the files (e.g., /dev/sda1). I am using the Ubuntu 10.04 32-bit desktop edition, and the information here is specific to that distro.

Note: Be sure that you have enough space to accommodate the deleted files; otherwise, you will face some crazy errors during the post-recovery boot-up process and login.

Scalpel

This is a filesystem-independent recovery tool for Linux and Mac OS, which you can also run on Windows by compiling it with MinGW. The latest version is 2.0. Install it in Ubuntu with sudo apt-get install scalpel.

Next is some text editing — the configuration file is /etc/scalpel/scalpel.conf. You will find that everything has been commented out — uncomment the specific file format that you want to recover. For example, if I want to recover a deleted zip file, I will uncomment the .zip file section in scalpel.conf, as shown in Figure 1.

Figure 1: Scalpel.config file

Figure 1: Scalpel.config file

Next, in a terminal, run:

sudo scalpel  [device/directory/file name] -o [output directory]

The output directory, in which you want to store recovered files, should be empty before running Scalpel; otherwise, you will get an error.

Foremost

Foremost is a console program to recover files based on their headers, footers, and internal data structures. This process is commonly referred to as data carving. Foremost can work on disk or partition image files, such as those generated by dd, Safeback, Encase, etc, or directly on a drive.

The headers and footers can be specified by a configuration file, or you can use command-line switches to specify built-in file types. Install in Ubuntu and its derivatives with the following command:

sudo apt-get install foremost

There are a lot of options available. For example, to search for a deleted JPEG file, use:

sudo foremost -t jpg -i /dev/sda1

The -t (“type”) option can be given as -t all to search for all file types. Multiple file types are comma-separated, like -t jpg, pdf. The (required) option -i is the base device/directory for the search. You can also specify an output directory with -o.

Photorec

This is the fastest utility of the three. It’s installed by the testdisk utility package. If you don’t want to mess with the command-line, this is the best utility for you. Just run photorecas the root user in a terminal, and you will see a nice ncurses-based UI as shown in Figure 2.

Select the device to search, and it will ask you for the partition table type. Select yours; in my case, it’s Intel. Next, you have to select the filesystem or partition of the device disk. Next, it prompts you to choose the file system, as shown in Figure 3. * indicates a mounted partition. Last, it will ask for an output folder in which to store recovered files. After making a selection, press y to proceed.

Note: The above utilities will not recover replaced files, because in the case of replacement you are replacing the inode itself, so it’s not possible to recover it.

Although there are utilities to recover deleted files, I recommend that prevention is always better than cure so don’t use Shift+Del or rm indiscriminately.

Ref: Ankur Aggarwal