Slightly Modified Solarized Color Scheme for urxvt

I like urxvt for it’s lightweight and Unicode support. And I like the Solarized color scheme for terminal emulators.

Solarized color scheme looks awesome! It has two gorgeous color scheme: solarized dark and light. I use the former at night and the later while working in day time.

I find the directory highlighter color to be disturbing in the default solarized color scheme. Everything else is all right. So I modified the directory highlighter and got my most favorite terminal color schemes.

Solarized Dark

[code lang=”text”]
Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight

URxvt.depth: 32
URxvt.geometry: 80×24
URxvt.transparent: false
URxvt.fading: 0
! URxvt.urgentOnBell: true
! URxvt.visualBell: true
URxvt.loginShell: true
URxvt.saveLines: 50
URxvt.internalBorder: 3
URxvt.lineSpace: 0

! Fonts
URxvt.allow_bold: false
/* URxvt.font: -*-terminus-medium-r-normal-*-12-120-72-72-c-60-iso8859-1 */
URxvt*font: xft:Hack:pixelsize=12
URxvt*boldFont: xft:Hack:pixelsize=12

! Fix font space
URxvt*letterSpace: -1

! Scrollbar
URxvt.scrollStyle: rxvt
URxvt.scrollBar: false

! Perl extensions
URxvt.perl-ext-common: default,matcher
URxvt.matcher.button: 1
URxvt.urlLauncher: firefox

! Cursor
URxvt.cursorBlink: true
URxvt.cursorColor: #657b83
URxvt.cursorUnderline: false

! Pointer
URxvt.pointerBlank: true

! special
*.foreground: #93a1a1
*.background: #002b36
*.cursorColor: #93a1a1

! black
*.color0: #002b36
*.color8: #657b83

! red
*.color1: #dc322f
*.color9: #dc322f

! green
*.color2: #002b36
*.color10: #859900

! yellow
*.color3: #b58900
*.color11: #b58900

! blue
*.color4: #268bd2
*.color12: #268bd2

! magenta
*.color5: #6c71c4
*.color13: #6c71c4

! cyan
*.color6: #2aa198
*.color14: #2aa198

! white
*.color7: #93a1a1
*.color15: #fdf6e3

[/code]

Solarized Light

[code lang=”text”]
Xft.dpi:                    96
Xft.antialias:              true
Xft.rgba:                   rgb
Xft.hinting:                true
Xft.hintstyle:              hintslight

URxvt.depth:                32
URxvt.geometry:             80×24
URxvt.transparent:          false
URxvt.fading:               0
! URxvt.urgentOnBell:         true
! URxvt.visualBell:           true
URxvt.loginShell:           true
URxvt.saveLines:            50
URxvt.internalBorder:       3
URxvt.lineSpace:            0

! Fonts
URxvt.allow_bold:           false
/* URxvt.font:                 -*-terminus-medium-r-normal-*-12-120-72-72-c-60-iso8859-1 */
URxvt*font: xft:Hack:pixelsize=12
URxvt*boldFont: xft:Hack:pixelsize=12

! Fix font space
URxvt*letterSpace: -1

! Scrollbar
URxvt.scrollStyle:          rxvt
URxvt.scrollBar:            false

! Perl extensions
URxvt.perl-ext-common:      default,matcher
URxvt.matcher.button:       1
URxvt.urlLauncher:          firefox

! Cursor
URxvt.cursorBlink:          true
URxvt.cursorColor:          #657b83
URxvt.cursorUnderline:      false

! Pointer
URxvt.pointerBlank:         true
urxvt*scollbar: false
urxvt*internalborder: 6

*.foreground:   #586e75
*.background:   #fdf6e3
*.cursorColor:  #586e75

*.color0:       #002b36
*.color1:       #dc322f
*.color2:       #fdf6e3
*.color3:       #b58900
*.color4:       #268bd2
*.color5:       #6c71c4
*.color6:       #2aa198
*.color7:       #93a1a1

*.color8:       #657b83
*.color9:       #dc322f
*.color10:      #859900
*.color11:      #b58900
*.color12:      #268bd2
*.color13:      #6c71c4
*.color14:      #2aa198
*.color15:      #fdf6e3

! Note: colors beyond 15 might not be loaded (e.g., xterm, urxvt),
! use 'shell' template to set these if necessary
*.color16:      #cb4b16
*.color17:      #d33682
*.color18:      #073642
*.color19:      #586e75
*.color20:      #839496
*.color21:      #eee8d5

[/code]

You can use any of these color schemes for urxvt terminal emulator. Just replace your Xdefaults color scheme with any of these and voilà!

 

Learned Markdown Syntax and It’s Awesome

I just learned Markdown syntax. It’s just what I needed!

Markdown was initially intended to easy conversion of plain text into HTML. And now it’s developers and programmers favorite syntax.

I love plain text. Plain text is great for storing data and it’s here for good. The specialty of plain text is: it’s universal. Plain text is not going to die away anytime soon. One problem I faced using plain text is, while opening in Windows platform, the Unix-formatted plain text acted differently. Though there’s way out to convert Unix-styled text to Windows or Max-styled text format. But why do that when you have Markdown syntax?

Markdown is available and is supported in all platforms. But as of its’ origin, Markdown is native to the web. It’s great for web publishing and storing data. It uses only a few punctuation marks as special characters, and voilà! Your plain text is formatted in rich format.

Markdown syntax is human-readable. Anyone can read any markdown formatted text with ease. Markdown is simple and easy. Learning Markdown syntax takes only a couple of minutes and a few hours of practice. And you can use it for all your textual needs.

Markdown is great for programming environments. Even books are being written in Markdown syntax for its’ ease of use and straightforwardness. Markdown also supports scripting. You can use your normal text editor or any specialized Markdown supported editor for Markdown purposes. Markdown is nowadays very popular amongst developers and coders. You will find it everywhere and won’t regret learning or using it.

The original Markdown is there with detailed descriptions. GitHub and Stackoverflow have their own flavored Markdown. Choose what suits you best. I stick with the traditional Markdown.

What do you do with Markdown?

Using Microsoft’s Times, Arial, Courier Fonts in Debian

You may want to use some industry standard fonts e.g. Times, Arial, Courier in Debian. These fonts are from Microsoft and understandably, proprietary in nature.  You can use these fonts from Microsoft installing the ttf-mscorefonts-installer package in Debian. Remember that, you need to add contrib section in your sources file.

apt-get install ttf-mscorefonts-installer

This would do the job. Better yet, you can use fonts-liberation package that supplies fonts with same metrics as Times, Arial and Courier. Liberation fonts are free, contrary to proprietary nature of MS fonts.

For more info, visit Debian Fonts Wiki

Resizing Images Using ImageMagick

The other day I was applying for a job through their website, where I had to provide my photo in a predefined resolution. Indeed they wanted my photo to be in 600×600 pixels. I had to resize my photo before uploading it to that site. I used ImageMagick, a great image suite.

I installed ImageMagick in Debian using:

apt-get install imagemagick

Resizing images using ImageMagick is easy and self-explanatory. I used the following format:

convert image.jpg -resize 600x600 resized_image.jpg

This way, image file named image.jpg was resized to resized_image.jpg in 600×600 pixels.

But this process has a problem. The aforementioned command format preserves the aspect ration of the image. To fully resize any image in a specific ratio, the following command is used instead:

convert image.jpg -resize 600x600! resized_image.jpg

This command format forces the image to resize in the intended ration ignoring any aspect ration.

Images can also be resized to scale in any particular amount specified. To put it simply, images can be resized in their percentage scale. The command format is:

convert image.jpg -resize 50% resized_image.jpg

Here, any percentage ratio of the image can be used instead of 50%.

Images can also be resized in their pixel area count. For example, 600×600 sized image has a pixel area count of 360000. This is useful to make a collection of images almost same size. The command format is:

convert image.jpg -resize 360000@ resized_image.jpg

Of course, 360000 can be replaced with any other pixel area count. Just make sure @ is there after the pixel area count for this command. That’s all.

Merging Multiple VOB Files Into a Single VOB File Using Command Line Tool in Linux

Often DVDs come with two notable directories: AUDIO_TS and VIDEO_TS. Usually VIDEO_TS is used for watching the video files contained in that DVD. These videos are formatted in VOB files, in almost all cases. Sometimes it’s better to convert these VOB files into a more usual video format, like mp4, avi, etc. You have to merge the VOB files into a single VOB file in the first step. And you can combine the VOB files into one using the Unix tool cat. cat is a simple and yet powerful tool for catenation of multiple files into one.

Open terminal in the VIDEO_TS directory (of course you can open terminal in another directory and still specify the input files path in the command; Unix is that flexible!) and execute the following command in it:

cat *.VOB > ./give_any_name.VOB

This would combine all VOB files into a single VOB file in that directory. Of course, you can specify another directory for output file, and give any name to the output file.

Here, * (asterisk) character acts as a wild card denoting all the files ending with VOB. And ./ denotes the present working directory.

Missing Libraries While Compiling DWM in Debian 8 Jessie

While compiling dwm – dynamic window manager in Debian 8 “jessie”, I got the following error:

dwm.c:33:28: fatal error: X11/cursorfont.h: No such file or directory
compilation terminated.
make: *** [dwm.o] Error 1

and

dwm.c:40:37: fatal error: X11/extensions/Xinerama.h: No such file or directory
compilation terminated.
make: *** [dwm.o] Error 1

The catch here is libx11-dev and libxinerama-dev packages are needed to compile dwm and that’s the workaround for the error messages. Therefore installing these packages using the following command fixed the issue:

apt-get install libx11-dev libxinerama-dev

Instaling Fonts in Debian Without Any GUI Tool

One-click-fonts-install GUI utility for installing fonts like gnome-font-viewer are available in Debian. But installing fonts without using any GUI tool is much for straightforward and fun. You just need to copy the fonts in a specific directory in which Debian would search for fonts to use. That’s all.

Debian searches for fonts in some specified directories. The directories are specified in /etc/fonts/fonts.conf file. You can open this file in your system to see which directories holds the fonts. Usually, /usr/share/fonts, /usr/X11R6/lib/X11/fonts, /usr/local/share/fonts, etc. directories hold fonts which are available system wide. Better yet, use ~/.fonts directory that would make the fonts available only for your account or userid. Understandably this .fonts directory resides in your home directory, the path being ~/.fonts, or /home/your_userid/.fonts. Therefore, copy the fonts you would use in this directory to make them available for your user account or userid.

Say, a directory named font_collections holds your desired fonts. Open terminal from this directory and execute the following command to copy all the fonts from this directory to .fonts directory in your home folder:

cp * ~/.fonts

The * (asterisk) character used here acts as an wild card; meaning it denotes every file in the specified directory. Assuming your font_collections directory holds only fonts, the above command would copy all of them in  ~/.fonts.

If your font_collections directory holds fonts and other files, then you can mention every fonts file by their extension and copy only them with the following command:

cp *.ttf ~/.fonts

Assuming your fonts are in ttf (True Type Font) format.

You can also copy the fonts without being in the directory that holds the font. Just use the following command format:

cp /path/to/the/directory/that/holds/fonts/* ~/.fonts

That would do the job of copying fonts. Now, you have to re-generate fonts cache file to make your system aware of the updated ~/.fonts directory. Open terminal and execute the following command:

fc-cache -fv

This would make the fonts available for you. Open any text/word processing application, and see the fonts appear in that application, and use them, of course!

Setting Wallpaper Using Feh in Openbox

feh is a fast, yet powerful command line image viewer. It’s a swiss-army-knife for images, and fits perfectly for setting wallpaper in openbox window manager. You can choose it to set wallpaper in openbox, instead of those GUI-based tools and get the job done with ease.

To set a wallpaper using feh, open the terminal emulator and execute the command in the following format:

feh --bg-scale /path/to/the/image/file

Wallpaper can be set in any scaling options: tile, center, fill, max or scale. Replace scale in the above command with any scaling option you like.

Mention the path of the image file replacing /path/to/the/image/file in the above command.

Once you’ve set wallpaper using feh, it creates a .fehbg file in your home directory. The path is understandably ~/.fehbg.

To have the wallpaper there that you’ve set using feh every time you login, or when you begin a new session, add the following line in your ~/.config/openbox/autostart script:

sh ~/.fehbg &

This would make your wallpaper appear evey time you start a new session.

How to Format a USB Drive With FAT32 File System in Debian or It’s Derivatives

It’s not like FAT32 is superior to EXT4 or something. But the thing is, you cannot easily use EXT4 file system in Windows. That’s why, when you have to work cross-operating system, you would better go with FAT32; at least for now. Maybe EXT4 or later version would be the de facto file system in future for both world.

However, to format a USB device in FAT32 file system format, insert the USB drive, open terminal window and execute the following command:

lsblk

This would show you all the block devices for your system. Find your USB device from the list, based on either the name or size, or both. Find it anyway. In my case, my USB device was in /dev/sdc. So I executed the following command in terminal:

sudo mkfs.fat -F 32 -I /dev/sdc

This did the job for me. If your device is located in /dev/sdXX, then execute the command accordingly.

For mkfs.fat to work, you need dosfstools to be installed in your system. dosfstools come pre-installed in Debian. If your Debian derivative distro doesn’t come with dosfstools pre-installed, which is unlikely, then execute the following command to install it first, and then execute the previous command to format your USB device.

sudo apt-get install dosfstools

No Sound in quodlibet in Debian 8 jessie Xfce

After a fresh installation of Debian 8 jessie Xfce edition everything was working just fine, except the sound in quodlibet player. Sound was working just fine in VLC player and others, but not in quodlibet. I just couldn’t hear anything while playing songs in quodlibet player. The solution was simple though. I installed gstreamer1.0-alsa package and the sound was working again.

Open the terminal and execute the following command:

sudo apt-get install gstreamer1.0-alsa

This would solve your sound problem in quodlibet player.