Generate QR Code in Ubuntu Linux

You can easily generate QR Code under Ubuntu using the command line ‘qrencode’ package. In Ubuntu 11.04 Natty Narwhal, you can install qrencode using this command:

apt-get install qrencode

To generate QR Code image, you only need to run this command:
qrencode -l L -v 1 -o qrcode-test.png "Hello, World!"

QR Code is a form of 2 dimensional barcode which can store arbitary text data including URL, email or plain text. For more information, please refer to the QR Code Wikipedia Entry

Easy File Encryption On Ubuntu Linux with OpenSSL

Here’s an easy way to encrypt your file using OpenSSL. The general syntax is:


openssl enc (cipher) -e -in (input file) -out (output file)

so to encrypt a “plaintext.txt” file, using aes256, you only need to run this command:

openssl enc aes256 -e -in plaintext.txt -out encrypted.txt

Similarly, to decrypt the file, you can run the command:

openssl enc aes256 -d -in encrypted.txt -out decrypted.txt

Debian: Force users to use more secure login password with pam_cracklib

One of the factor that makes your system easily crackable is the weak password. PAM cracklib forces users to choose stronger password by analyzing the password strength, length and entropy.

To enable pam_cracklib in Debian / Ubuntu operating system, you need to install libpam_cracklib:

sudo apt-get install libpam_cracklib

Then edit the “/etc/pam.d/common-password” file using your favorite editor. Then, add and uncomment the following line at the end of the file.

password required pam_cracklib.so retry=3 minlen=6 difok=3

difok determines the number of same characters that allowed to be present in the old and new passwords.

Quick Way to upgrade to Ubuntu 10.10 Maverick Meerkat

Ubuntu 10.10 Maverick Meerkat release is just around the corner!

Here’s how to upgrade Ubuntu 10.10 Maverick Meerkat using bash shell

sudo sed -i 's/lucid/maverick/g' /etc/apt/sources.list && sudo aptitude update && sudo aptitude dist-upgrade

sudo aptitude install update-manager-core
sudo do-release-upgrade -d

That’s it! Happy upgrading!

3 ways to get Linux release information from bash terminal

Let’s say you’ve manage to get yourself into a GNU/Linux bash terminal. What can you do in order to determine its distro and release information? Listed here are the three methods to get release information of a running GNU/Linux box.

lsb_release method
You can type “lsb_release -a”

Cat /etc/proc/release method

/etc/*release and /etc/*issue method
Alternatively, you could try typing “cat /etc/*release” or “cat /etc/*issue”.

Cat /etc/proc/release method

/proc/version method
If else fails, you could always try the “cat /proc/version” method to see where the kernel came from.

Cat /etc/proc/release method

Hope this would help!

vrms – check your Ubuntu for Non-free packages (Virtual Richard M Stallman)

vrms is an application that checks for non-free packages or components installed in your Debian-based system (including Ubuntu) and subsequently display a statistic of how many percentage of your system is non-free.

vrms can be installed using Synaptic Package Manager :

VRMS - Virtual Richard Stallman

To execute it, just type “vrms” in the terminal, here’s an example of vrms output for my system :
[javascript]
mypapit@mypapit-desktop:~$ vrms
Non-free packages installed on mypapit-desktop

bsdgames-nonfree rogue, the classic dungeon exploration game
Reason: No commercial use
fglrx-modaliases Identifiers supported by the ATI graphics driver
latex2html LaTeX to HTML translator
linux-generic Complete Generic Linux kernel
linux-restricted-modules- Non-free Linux 2.6.28 modules helper script
linux-restricted-modules- Restricted Linux modules for generic kernels
nvidia-173-modaliases Modaliases for the NVIDIA binary X.Org driver
nvidia-180-modaliases Modaliases for the NVIDIA binary X.Org driver
nvidia-71-modaliases Modaliases for the NVIDIA binary X.Org driver
nvidia-96-modaliases Modaliases for the NVIDIA binary X.Org driver
rar Archiver for .rar files
sun-java6-bin Sun Java(TM) Runtime Environment (JRE) 6 (architecture
sun-java6-demo Sun Java(TM) Development Kit (JDK) 6 demos and example
sun-java6-jdk Sun Java(TM) Development Kit (JDK) 6
sun-java6-jre Sun Java(TM) Runtime Environment (JRE) 6 (architecture
sun-java6-plugin The Java(TM) Plug-in, Java SE 6
tangerine-icon-theme Tangerine Icon theme

Contrib packages installed on mypapit-desktop

jetty Java servlet engine and webserver
nvidia-common Find obsolete NVIDIA drivers
openttd reimplementation of Transport Tycoon Deluxe with enhan

17 non-free packages, 1.1% of 1601 installed packages.
3 contrib packages, 0.2% of 1601 installed packages.
[/javascript]

So if you prefer a completely free (as in freedom!) operating system, you can use install gNewsense instead of Ubuntu.