Crontab Code Generator

Written by BinnyVA on June 22, 2009 – 11:39 pm -

Time

JSL Crontab Generator is a GUI application that can be used to create new crontab entries easily. Its a Javascript application – so it will run from your browser – there is no download/install involved. This was created as a demo for my JSL Javascript Library.

crontab syntax

Each line in a crontab file is a job and follows a particular format as a series of fields, separated by spaces or tabs(see example below). Each field can have a single value or a series of values.

crontab Operators

There are multiple ways of specifying several date/time values in a field:

  • The comma(,) specifies a list of values, for example: “1,3,4,7,8”
  • The dash(-) specifies a range. Example: “1-6”, which is equivalent to “1,2,3,4,5,6”
  • The asterisk(*) operator specifies all possible values for a field. For example, an asterisk in the hour time field would be the same as ‘every hour’.

There is also an operator which some extended versions of cron support, the slash(/) operator, which can be used to skip a given number of values. For example, “*/3” in the hour time field is equivalent to “0,3,6,9,12,15,18,21”. So “*” specifies ‘every hour’ but the “*/3” means only those hours divisible by 3.

Example: the following will clear the Apache error log at one minute past midnight each day.

    01 00 * * * echo "" > /www/apache/logs/error_log

Fields

 .---------------- minute (0 - 59) 
 |  .------------- hour (0 - 23)
 |  |  .---------- day of month (1 - 31)
 |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ... 
 |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat 
 |  |  |  |  |
 *  *  *  *  *  <command to be executed>
 

For more information about the cron and crontab, run the command man cron and man crontab.

Javascript Crontab Code Generator

You can use this tool to generate the crontab commands easily. Just enter the command and the intervals it should be executed on – this tool will create a line in crontab syntax that will do the work for you. All you have to do is add the generated line to your crontab file. Once the result line is generated, run the command ‘crontab -e’ – this will open your crontab file in an editor. Just copy the generated line into this editor and save the file – you are done.

Apache Example

For example, lets say you want to clear the apache log file every day at midnight. The command to be executed is…

echo "" > /www/apache/logs/error_log

Enter that command into the command input field in the application. Next click on the ‘Choose’ radio button in the minute and set it to 0. Then select the ‘Choose’ option in Hour and set it to 12 Midnight. Live the rest as it it – we want the command to be executed every day. Now just click on the ‘Create Crontab Line’. The final crontab line will show up in the ‘Result crontab Line’ textarea.

JSL Crontab Generator


Tags: , , , , ,
Posted in Applications, Tools | 5 Comments »

Top 4 Terminal GUI Applications

Written by BinnyVA on June 19, 2009 – 1:19 am -

Terminal

Terminal GUI Apps? Does sound oxymoronic doesn’t it? Well, there are GUI apps in the terminal – and here is a tribute to ones that I find most useful…

top/htop – Process Viewer

From the man page…

The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. The types of system summary information shown and the types, order and size of information displayed for tasks are all user configurable and that configuration can be made persistent across restarts.

I always have a processor load displaying applet(System Monitor) in my panel. Whenever I see a spike, I fire up a console and type in the top command – its very useful in finding which process is creating the load. Usually, it is some cron job like updatedb or makewhatis. But occasionally, I find a zombie processes this way.

htop is, for the lack of a better word, a better top. It provides a more colorful display(top has a color mode as well – open top and press ‘z’). It also makes it a bit more easier to kill processes.

htop

mc – File Manager

mc(or Midnight Commander) is a file manager. Sure you can cp and mv your files around, but after a while, it gets tiring. mc is a dual pane file manager -it means you can see two folders at the same time. You can copy/move files from one to the other, delete, rename, view file etc – in short, everything a file manager is expected to have, mc has.

mc

mpg123 – Audio Player

I am not writing too much about this – considering the fact that I have already wrote a post about mpg123/mpg321 in the audio player series.

aptitude

aptitude is a ncurces based GUI for the apt package manage – as a result, this is only available in Debian based systems(Ubuntu, Knopix, etc.). I have not yet seen anyone using aptitude – if they have a GUI system, they use synaptic – and if they are comfortable with the command line, they use apt-get command. But still, there is a middle ground – if for some reason you need it.

aptitude

Thanks to Rajesh for the aptitude screenshot.

Anything Else?

Any other Terminal GUI application? I can only think of these at the moment. If you can think of others, comment.


Tags: , , , , , , , ,
Posted in Applications, Command Line, Reviews, Tools | 12 Comments »

Slow Scrolling in Firefox in Pages With Fixed Backgrounds

Written by BinnyVA on May 21, 2009 – 11:49 pm -

Firefox Logo

I have a unique problem with my firefox – and as far as I know I am the only one who has this issue. Firefox is very slow to scroll pages that has a fixed background image. Ajaxian is an example of such a site. This problem exists in all profiles of Firefox(not a extension issue) – but it works without any issue in other browsers – like Konqueror. Does anyone else have this issue?

This problem is only present in my desktop – a Fedora 8/KDE with Firefox 3.0.8 – with nVidia drivers installed. No issues on my laptop(Kubuntu). I still have no idea what’s causing this. But I did solve the issue.

Greasemonkey Script

I created a greasemonkey script that disables fixed background anywhere in the page. Changes all fixed background images to normal background image(scrolls with the page). Here is the script if anyone has the same issue.

Fixed Background Remover Greasemonkey User Script

Remember, this is a beta version – let me know if you find any issues with the script.


Tags: , , , , , , ,
Posted in Applications, Shell Scripts, Troubleshooting | 15 Comments »

XOSL Boot Loader: An Alternate for GRUB

Written by BinnyVA on January 15, 2009 – 10:49 pm -

If you have a dual boot system, most of you will be using GRUB as the boot loader – since its the default boot loader. A smaller number will be using LILO – an older software. I use neither – I choose XOSL – or eXtended Operating System Loader as my primary boot loader.

Just to be clear – I do use GRUB – as a secondary boot loader. XOSL is not capable of loading Linux kernel – all it can do is call a loader that is capable of doing that – and GRUB is capable of doing it. So you have to install two software instead of just one – but XOSL is worth it.

Features

  • Real GUI Interface
    • Mouse Interaction
    • Shortcuts
    • High resolution – more than 1024×768 supported
  • Timed default OS Loading
  • Easily Configurable
  • Flashy GUI Effects – I hate it – but I am sure the Compiz fans will love it
  • Built in Partition Manager

All this without loading an OS!

The advantage of installing this is you get a boot loader that looks better and is more easier to use than GRUB. All the configuration can be done in the bootloader itself – you don’t need to edit the files. Also you can assign shortcuts to each OS you have – so you can press, say, ‘w’ and boot into windows – rather than stopping the loader, selecting an OS from the menu and then loading it.

Another advantage is that XOSL is easier to install compared to GRUB. If you have to reinstall windows, that will remove GRUB. You might be able to install GRUB after that – but if you have gone through the process, you know its not an easy one. The process of installing XOSL is much easier. You would need a ‘Live’ DOS CD/DVD(Like FreeDOS). Just boot into it and run the installer in DOS mode.

Disadvantages

  • Installation requires a FAT32 partition(NTFS and Linux file systems not supported)
  • Development has stopped

That means your ‘C:’ drive should be FAT32 – not NTFS. Or, you need a separate dedicated FAT32 partition(with 1 or 2 MB space) for XOSL to work.

Screenshots

Here is how XOSL looks like…

More Screenshots…

Links


Tags: , , ,
Posted in Applications, Opinion, Reviews | 16 Comments »

WFTL Bytes

Written by BinnyVA on October 21, 2008 – 11:42 pm -

WFTL Bytes “your occasiodaily FOSS and Linux news show” is a video podcast by Marcel Gagné. Go see it – it is Good – Good with a capital ‘G’. WFTL Bytes does for Linux what Zero Punctuation does for gaming.

This is WFTL(pronounced ‘Wuftal’) has to say about itself…

This is WFTL Bytes!, your occasiodaily FOSS news show featuring the latest Linux and FOSS news with your host, Marcel Gagné. WFTL Bytes! is a fast, fun, occasionally a bit goofy, but always informative look at technology news and events as seen from a free and open source software perspective. This includes Linux and everything that that orbits it. Watch! Enjoy! Comment on the stories. I want to know what you think and what you’ve got to say, either about the show in general, the topics covered, of the stories themselves. Tell your friends, relatives, co-workers . . . tell everybody!

WFTL Bytes does for Linux what Zero Punctuation does for gaming

A Demo

Here is a couple of episodes to get a feel of the show…

That’s it folks, go subscribe to WFTL Bytes and check out Marcel’s latest press hat. Bye.

Seriously, I’m done. Bye.


Tags: , , ,
Posted in News, Opinion, Reviews, Video | 1 Comment »

Creating Custom Service Menus in Konqueror

Written by BinnyVA on October 7, 2008 – 12:23 am -

If you are using Konqueror and have not used custom service menus, you are missing out. Just like the Nautilus Scripts in Nautilus, Konqueror also has the ability to customize the context menus. This post will show you how to do it.

We are going to create two different kind of service menus – one will create an item in the action part of the right click menu. The next type will create a submenu in the ‘actions’ menu with multiple menu items. Hopefully, you will get an idea about how to do it by yourself.

Single Item Service Menu

This service menu will create a menu item in the Action section of the context menu for all ISO files. For this to work as intended, the mimetype for ISO file must be application/x-iso .

  • Open ~/.kde/share/apps/konqueror/servicemenus folder
  • Create a file with the name ‘PlayISO.desktop’ – the name can be anything – but the extension must be ‘.desktop’
  • Enter the following content…
[Desktop Entry]
ServiceTypes=application/x-iso
Actions=PlayISOInXine

[Desktop Action PlayISOInXine]
Name=Play ISO File in Xine
Icon=player_play
Exec=xine -pq --no-splash dvd:/%f

Now lets see a line by line explanation of the code.

[Desktop Entry]
Start the file with this line.
ServiceTypes=application/x-iso
This decides which all file types must this service menu be shown to. You can find the mimetype for various files by taking Control Center > KDE Components > File Associations. Then search for the extension in the given text field.
Actions=PlayISOInXine
Name of the action – this will be defined in the next line
[Desktop Action PlayISOInXine]
The definition of the ‘PlayISOInXine’ action goes here.
Name=Play ISO File in Xine
The text to be shown in the menu item.
Icon=player_play
The icon to be used in the menu. The icon can be an absolute path or the file name of an image in your current theme(for example, if you are using Crystal SVG theme, then the images you can use is in the folder ‘/usr/share/icons/crystalsvg/16×16/actions’).
Exec=xine -pq –no-splash dvd:/%f
The command to be executed when the menu item is clicked. The %f stands for the full name of the file. The other options are listed in the documentation.

This is the end result…

Submenu Service Menu

This sample will give you the option to convert the selected html file to a plain text file or a compressed archive. The code looks like this…

[Desktop Entry]
ServiceTypes=text/html
Actions=convertToText;convertToZip
X-KDE-Submenu=Convert

[Desktop Action convertToText]
Name=Convert To Text
Icon=txt
Exec=lynx -dump "%f" > "`dirname "%f"`/`basename "%f" ".html"`.txt"

[Desktop Action convertToZip]
Name=Compress as Zip
Icon=tar
Exec=zip "`dirname "%f"`/`basename "%f" ".html"`.zip" "%f"

Again, a line by line explanation…

[Desktop Entry]
You know.
ServiceTypes=text/html
This is only for HTML files – so we specify the mimetype as text/html
Actions=convertToText;convertToZip
We have two different actions instead of just one as in the last case. So we provide the name of both actions separated by a ‘;’.
X-KDE-Submenu=Convert
This will make sure its shown in a submenu – and that the name of the submenu is Convert.
[Desktop Action convertToText]
Defining the first action – convertToText
Name=Convert To Text
The label of the menu item
Icon=txt
And its icon
Exec=lynx -dump “%f” > “`dirname “%f”`/`basename “%f” “.html”`.txt”
This command will convert a html file to a text file and put the resulting file in the same folder as the html file.
[Desktop Action convertToZip]
Defining the next action – convertToZip
Name=Compress as Zip
Label
Icon=tar
And Icon
Exec=zip “`dirname “%f”`/`basename “%f” “.html”`.zip” “%f”
The command to compress the html file as a zip file.

If done correctly, it should look something like this…

Related Links


Tags: , , , , , ,
Posted in Applications, Configuration, KDE | 2 Comments »

SMPlayer – Linux Video Player

Written by BinnyVA on September 18, 2008 – 12:37 am -

I have used a lot of video players on Linux – and over the time my favorite video player have changed. When I wrote the post Top 5 Video Players in Linux, it was VLC. After that, the position was held by Xine for a long time. But that was before I discovered SMPlayer.

SMPlayer is a front-end for MPlayer, from basic features like playing videos, DVDs, and VCDs to more advanced features like support for MPlayer filters and more.

Features

Remembers the settings of all files you play
So you start to watch a movie but you have to leave… don’t worry, when you open that movie again it will resume at the same point you left it, and with the same settings: audio track, subtitles, volume…
Extremely Configurable
This is one feature I absolutely must have in a video player – I want to use very specific settings. And SMPlayer is one of the few players that lets me do that.
Configurable subtitles
You can choose font and size, and even colors for the subtitles. Or you can drag and drop a subtitle file into the player when you are playing a video – the video will use that subtitle file from then on. Or you can automatically get the subtitle of the currently playing film from OpenSubtitles with the click of a button(you need the latest version for this).
Audio track switching.
You can choose the audio track you want to listen. Works with avi and mkv. And of course with DVDs.
Seeking by mouse wheel.
You can use your mouse wheel to go forward or backward in the video.
Video equalizer
Allows you to adjust the brightness, contrast, hue, saturation and gamma of the video image. I have never used this feature – but it might come in handy for a bad quality video.
Multiple speed playback
You can play at 2X, 4X… and even in slow motion. SMPlayer speeds up the audio as well – which is kinda distracting – I wish they would mute it in fast mode.
Filters
Several filters are available: deinterlace, postprocessing, denoise… and even a karaoke filter (voice removal).
Audio and subtitles delay adjustment
Allows you to sync audio and subtitles.
Advanced options
Such as selecting a demuxer or video & audio codecs, providing mplayer command line options and more. Seriously, take a look at the Preferences dialog of this app.
Playlist
Allows you to enqueue several files to be played one after each other. Autorepeat and shuffle supported too.
Multiplatform
Binaries available for Windows and Linux.
Free Software
SMPlayer is under the GPL license.

Installing SMPlayer

In Fedora/Red Hat system, you can install SMPlayer using yum…

yum install smplayer

The package name is the same for Ubuntu/Debian systems…

apt-get install smplayer

Or you can download the app from their site and install it manually.

Related Links


Tags: , , , ,
Posted in Applications, Reviews, Video | 7 Comments »

Adding Support for almost All Video Formats/Codecs in Linux

Written by BinnyVA on September 13, 2008 – 12:25 am -

Multimedia

There is an over abundance of video formats right now – fortunately, our favorite OS, Linux, is capable of handling all of them. But some video formats are not supported ‘out-of-the-box’ – in such cases, we have to install the necessary codecs. This guide will show you how install the codecs for just about every video format under the sun.

Before going into the topic further, let me pacify the flamers in the audience. There are many codecs that include DRM and many are proprietary – and for this reason, many distros refuse to support them. But these can be supported using external software – whether or not to do that is a choice I leave to the readers. I am only handling the technical issue of installing the codecs here. The moral and ethical concerns have been handled by others better than me.

The Players – Video Trinity

There is no shortage of video players in linux. Among these, three players are more prominent than the others – these are Mplayer, Xine and VLC. I call them the Video Trinity. Before doing anything, install all three players. Yes, all of them.

Mplayer

Mplayer is perharps the most popular among linux video players. You can install it in a Red Hat/Fedora system using this command(the command for debian/ubuntu systems will be similar – can someone post it in the comments?)…

yum install mplayer mplayer-fonts mplayer-gui

If you are on a Debian based system – like Ubuntu, use this command…

apt-get install mplayer mplayer-fonts mplayer-skins

Xine

xine is a free multimedia player. It plays back CDs, DVDs, and VCDs. It also decodes multimedia files like AVI, MOV, WMV, and MP3 from local disk drives, and displays multimedia streamed over the Internet. It interprets many of the most common multimedia formats available – and some of the most uncommon formats, too. Installing xine is just as easy…

yum install xine xine-lib xine-skins xine-lib-extras-nonfree 

Again, on a Debian/Ubuntu system, use the command…

apt-get install xine-ui

VLC

VLC media player is a highly portable multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, …) as well as DVDs, VCDs, and various streaming protocols. VLC is popular in the windows crowd as well. Here is the command to install it…

yum install vlc

Debain/Ubuntu uses should use the command…

apt-get install vlc

With these 3 players installed, you must be able to open 90% of the video files out there. But for the more exotic video formats, we must install the extra codecs provided by mplayer. First install the codes available in your distro’s repository – in Fedora(with Livna repository) the command I used is…

yum install gstreamer libdvdcss gstreamer-plugins-ugly audacious-plugins-nonfree-mp3 kdemultimedia-extras-nonfree ...

Or in Debian/Ubuntu system

apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-ffmpeg

Essential Video Codecs

The binary codec packages provided by mplayer adds support for codecs that are not yet supported natively, like newer RealVideo variants and a lot of rare formats. Note that they are not necessary to play most common formats like DVDs, MPEG-1/2/4, etc. Take a look at the codec status table for the list of currently supported codecs in Mplayer.

Instructions for installing binary codecs can be found in the README or in the README.txt file that accompanies each codec package. Detailed usage instructions are in the codecs section of the documentation. A brief overview of the installation procedure is given below...

Installing the Codecs

First, download the codecs package that matches your system. In most cases, that is Linux x86.

First, extract the file to a local directory. There should be 64 files(currently). Next, we have to copy this to the system's codecs folder(usually /usr/local/lib/codecs/). To do this, you must have root user privileges...

sudo cp -R essential-20071007/ /usr/local/lib/codecs/

Voila - we have installed the codecs. But we are not done yet. Some players look for the codecs in other folders - to accommodate those players, we have to link the other folders to the central codecs directory. To do that, run these commands(as root)...

ln -s /usr/local/lib/codecs/ /usr/lib/codecs
ln -s /usr/local/lib/codecs/ /usr/lib/win32
ln -s /usr/local/lib/codecs/ /usr/local/lib/win32

Playing the Video

Now open up the video you are trying to play in any video player(say mplayer) - in 99% of the cases, it will play without any issues. In the unlikely event of a problem, open up the same video in xine. If it still does not play, go to vlc. Your video will be working in atleast one of these three players.

Did it work for you - let me know in the comments...


Tags: , , , , , ,
Posted in Configuration, Troubleshooting, Video | 14 Comments »

Creating a Screencast in Linux

Written by BinnyVA on August 7, 2008 – 11:02 pm -

RecordMyDesktop is a tool to create screencasts in Linux easily. A screencast is a video capture of your desktop – a video equivalent of a screenshot.

Install RecordMyDesktop

You can install RecordMyDesktop in Red Hat/Fedora systems using the command…

yum install recordmydesktop

For debian/ubuntu systems, I am guessing that the package name does not change(can anyone confirm this?). The command in this case is…

apt-get install recordmydesktop

Creating a Screencast

First start the application – that’s in Menu > Multimedia > gtk-recordMyDesktop.

There will be a small image of your desktop inside this application – drag a rectangle inside this preview area to select the record area. Once the selection is made, there will be a bigger rectangle on your screen highlighting the record area. Only the space within this area will be captured.

Now press the Record button to begin your recording. You will notice that you have a new icon in the system bar – something like this…

When this icon is a gray square, that means its recording. You can end the recording by left clicking on this icon. This show a new window that will show the status of encoding of the captured video. Depending on the size and length of the captured video (and your processor speed), this might take a long time.

Once this process is completed, you will be shown the main window once again. Now click on the ‘Save As’ button to save the file as a ogg Theora video file.

That’s it – you have created your first linux screencast! Congratulations!

Feel free to play around in the application – and make some screencasts. One you have done that, upload it to youtube – and post the URL in the comments.

A Screencast

Here is my first screencast. A screencast that shows you how to create a screencast using recordMyDesktop. The background music is ‘Recursion’ by Michael David Crawford – I thought it was appropriate.

Links


Tags: , , , ,
Posted in Applications, Uncategorized, Video | 4 Comments »

Firefox 3 Review

Written by BinnyVA on July 1, 2008 – 10:58 pm -

Firefox Logo

I have been a Firefox 3 user from day 1. So I thought it might be a good time to write a review. Some positive and negative points about it…

The Negative Stuff

Stability Issues

I am having some random crashes – this could be a problem with my setup. I have not heard about such a problem on other sites. Anyway, these crashes give no warning. One minute, you are browsing smoothly and the next minute you are looking at the desktop – the browser have gone away. Fortunately, Firefox has a session saver – so if you restart Firefox after a crash, the tabs you had earlier will be waiting for you.

Go Button

Firefox 3 removed the ‘Go’ button to the right of address bar. I want it back – fortunately, you can get it back using a userChrome.css hack…

Go to the profile folder of firefox. In Linux, it should be in some folder like /home/username/.mozilla/firefox/[random id].default/chrome/

Create a new file called userChrome.css and put this line in it…

#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button {
	visibility: visible !important;
}

Flash Problem

This should be a Linux only problem – and I think the flash plugin is the one that should take the blame. When I visit some pages with embedded flash, a new gnome window open up. It does nothing – just hangs around the screen. Do any of you guys have this problem?

The Positive Stuff

Awesome bar is, well, awesome

The new address bar is just great. It saves a lot of time. Its a very good feature – and I predict that other browsers will follow firefox lead and add this feature too.

FUEL Library

You users will not find this useful – but for us add-on developers, this is great. FUEL a javascript library that makes it much more easier to create XUL plugins for firefox.

Better Bookmarking System

Firefox 3’s bookmarking system is much better than the earlier one. It learned a lot from del.icio.us – now it supports tagging.

Looks Better

In addition to better color and font handling, the looks of some HTML elements have been improved(example, the dropdown/combo box). Also dragging have been improved – just try to drag an image or a link and you will see what I mean. You can see the item you are dragging along with the cursor instead of a generic icon.

So what are your opinions about the new Firefox?


Tags: , , , ,
Posted in Applications, News | 8 Comments »