Mar 052011
 

With Recent Flash upgrade to version 10.2, I faced a a strange issue with regarding to playing videos on youtube. all video I played on main site or yourtube video embedded in other sites like facebook were in red color, while the audio was playing just fine. something like in screenshot below:

Youtube showing red color video due to Flash

Youtube showing red color video due to Flash

It turns out that this is a bug in Adobe Flash Player 10.2 introduced because adobe enabled hardware acceleration to for all users, but in case hw accel does not work properly. video will appear in weird colors. while adbobe is working on the bugfix, the current workaround is to disable Hardware acceleration.

WorkAround:

  1. Goto http://www.youtube.com/swf_test.html Continue reading »
Jan 282010
 

Background

Since ages ago, cdrtools was the default tool-set used for optical disc buring on Linux. Under the hood of those pretty GUI programs like k3b/brasero, was actually cdrtools which did the dirty work.it was being actively developed by a team led by Joerg Schilling.The whole code was licensed under GPL.

One fine Morning,

Mr. Schilling decided to change license to CDDL.This is where everything started to go wrong!

What is the issue?

CDDL license is incompatible with the GPL.The CDDL is intended to be GPL incompatibleso cannot be distributed along with GPL code. Hence, it became illegal for Linux Distributions to redistribute cdrtools.

Debian comes to rescue!

Linux didn’t have any alternative to cdrtools, hence debian project decided to fork last available GPLed code into Cdrkit. they dropped cdrtools and included cdrkit. every major distro like Fedora,Ubuntu,Mandriva supported debian and did the same.debian took the responsibility and start to maintain cdrkit.

Cool, everything finally settled.

No, there is one small problem.CD/DVD burning is a complicated business that needs a lot of knowledge and also requires a lot of development effort which debian does not have.lately, it has been seen cdrkit is not been actively developed (current to last stable was around a year).Addionatlly it is technically inferior to cdrtools.cdrkit still does not generate proper iso-level-3 file systems and has trouble with big file support(the famous 4.3GB data limit in DVD against the real capacity of 4.7GB) .
This is the reason creation of proper blu-ray in linux is so hard.
it seems the developers of cdrkit don’t have the resources/skills to maintain such a complex software.

Guess, we are stuck!

So Choice is what we have in this.If you face problems with cdrkit, there are two options:

1) Built and Install Cdrtools yourself.Source is available at its Home Page. ArchLinux users can get it on aur.

2) (Last Option)Switch to propertiery closed source burning suite:NeroLinux.. if everything fails then only you should go by this route. I would strongly advise you to try choose option 1)

What is the purpose of this post
The purpose of this post if to let the users know the actual situation/state of CD/DVD burning apps in Linux. And let them select which software they want to use.

May 192009
 

Finally Jaipur got freedom from shackles of proprietary & restrictive demons.Fosjam.in was organized in city on 16-17 May 2009 jointly by Linux user group – Jaipur and JECRC research foundation. It is an event for promotion Free/Open Source Software. it was held at Jaipur Engineering College and Research Centre, Jaipur. I also attended the event by chance.

I believe it was the first time, such kind of event was happening in Jaipur. there was mad rush for the event & people even came from outside Jaipur as well. online registrations were above 300, which was many times than expected.

About the Event

The whole event was organized in just 10days by enthusiastic member of lug-Jaipur and supportive students of JECRC.  speakers were free software developers from various parts of India. the talks were ranging basic topics like “how to communicate on internet effectively” and to some advanced topics like Embedded systems. Besides the main talk there here hands-on sessions called hackfests.

Day 1

Reached the Venue at 6:00PM, had no problems finding the venue thanks to easy instructions posted on their website. Event was start by a singing Free Software Song and blowing balloons called “Winblows” . Boy! what were they thinking?

After this,  we were told to proceed to Labs for the talk by speakers.I had trouble finding correct lab since they are too many and without guidance it was hell lot of confusing. somehow I ended up in LAB-three. there the topic was “i-want-2-do-project-tell-me-wat-2-do-fedora” by speaker called  Shakthi Kannan. the lab was well equipped with projector,AC and most important all machines were running fedora! Sessions started with all of us introducing ourselves. the talk was quite long but not boring. after session was over, there were hackfest scheduled from 10pm to 2:00AM. unfortunately, i couldn’t stay for that long.

Day 1 was awesome, event was well organized and everything was preplanned. since i had such a good experience  – I decided to return for day 2.

Day 2

In Morning, I reached On time. to my surprise the event got delayed by 1hr. so i waited,waited and waited. finally we were called at about 10:40AM for talk by Lalith Suresh. If i remember correctly, he is not speaker’s panel, which was little. he told us about Open Source and its Ideology,how projects work, how can we contribute etc.the talk filled with helpful information and how can one contribute. a welcome surprise! I liked his style and Deadly PJs.The  two girlfriend theory  = high availability was pwnage!!

One thing I noticed and liked on day1 as well on day2 that the umber geek T-Shirts  guys were wearing. i liked one on which “127.0.01” was written. Simple and Geeky!

Next was Session by Shakthi Kannan titled – Badam Halwa of Embedded Systems.the presentation was interesting and well researched. i really appreciate all the effort he’s putting into it! Infact his talk was so good, that i decided to attend next talk  as well. during next talk, we had a announcement that some talk are rescheduled.

Sad news, one talk on Linux security which was looking to attend was dropped. due to changes, i had plenty of time to socialize. I even made a few friends there. After that we had a hand-on session on IRC and a talk on Distributed & fail-safe computing.

Conclusion

A event on Technology, that too on Free and Open Source is Dream Come true for me. Ask Why?

Because I always saw such kinds of event happening other bigger cities like mumbai,pune  and used to think when can we have something like this in jaipur. I want to thank all who made it possible and Jai pandya for letting me in :P

Hopefully, next year it would bigger and better. maybe a national level event – possible. who knows.

As a custom, here are some pics from the event:

Nov 142008
 
Oh No!

Recently, A partition on my backup harddrive was corrupted. It was i was clueless how it had happened. further, now the partition was refusing to mount and it was being detected as ext4.
I tried mounting is manually:

gaurish  ~  $   sudo mount /dev/sdb6 /media/fl/
mount: unknown filesystem type 'ext4'

Dmesg said

EXT3-fs: sdb6: couldn’t mount because of unsupported optional features (ca9bc1e0).”

I was not sure what to do next
So i cried for help on various online Forums[1][2][3] but all in waste.
After that i got pissed off and decided to take matter into my own hands and starting reading on how Partitions in linux are made etc. Then i came to know about superblock.
Bingo!, i had a bad superblock.
Here is a Quick Procedure to recover from a bad super block(read nightmare)
Open Terminal and type the following commands:
1) see backup superblock location

~ $ dumpe2fs /dev/sdb6 | grep -i superblock

Output:
dumpe2fs 1.41.3 (12-Oct-2008)
Primary superblock at 0, Group descriptors at 1-2
Backup superblock at 32768, Group descriptors at 32769-32770
Backup superblock at 98304, Group descriptors at 98305-98306
Backup superblock at 163840, Group descriptors at 163841-163842
Backup superblock at 229376, Group descriptors at 229377-229378
Backup superblock at 294912, Group descriptors at 294913-294914
Backup superblock at 819200, Group descriptors at 819201-819202
Backup superblock at 884736, Group descriptors at 884737-884738
Backup superblock at 1605632, Group descriptors at 1605633-1605634
Backup superblock at 2654208, Group descriptors at 2654209-2654210
Backup superblock at 4096000, Group descriptors at 4096001-4096002

2) Run Fsck with Alternative Superblock

$ sudo fsck -b 32768 /dev/sdb6
fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
/dev/sdb6 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong for group #12 (30380, counted=30381).
Fix? yes

Free blocks count wrong for group #127 (15027, counted=5927).
Fix? yes

Free blocks count wrong (10539272, counted=10530173).
Fix? yes

Free inodes count wrong for group #116 (32732, counted=32729).
Fix? yes

Free inodes count wrong (24812957, counted=24812954).
Fix? yes

/dev/sdb6: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb6: 934/24813888 files (6.2% non-contiguous), 14282211/24812384 blocks

3) Done! Partition is successfully recovered and data is safe. now we can mount it normally.

$ sudo mount /dev/sdb6 /media/test

Now, After this incident i have to rethink my backup strategy, which till now have been reply solely on HDDs as backup medium.
Comment & Suggestions are welcome :)

Oct 022008
 

Linux is a stable OpenSource Operating system.It has a ability to run for long hours and crashes are rarely seen.On top of it, it has a inbuilt scheduler which is robust and  it never misses tasks. All this Characteristics make Linux a perfect choice for downloading. Yeah almost perfect choice (discussed later).
In This Guide we would learn how to smartly schedule downloads. This way files would be automatically downloaded while you sleep. This Guide is mainly for BSNL/MTNL broadband subscribers. I have Tried to prescribe a general procedure which is applicable on all major Distributions.so distribution specific goodies are not discussed here.

Mainly there are two mode of this, you need to pick a method which applies to you.

  • Router Reboot method: Suitable when your connection is configured as always-on and router is PPPoE mode. so you don’t need to dial your connection every time you connect to Internet. it works with selected routers which supports telnet connectivity.Dependant upon routers.
  • Bridge Mode: Suitable when you dial to connect to Internet using a Dialer program on your PC. in this setting your PC is in Bridge mode.it works with every router.
Understanding Cron Daemon
Before we begin we should know how about cron – default linux scheduler
Cron Daemon is a default scheduler for Linux based systems.Cron Daemon is  responsible for scanning the crontab files and running the commands at the appropriate time. It always runs in background, wakes up every minute to check for any scheduled taks pending for execution. then it executes them and goes back to sleep.

Crond reads tasks from crontab, anything you write in your crontab with proper syntax will be read & excuted by crond. Crontab as name suggests, is basically a file where sheduled tasks are arranged in tabular forum.The syntax of crontab is fairly simple.

Minutes Hours Day Month Day of the month command
enter the minutes part of time, legal values 0-60 Enter the hours, in 24hr format. legal values 0-24 Enter the Day number starting from Monday, legal values 0-7 Enter the month,legal values 1-12 Enter a Date, legal values 1-31 Command you want to execute at scheduled time

use command “visudo” to edit crontab.it would load a editor depending upon your $EDITOR variable. on Ubuntu you would get nano
how to use nano(easy)
how to use vi (advanced)

Things Which are common among both methods

1) Create a simple text file in your home folder and name it “downloads.txt” & notedown its full path. Insert the *Direct* links of files you want to download into this newly created file. The files given in this would be downloaded by wget automactically.wget can handle http & ftp downloads. After download completes remove the link and enter new ones. insert one link per line. Remember to add direct link only.

2) If you use torrents, install your torrent client and notedown its full path to its binary. you can use “whereis” command to find its exact location. generally its /usr/share/sbin. If you are looking for worthy torrent clients, look for deluge or azurus now vuze

Router Reboot Method

1) I wrote a simple Shell script for rebooting router. it works nicely on D-link GLB 502T. although you may need to change userid,password & command values.copy paste this script in a file and save it as router-reboot.sh. make it excutable by

chmod a+x router-reboot.sh

#!/bin/sh
#############################################
#Script Written By Gaurish Sharma
#change the password,userid & command values with your own set
#the default password & username
# in most cased is 'admin'
#use it in terminal as sh router-reboot.sh | telnet
#(C) GaurishSharma.com
#############################################
add='open 192.168.1.1'
userid='root'
password='your_passoword'
command='reboot'
echo $add
sleep 1
echo $userid
sleep 1
echo $password
sleep 1
echo $command
sleep 1

2) Open Terminal and enter “crontab -e”. enter the following in your crontab and save it

# m h  dom mon dow   command
# Reboot Entry, please replace with correct path
10 2 * * * cd /home/gaurish/scripts && sh router-reboot.sh | telnet
# Start Torrent client, please replace with correct path of your router
12 2 * * * DISPLAY=:0.0 /opt/azureus/azureus
# Downloads via wget, Please replace with corrent path
13 2 * * * wget -ci /home/gaurish/downloads.txt
# Reboot Entry, please replace with correct path
50 7 * * * cd /home/gaurish/scripts && sh router-reboot.sh | telnet

3) Now we need to enter command to shutdown computer everyday at 7.51AM.this only can be done via root user. so now the enter command as “sudo crontab -e” and Insert this line.

50 7 * * * /sbin/shutdown -h 0

4) (Optional) you can install mailx package to see the log of what happened while you were sleeping

Bridge Mode

1) we would be using default command which you use to dial to internet. on most cases its pon dsl-provider for connectinig and poff for disconnection . in case the command are diffrent on your machine please replace them.

2) Open Terminal and enter “crontab -e” now paste the following in it

# m h  dom mon dow   command
# Start Torrent client, please replace with correct path of your torrent program
10 2 * * * DISPLAY=:0.0 /opt/azureus/azureus
# please replace with correct path of download.txt
13 2 * * * wget -ci /home/gaurish/downloads.txt

3) Now we need to use root crontab, use “sudo crontab -e” to access it.

10 2 * * *  /usr/bin/pon dsl-provider
49 7 * * * /usr/bin/poff
50 7 * * * /sbin/shutdown -h 0

4) (Optional) you can install mailx package to see the log of what happened while you were sleeping.

What you are missing in Linux, comparing to windows?
In starting of this post i said,  almost perfect choice for downloading. so you gotta missing something. which is ability to power on your PC automatically.
I am still searching for a method to start a Linux box automatically at a specific time.
As a workaround you can do the same thing via your BIOS, but a limited no of BIOS support this. so either leave your machine running with monitor turn off or use the BIOS trick.

Related Posts: 

Sep 202008
 

Here is a Quick tip for people using Archlinux:

Sometimes we don’t want dhcpcd overwriting our resolv.conf anymore, since it is customized. We do, however, want dhcpcd to continue to automatically set out IP, default gateway, et cetera. To cause this effect we will edit /etc/conf.d/dhcpcd as root, with our favorite editor. The directive we are looking for is DHCPCD_ARGS and by default that directive should look like the following figure:

 
DHCPCD_ARGS="-t 30 -h $HOSTNAME"

To that directive, add the -R flag. Your directive line should look something like the following figure:

DHCPCD_ARGS="-t 30 -h $HOSTNAME -R"

Taken from Archwiki