Blog Archives

Using Vim to generate HTML output of code


This is an interesting bit that I learnt about from an email in a mailing list by James Pryor.

To generate html output for code within a shell script you can use:

vim myscript.sh '+syntax on' '+ set nu' '+set background=light' +TOhtml '+w myscript.html' '+qall!'
If you don’t want numbers and need a dark background you can use:
vim myscript.sh '+syntax on' '+ set nonu' '+set background=dark' +TOhtml '+w myscript.html' '+qall!'

Installing EditorConfig on Sublime Text


To install Editor Config on Sublime Text all you need to do is to follow the following steps:-
  1. Go the Preferences tab -> Package Control.
  2. Select Install Package from the drop down menu.
  3. Wait for the list to load, once it loads it will show you a list of packages.
  4. Now, type in EditorConfig and select the highlighted option.

To confirm that Editor Config is installed correctly on your Sublime Text instance you can go to Preferences -> Browse Packages. If installed correctly you should be able to see an EditorConfig directory present in the Packages directory.

That’s it! Enjoy! 🙂

Installing Sublime Text 3 on RHEL / Fedora


Here’s another three step guide to installing Sublime Text 3 on RHEL 6,7 / Fedora 18, 19, 20:-

  1. Download the installation script from the following gist.
    https://gist.github.com/sayak-sarkar/11b039f398ddcae88139
  2. Extract it to your home directory [or anywhere you like].
    $tar -xvf gist11b039f398ddcae88139-e339084ef22e956ea6ef8d04f8279ca70772f534.tar.gz
  3. Open your terminal (preferably as super user), navigate to your home directory and execute the shell script.
     #./sublime-text-3.sh

Voila!! You now have Sublime Text 3 installed on your machine. You may run it from the terminal or via the alt+f2 shortcut by simply typing in “sublime”.

Based upon my previous post on How to install Sublime Text 3 on Fedora. 😉

Enjoy!! 🙂

Installing Firefox Nightly with Australis on Fedora 18 / 19 / 20


Australis Sceenshot

Screenshot of Firefox Nightly with Australis on Fedora 19

Are you a Fedora user who wants to check out the new Australis Theme for Firefox scheduled for release with Firefox 28? However, you are a bit apprehensive of letting go that stable release of Firefox in bundled within your Fedora installation by default, just in case something goes wrong with the nightly beta release.

If this is what defines your current dilemma, fear not. You can have both the stable as well as the nightly beta versions installed simultaneously in your computer in a few simple steps without any trouble at all! Here’s how to do it in case of Firefox Nightly version 28 [the latest release at the time of writing this post]:-

Step 1: Login as Super User:-

$su

Step 2: Get the nightly package:-

Go to http://nightly.mozilla.org to get the latest available nightly build for your system.

Screenshot of Firefox Nightly Webpage

Firefox Nightly Webpage

Alternatively, you can use the command line tool wget to directly download it via the command line as follows:-

#wget http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-28.0a1.en-US.linux-x86_64.tar.bz2

Step 3: Extract the contents of the tar ball as follows:-

#tar -xvf firefox-28.0a1.en-US.linux-x86_64.tar.bz2

Step 4: Rename the extracted directory to “nightly”:-

#mv firefox nightly

Step 4: Create an installation directory:-

#mkdir /opt/firefox

Step 5: Move the contents of the “nightly” directory to the installation directory:-

#mv /nightly /opt/firefox/nightly

Step 6: Create a Symbolic link for the Nightly installation:-

#ln -s /opt/firefox/nightly/firefox /usr/local/bin/nightly

Step 7:Run Firefox Nightly by typing the following within the command line or the alt+f2 launcher:-

For command line: $nightly

For alt+f2: nightly

Step 8: Relax and enjoy the Australis awesomeness! 🙂

Installing Skype on Fedora 18 / 19 / 20


Here’s a list of command line steps to install Skype on Fedora 19:-

Step 1: Open up the terminal and switch to super user:

$su –

Step 2: Install the dependencies:

yum install alsa-lib.i686 fontconfig.i686 freetype.i686 glib2.i686 libSM.i686 libXScrnSaver.i686 libXi.i686 libXrandr.i686 libXrender.i686 libXv.i686 libstdc++.i686 pulseaudio-libs.i686 qt.i686 qt-x11.i686 qtwebkit.i686 zlib.i686

Step 3: Download Skype 4.2 Dynamic package for Fedora into /tmp:

cd /tmp
wget –trust-server-names http://www.skype.com/go/getskype-linux-dynamic

Step 4: Extract the Skype 4.2 package to /opt:

mkdir /opt/skype
tar xvf skype-4.2* -C /opt/skype –strip-components=1

Step 5: Create Launcher, Link icons, language and sounds:

ln -s /opt/skype/skype.desktop /usr/share/applications/skype.desktop
ln -s /opt/skype/icons/SkypeBlue_48x48.png /usr/share/icons/skype.png
ln -s /opt/skype/icons/SkypeBlue_48x48.png /usr/share/pixmaps/skype.png

touch /usr/bin/skype
chmod 755 /usr/bin/skype

Open /usr/bin/skype with text editor and add following content:

#!/bin/sh
export SKYPE_HOME=”/opt/skype”

$SKYPE_HOME/skype –resources=$SKYPE_HOME $*

Step 6: Congratulate yourself! You have successfully installed a non-free proprietary software on top of free Open Source software and bent down to corporate needs. Now go ahead and configure Skype according to your needs!

Sigh! :-/

Installing VLC player on Fedora 18 / 19 / 20


Here’s a simple three step guide to installing VLC media player on Fedora 19 [Schrodinger’s Cat]:-

  1. Login as Super User:
    • $su
  2. Setup rpmfusion:
  3. Install vlc using the default yum package manager:
    • #yum install vlc mozilla-vlc

Voila! You now have VLC media player installed on you computer! 🙂

Installing Steam for Linux Beta | Counter Strike for Fedora 17 / 18 / 19 / 20


Here’s the link to a really interesting article by Russel Bryant that I found on the web. Especially helpful for all my geeky gamer friends who keep on complaining about how they are not able to play Counter Strike or Team Fortress 2 on their Linux based systems. Enjoy!

If however you are a counter strike freak and this link doesn’t completely satiate your needs, you may try referring to this blog for Chris Daniel’s take on installing Counter Strike on Fedora 18.

Debugging NO KEY warning during “yum install vlc”


This is a problem that I encountered today while tryiing to install VLC media player on my brand new Fedora 18 installation.

Right after the dependency resolutions are complete, yum returns the following warning:-

Transaction Summary
===============================================
Install 1 Package (+45 Dependent packages)

Total size: 37 M
Installed size: 118 M
Is this ok [y/N]: y
Downloading Packages:
warning: /var/cache/yum/i386/18/rpmfusion-free/packages/live555-0-0.38.2012.10.18.fc18.i686.rpm: Header V3 RSA/SHA256 Signature, key ID 982e0a7c: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-18-i386

GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-18-i386

Did a bit of snooping around over the internet and found the missing rpmfusion keys at: http://rpmfusion.org/keys and derived the following solution:-

Step by step solution to the problem [root login used]:-

  • I have already compiled the key into a single .gz file, which can be downloaded from this link: http://goo.gl/bKoyb
  • Place the .gz file in the directory: /etc/pki/rpm-gpg/
  • #cd /etc/pki/rpm-gpg/
  • #tar -xvzf RPM-GPG-KEY-rpmfusion.tar.gz
  • rm RPM-GPG-KEY-rpmfusion.tar.gz
  • #yum install vlc
  • You should get this output after dependency resolution is complete:

    Transaction Summary
    ===============================================
    Install 1 Package (+45 Dependent packages)

    Total size: 37 M
    Installed size: 118 M
    Is this ok [y/N]: y
    Downloading Packages:
    warning: /var/cache/yum/i386/18/rpmfusion-free/packages/live555-0-0.38.2012.10.18.fc18.i686.rpm: Header V3 RSA/SHA256 Signature, key ID 982e0a7c: NOKEY
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-18-i386
    Importing GPG key 0x982E0A7C:
    Userid : “RPM Fusion free repository for Fedora (18) <rpmfusion-buildsys@lists.rpmfusion.org>”
    Fingerprint: c63d a8f3 375c 7182 3e3a 2d42 3633 9914 982e 0a7c
    From : /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-18-i386
    Is this ok [y/N]:

  • Enter ‘y’ (without the quotes!)

Voila! VLC’s installed!

NOTE:It is highly recommended to do a ‘yum update’ after the installation procedure is complete, as it helps ensuring that the new rpm keys are standards-compliant!

%d bloggers like this: