Category / Linux

It is quite annoying to develop and test an app which is likely to receive data/notification from a third party site if your development computer isn’t globally reachable. You have to deploy to a server and test it and do this each time until it completely works. Examples of such cases include:

Facebook app development

PayPal or any other payment gateway integration

While there are probably several options, SSH Tunneling is the simplest, at least to me. It needs less than 2 minutes to configure. Let’s do it.

I’m assuming:

You’ve a dedicated server/VPS with root access or somehow access to sshd_config file (we’re going to call this remote server)

Your domain is dev.awesomeapp.com and which points to the above server with IP 198.198.115.47

I am working on a project that can’t be tested locally. So, I need to upload files to server. However, committing and then uploading is rigorous job (as there are lots of files to upload as a directory while changes were made only a few files under different directory. so browsing directory and uploading specific file(s) also annoying.) ! That’s why I used ‘svn up’ command to update all changed files from svn repository.

Wow new Ubuntu, as said on the site perfect Ubuntu 10.10 (Maverick Meerkat) is now out :D. I could not resist myself from upgrading to it even I am using Ubuntu Lucid Lynx on Macbook Pro 7.1. I am upgrading specially to know whether it also works fine on Macbook.

Upgrading Ubuntu is always easy and fun. All you know that. However, if there are someone who does not know it, here it is. Just run the following command from terminal when you are online:

sudo update-manager -d

Then it should automatically detect that a new version is available. Just click on Upgrade button (show on the image above) when it appears. Follow instructions on screen and then sit relax while it is upgrading for you. However, carefully notice the alert (before main phase starts) it provides which includes the packages are going not to be supported anymore, packages that are going to be deleted etc.

Enjoy and pray for me so that it works fine on Macbook :P. I will write detail experience with it later.

Well, since buying the Macbook Pro, I was trying to install my most favorite operating system (Ubuntu/LinuxMint). I have failed with LinuxMint and other Ubuntu. However, this manual helped meto get Ubuntu Lucid Lynx installed on my Macbook Pro.

Before installation, I run Ubuntu live. After I’ve confirmed that basic things are working, I have started installation process. The installation was seamless though I was worried about the boot loader. Because I already have rEFIt installed. So, I was not sure if grub will overwrite it or not but it didn’t!. However, I am still wondering, as grub is loaded after I select Linux from rEFIt, will it work if I remove rEFIt? The grub is showing both Ubuntu and Mac Os. Continue reading →

Yesterday I have downloaded two fantastic songs from Youtube. Later, I wanted to move them to my mobile as MP3. As the downloaded vidoes are in FLV format, I would need to convert them to MP3. I thought, no problem, I have ffmpeg install in my LinuxMint :).

Today, while working with a project to import thousands of articles from text files to wordpress, I had faced a trouble while I am executing a shell script to iterate through all text files and call a PHP script with sending the filename as argument. The PHP script would then process the file as our requirement. The shell script looked like:

Here, $i would be the filename and it is passed to PHP script for processing. But the problem is that, when the filename (including directory name) consists any whitespace in its name, the script would broken. For example, some files path looked like
/home/user/articles/Internet Business/Web Hosting/how_to_start_your_company.txt

Here, notice the space after Internet and Web. The shell script was breaking just after Internet. It was sending /home/user/articles/Internet as argument to PHP script and obviously PHP script was failed to find this file.

If none of your files or folders have spaces in their names, then this isn’t a problem, but that is increasingly unlikely nowadays. If your songs do have spaces in their filenames, then the solution is to change how the shell splits that output. This is controlled by the variable $IFS, which is set to spaces, tabs, and newlines by default. We’d like it set to just newlines, so we do:

So, here is the solution. I just put the following line at the top of my shell script.

export IFS=$'\n'

After that everything is fine. The script is running exactly how I intended it to run.

AES Crypt is a simple tool to encrypt end decrypt your files. You can do it without being expert in either linux and/or cryptography. If you are simply familiar with linux shell, you have more than enough knowledge to use AES Crypt.

AES Crypt is a file encryption software product available on several operating systems that uses the industry standard Advanced Encryption Standard (AES) to easily and securely encrypt files.

However, you might have needed root privilege if AES Crypt is not installed in your computer and you want to install it. The installation is also as easy as pie. Just look below: