Archive forTechnology

Youtube video download via command line

Well, there are many instances of how to download video’s via youtube. I have tried most of it, some worked well while some did not. Most of the scripts that are written use the old 1.0 version of youtube API which does not seem to work. There is some `t` factor added in the 2.0 version which makes it somewhat difficult to download (at least for me). I went through the API and was able to figure that out.

http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html

But, at last I was able to locate a cool script by the name youtube-dl from one bitbucket.org. youtube-dl is a small command-line program to download videos from youtube. It requires the Python interpreter, version 2.x (x being at least 4), and is not platform specific. This works in Linux, Windows or in Mac OS X also. The latest version is 2010.01.19. It is freely available and one can go an modify it also.

You can download it from here.

Source: http://bitbucket.org/rg3/youtube-dl/wiki/Home

Comments

Playing WMV file in Linux (Ubuntu Jaunty)

There are instances when VLC nor MPlayer will not play .wmv (WMV3) files even if the codecs are available. This is due to the propitiatory format that it uses while encoding the video. While trying to play the video you are thrown with the error,

[wmv3 @ 0x8972330]Reserved RES_SM=2 is forbidden

So, you are left with nothing but using Windows and the Windows Media Player to play the video (easiest option). Else install Windows Media Player via wine for Linux (which did not work for me). The last option is to convert the video from that format to some other formats (.avi, .mpg) using mencoder.

MEncoder is a free command line video decoding, encoding and filtering tool released under the GNU General Public License. It is a close sibling to MPlayer and can convert all the formats that MPlayer understands into a variety of compressed and uncompressed formats using different codecs.

root@ophiophagus:~# mencoder file.wmv -ofps 23.976 -ovc lavc -oac copy -o file.avi

Comments

GodMode in Windows Vista/7

You have a GodMode in Windows Vista/7. Microsoft has created God to save itself from the Open Source community. God Mode creates a folder which gives one categorized access to each and every setting in Windows.

How to enable it?

Create a folder named with the name, `GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}`, without the quotes. Double click on it and this is what you get as below,

GodMode in Windows Vista

GodMode in Windows Vista

Reference: http://stadt-bremerhaven.de/windows-7-godmode/#more-11682

Comments

GIMP removed from Ubuntu Lucid Lynx

I was going a Google search of what all applications the new Ubuntu will carry. Lots of modifications/ new splash screens etc. But I was surprise to see one post saying that GIMP is to be removed from the default installation. I went through the Ubuntu wiki and they had already had a post regarding this, some months ago,

https://wiki.ubuntu.com/RemoveGimp

The GIMP community also agrees to it, saying that the vision of GIMP is to be a high-end/expert application and Ubuntu removing it from the default installation shows the respect it deserves.

http://www.gimpusers.com/forums/gimp-developer/12113-GIMP-to-be-removed-from-Ubuntu-Lucid-Lynx.html#msg55609

Comments (1)

Mininova is legal

Mininova is going LEGAL. I wanted to download some movies and went to my favorite torrent website and to my utter surprise, Mininova does not serve movie torrents now. It has gone legal distributing contents only. No more movie torrents now.

This can be found at http://mnstat.com/images/blog/index.html

Comments

Learning from mistakes

Well, the blog was down for almost 3 days. Reasons? My own mistake of deleting the database, without taking a backup. Stupidity of me. The reason was to move the blog from the current machine to another faster machine along with an upgrade of Wordpress. After struggling for 3 days, getting the remote backup, looking at Google cache pages, I was finally able to get the blog working. Being a sysadmin, I should have taken care of backup, which I did not do.

Well the other good part was of the things I learnt, while trying to recover the database. Normally, when you configure MySql in Ubuntu/Debian, you are not provided with the option of creating binary logs. Binary logging will record in a binary file all SQL transactions executed and attempted on the server. By using the `mysqlbinlog` utility, the contents of the binary log file can be extracted so that the SQL statements may easily be rerun. To enable binary logging, add the following line to your server’s options file `my.cnf`.

log-bin = /var/log/mysql/mysql-bin.log

After making the entry above to your options file, you will need to restart the MySQL server for it to take effect.

Though I have personally not tested it out in a production server, I have tried using it on my laptop and what I notice from the log file is that it notes down each and every database transaction.

prasanta@ophiophagus:/tmp$ sudo mysqlbinlog /var/log/mysql/mysql-bin.000002 > /tmp/mysql.sql

This will create a mysqlsql text file which you can edit it manually.

I hope that this will help some person like myself in the future.

Comments

Gmail chat/contacts down

Just checked gmail. Seems that chatenabled.gmail.com is down since 20.15 hrs today. The gmail team has put up notice in red saying the same. Hope it is up soon to be able to get in touch with all friends …

Gmail Chat Server down

Comments

Bluetooth headphone with Ubuntu Jaunty

Well, I recently got a pair of Dell Bluetooth headphone and was trying to use with Ubuntu 9.04 on my laptop. I went through the forums which suggested a lot of things, but this are the steps that really worked for me. I am summarizing the steps that were involved in pairing the headphone with the laptop. Before using the below, please install `pulseaudio` server.

prasanta@ophiophagus:~$ sudo apt-get install pulseaudio

1. Turn on the headset in pairing mode.
2. Open the terminal and use the following commands,

prasanta@ophiophagus:~$ hcitool scan
Scanning …
00:16:44:21:D5:4F Dell

4. Create a .asoundrc file in your home directory,

prasanta@ophiophagus:~$ emacs -nw .asoundrc
pcm.btheadset {
type bluetooth
device 00:16:44:21:D5:4F
profile “auto”
}

5. Enable bluetooth headphone to get the audio,

prasanta@ophiophagus:~$ sudo hciconfig hci0 voice 0×0060

6. Now we need to tell PulseAudio for the existence of the bluetooth headphone for sinking output.

prasanta@ophiophagus:~$ pactl load-module module-alsa-sink device=btheadset

7. Once pairing has completed, we can now test to see if we can send audio to the headset. In your terminal, type in the following:

prasanta@ophiophagus:~$ aplay -D btheadset -f s16_le /usr/share/sounds/ubuntu/stereo/dialog-question.wav

Note: it will play only .wav files. It does not play .ogg files.
8. Install PulseAudio Preferences, the PulseAudio Manager and the PulseAudio Device Chooser application.

prasanta@ophiophagus:~$ sudo apt-get install paprefs paman padevchooser

9. Once everything is installed, go to
`Applications->Sound & Video->PulseAudio Device Chooser. `
This will add a black microphone jack icon to your system tray.
10. Do a left-click on the jack icon and a menu appears. In this menu, choose “Manager”. A new window appears. If it’s not already connected, click on the “Connect” button to connect to your local PulseAudio server. When connected, you will see details about it listed.
11. Click on the Devices tab. Under “Sinks” you should see an entry for “alsa_output.btheadset”. This is picked up directly from your .asoundrc file.
12. Now go to the Sample Cache tab. You are shown a list of sounds. Choose a WAV file from this list (it won’t play any other format). At the bottom is a “Playback on” drop-down. Choose “alsa_output.btheadset” from this list and click on the Play button. You should hear the Ubuntu “login ready” sound through your speakers. This proves to us that PulseAudio can play through your Bluetooth headpone (but this is NOT the redirection – this is just a test).
13. Close the PulseAudio Manager.
14. Do another left-click on the mic jack icon in your system tray.
15. Go to “Default Sink” and then choose “Other” from the sub-menu. A window appears. In this window, type in “alsa_output.btheadset” and click OK.

Woh! you are ready to rock.

To switch back to your speakers, simply click on the mic jack icon again, choose “Default Sink” and choose “Default” from the sub-menu. The next audio stream played will go back through your speakers.

Note: When you try to reload the module, it gives out an error, Module Authorization Failed. After unloading the modules it works, but most of the times it does not.

I am not able to go around this problem even after restarting bluetooth. Hope to find a solution.

Tutorials:
http://bluetooth-alsa.sourceforge.net/build.html
http://forums.overclockers.com.au/showthread.php?t=780054

Comments

Server Uptime

A nice screen shot to be uploaded in the blog, as a sysadmin. Will keep it updated as days pass by.

screenshot

Comments

Hardware Information under Linux

For most of the time I have been using `lshw` (list hardware) happily under Ubuntu. But yesterday, I had a situation wherein I need to find out the hardware of the machine in Rocks Linux. I did not think of installing `lshw` on the machine, but wanted to find out whether there are other commands from where I can get the hardware information including BIOS. So after doing some  google search, came up with `dmidecode`.

`dmidecode` is a tool for dumping a computer’s DMI (Desktop Management Interface) table contents in a human-readable format. This table contains a description  of  the  system’s  hardware  components,  as well as other useful pieces of information such as serial numbers and BIOS revision.

Usage:

root@ophiophagus:~$ dmidecode -t
dmidecode: option requires an argument — t
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot

root@ophiophagus:~$ dmidecode -t bios < List BIOS information>

Use the above types for getting the hardware information for the machine.

Comments

« Previous entries