Monday, January 28, 2013

Why I switched from Ubuntu to Fedora

Update:

I switched back to Ubuntu (13.04) during last week of August 2013 when a normal Fedora update (sudo yum update) made my system begin to freeze frequently and unexpectedly. I reinstalled Fedora 19 using Live USB stick, but as soon as I updated the system (sudo yum update), the freezing symptom started appearing again.

https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1001949

Original Post
After using Ubuntu for 1.5 years, I decided to switch to Fedora because of concerns about privacy and openness.

And of course, I wanted to recover my lost love, Gnome-Shell.

(When Shuttleworth stepped down, Canonical could really hire someone as serious as Stallman.)


To replace spaces in file names with underscores _

for n in *; do mv -i "$n" `echo $n | tr ' ' '_'`; done

I want to play mp3 songs on Fedora 18

The following method gets the job done with least corruption:
Visit Fluendo plugin website and download MP3 plugin for free (click on "check out", no credit card needed).

Extract the file "libgstflump3dec.so" into ~/.gstreamer-0.10/plugins folder.

Execute the following command:

gst-launch-0.10 filesrc location=music.mp3 ! decodebin2 ! audioconvert ! flacenc ! filesink location=music.flac

This will create a file called music.flac for the input file music.mp3.

Now you can play the file music.flac using any existing audio/video software on Fedora.

Remark 1: The instructions above provide bare minimum support (only mp3). VLC media player on the other hand supports most of the common audio and video formats. Read more about using VLC media player on Fedora 18 without installing it.: http://useful-linux-tips.blogspot.in/2013/02/running-qtkde-applications-like-vlc.html

Search for files containing a specific word

Following command searches for the word "rose" in all files in Downloads folder:

grep -rinsI ~/Downloads "rose"

Quickly encrypt a file

Use gpg:

gpg -c file.txt #gpg encryption with symmetric keys

If gpg is not installed install gpg.

yum install gpg #Fedora
apt-get install gpg #Ubuntu

Unrelated Gossip:
It is due to privacy concerns that I'm not on FB. Even after making my friends' list private, one of my friends could see my hidden friend in "People you may know" suggestions and could see me as one of the "common friends" in a popup. I know FB is doing exactly what they clearly declare they are doing in their privacy policy. But this is also a fact that any kind of revelation of my one friend to another friend, whatsoever the case may be, is completely unacceptable to me. Anyway, I immediately deleted my account to prevent further revelation.

Find a file modified later than a given date and time

Following  command finds files in Downloads folder which were modified after noon of January 31, 2000:

find ~/Downloads -type f -newermt "2000-01-31 12:00:00.0"

Find a file in a folder

Following command finds PNG files in Downloads folder:

find ~/Downloads -iname "*.png" -type f -size +400k -printf "%s:%h/%f\n" #search a file

I want to extract contents of an RPM file

rpm2cpio FileName.rpm | cpio -midv

I do not want firefox to remember zoom setting for entire website/webdomain

Visit the page about:config
Change the setting browser.zoom.siteSpecific to false.

Smooth Font Rendering on Fedora 18

Add following lines to the file /etc/fonts/local.conf or the file ~/.fonts.conf

<?xml version='1.0'?>
  <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
  <fontconfig>
    <!-- See: man 5 fonts-conf -->
    <!-- Antialias rules -->
    <match target="font">

      <edit name="autohint" mode="assign"> <bool>true</bool> </edit>
   
      <!--Subpixel smoothing: rgb, bgr, vrgb, vbgr, none-->
      <edit mode="assign" name="rgba"><const>vrgb</const></edit>
     
      <!-- Use hint? true/false. Usually true-->
      <edit mode="assign" name="hinting"><bool>true</bool></edit>
     
      <!-- Hint: hintfull, hintmedium, hintslight, hintnone -->
      <edit mode="assign" name="hintstyle"><const>hintmedium</const></edit>
     
      <!-- By default, apply antialias to all, filter on the following lines -->
      <edit mode="assign" name="antialias"><bool>true</bool></edit>
    </match>
   
    <!-- If fonts are smaller than X, then don't antialias-->
    <match target="font">
      <test compare="less" name="size" qual="any">
        <int>6</int>
      </test>
      <edit mode="assign" name="antialias">
        <bool>false</bool>
      </edit>
    </match>
   
    <!-- If BOLD fonts are smaller than Y, then don't antialias-->
    <match target="font">
      <test compare="more_eq" name="weight" qual="any">
        <const>medium</const>
      </test>
      <test compare="less" name="size" qual="any">
        <int>6</int>
      </test>
      <edit mode="assign" name="antialias">
        <bool>false</bool>
      </edit>
    </match>
   
    <!-- Firefox fix (it uses pixelsize, instead of size) -->
    <match target="font">
      <test compare="less" name="pixelsize" qual="any">
        <int>10</int>
      </test>
      <edit name="antialias" mode="assign">
        <bool>false</bool>
      </edit>
    </match>

    <!-- Firefox fix BOLD (it uses pixelsize, instead of size) -->
    <match target="font">
      <test compare="more_eq" name="weight" qual="any">
        <const>medium</const>
      </test>
      <test compare="less" name="pixelsize" qual="any">
        <int>10</int>
      </test>
      <edit name="antialias" mode="assign">
        <bool>false</bool>
      </edit>
    </match>
  </fontconfig>

Adjust system font on Fedora 18

Adjust system font on Fedora 18

Install custom fonts by copying *.ttf files to ~/.local/share/fonts folder.
Then execute following commands:
 
gsettings set org.gnome.desktop.interface text-scaling-factor '1.7'

gsettings set org.gnome.desktop.wm.preferences titlebar-font 'Arial Narrow Bold 11'

gsettings set org.gnome.desktop.interface font-name 'Arial Narrow 11'

Introduction

Through this blog I hope to facilitate and promote using Linux for everyday computing.

This is a living blog. Each post is subject to changes as the universe evolves. Feel free to come back if some technique breaks down in future versions.