Thursday, March 5, 2009
##mac@irc.freenode.net
Tuesday, November 11, 2008
Epoch date/time convert - Python and Bash
>>> import os,time
>>> time.time()
1226392970.4683549
>>> time.gmtime(time.time()).tm_mday
11
>>> time.gmtime(time.time()).tm_mon
11
>>> time.gmtime(time.time()).tm_year
2008
>>>
WIth bash the same is accomplished as below.
veveo@shreyas:work$ date +%s" <--> "%c
1226393170 <--> Tuesday 11 November 2008 02:16:10 PM IST
veveo@shreyas:work$ date -d "-1 month" +%s" <--> "%c
1223714775 <--> Saturday 11 October 2008 02:16:15 PM IST
veveo@shreyas:work$ aMonthBefore=`date -d "-1 month" +%s`
veveo@shreyas:work$ echo $aMonthBefore
1223714816
veveo@shreyas:work$ date --date=@$aMonthBefore +%c
Saturday 11 October 2008 02:16:56 PM IST
veveo@shreyas:work$ date --date=@1223714816 +%c
Saturday 11 October 2008 02:16:56 PM IST
Tuesday, August 26, 2008
First it was DNS and now BGP! Protocol woes!
Are you feeling safe using internet, anymore ??
- Details of DNS flaw leaked (Dan Kaminsky)
- Revealed: The Internet's Biggest Security Hole (Anton "Tony" Kapela & Alex Pilosov)
Thursday, August 21, 2008
My first DSLR - Nikon D60
Two places to read from, when you own your first DSLR. Immensely helped me in understanding the tech bits!
Software's to assist the photographer in you!!
- Utility to read and manipulate raw images (including NEF)
- How to use Gimp (Look for "photo editing")
--more to come soon!
Thursday, May 1, 2008
Install ipw3945 (or iwlwifi) - Intel PRO/Wireless 3945ABG - on debian.
I always had these thoughts
- Why ubuntu install all the necessary drivers for the intel wireless cards to work automagically after the installation
- Why debian (etch) cant do the same ? why doesn't debian (etch) have the necessary packages in their official repositories.
I was always shying away from installing the firmware, building from the source. But when I found no other way, I ventured to get things done with sourceforge.net and here is how.
Step 1:
- download the ipw3945-1.2.2.tgz from sourceforge.net (http://ipw3945.sourceforge.net/)
Step 2:
- Do the following : 'tar -xzf ipw3945-1.2.2.tgz', 'cd ipw3945-1.2.2' and 'less INSTALL'
Remember, most important step is the "less INSTALL' and reading through the instructions.
Finishing it off:
Thank your lucky stars, thank the developers who got these packages for you and last but not least thank sourceforge.net for hosting the ipw3945 page.
PS: If you have followed the 'INSTALL' file precisely you should see the wireless networks in your 'nm-applet' list, when you click on it.
I had to use sudo every here and there, especially when i do the './load' within the 'ipw3945-1.2.2' directory. So use it at abundance, shouldn't hurt you much !
This will only get you started with perfecting the wireless interface configuration. Once the mentioned procedure is completed, you might want the wpasupplicant and other accompanying packages like wpa_gui also for completing the setup.
Update:
After updating my Debian etch DVD's to lenny using jigdo, I installed lenny on the laptop. Once done, I modified the sources.list as below and did a "sudo apt-get dist-upgrade"
deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free
deb http://http.us.debian.org/debian/ lenny main contrib non-free
deb-src http://http.us.debian.org/debian/ lenny main contrib non-free
This updated my kernel to 2.6.24 and it got me the correct wireless drivers (iwlwifi, this is the next life of deprecated ipw3945 driver). Wireless was working fine after the update and the networks were showing up in the nm-applet.
Thursday, April 10, 2008
Configuring syslog server on debian
I am running a Debian (lenny; In etch also this should work fine) and I got syslog-ng installed replacing the older, sysklogd package. syslog-ng is the next generation log daemon which has added features, noticeably in the log filtering area. But all I wanted was to get start with collecting and logging logs from my Netscreen firewall. So this is what I did.
Installed necessary packages using apt
apt-get install syslog-ng syslog-summary
(I am yet to try out syslog-summary )
Added the following to the configuration file of syslog-ng (/etc/syslog-ng/syslog-ng.conf)
In the source s_all{}, uncommented "udp();"
under the default destinations, added "destination df_netscreen { file("/var/log/netscreen.log"); };"
Under the default filters, added "filter f_netscreen { facility(LOCAL0); };"
Added to the end of the configuration file, the meat of the new log entry,
log { source(s_all); filter(f_netscreen); destination(df_netscreen); };
And then restarted the syslog-ng service.
sudo /etc/init.d/syslog-ng restart
That much did the main work of setting up the log server.
| "f_netscreen" & "df_netscreen" These are mere identifiers and since I am setting this up to get my Juniper Netscreen25 logs to be accumulated here, I gave the name "*netscreen*". "LOCAL0" This is the log facility I used on the Juniper Netscreen25 for setting it up to send the logs to the newly set up log server. Hence the string "LOCAL0" appeared in the facility description in the filter syntax. |
Since my firewall log size grows madly, I had to set up the logrotate to save my computer from running out of space. Adding a file called "netscreen" in the "/etc/logrotate.d" folder with contents as below did the magic for me.
/var/log/netscreen.log {
rotate 6
weekly
compress
missingok
notifempty
}
This will rotate my firewall logs weekly and each will be kept until 6 weekly rotations before getting deleted. Read through "man logrotate" for more detailed information on setting up logrotate for your logfile and its always good to restart the crond "sudo /etc/init.d/cron restart" since logrotate uses cron.daily to get itself running every day.
update (2008-04-11): Adding the remote log facility "LOCAL0" to the "not" list of "f_messages" filter will avoid accumulating the remote logs in "/var/log/messages". (Addition is in 'bold letters', below)
filter f_messages {
level(info,notice,warn)
and not facility(LOCAL0,auth,authpriv,cron,daemon,mail,news);
};
Most importantly, by default syslog-ng does not seem to enable the cron log. I found it only when I wanted to check why the logrotate did not worked. I had to un-comment the below in "/etc/syslog-ng/syslog-ng.conf".
#log { source(s_all); filter(f_cron); destination(df_cron); };
Wednesday, April 2, 2008
Installing windows vista ultimate on dell laptop (Vostro 1400)
After disabling AHCI I was able to boot up the fresh Vista installation, and I knew what exactly is the trouble. Further search in the Google took me to this thread @ forum.notebookreview.com. I tried to repair the installation with the Vista repair option during the installer run, trying to add the drivers (which came with my dell driver cd) from a floppy/USB memory stick. It was taking a very long time and was not going forward. I didn't had much time to experiment and had to go for a re-install and this time when I did load the drivers (from the dell driver cd) everything was going on fine.
Initially when the windows vista ultimate installation was not going further, I tried to install windows server 2003 R2, which also succumbed to BSOD. From the wiki page about AHCI, its obvious that this is a common problem with most of the windows installations. Loading the appropriate drivers from the vendor while installing should be the solution if you have faced similar trouble.
Update (2008-04-11): After the successful installation of the Vista Ultimate, I never had used Bluetooth, until yesterday when I wanted to connect the laptop to the internet using vodafone mobile connect. I was trying to findout the old "Bluetooth Devices" application/link in my computer where I can enable/search for devices. Unfortunately later I found that the laptop doesn't have the BT (BT=Bluetooth from now on) LED on. This means, the device is not on for the OS even though it is in the BIOS. I checked the BIOS to make sure that BT is on and that the Wifi switch will handle BT as well as the Cellular device (Cellular device is my another mystery to be found out). Desperate to get it working, I called the Dell engineer. After trying all that he asked me to (most of which I had already done, but did for the sake of following a protocol in troubleshooting), we (me and the dell support engineer) came to a conclusion that there is either connection problem (BT module to the motherboard) or the BT module is not working. Only after scheduling the engineer visit, it occured to me that visiting the dell forum is a good idea, and right there I headed straight. In "Forum Home > Support > Network/Internet/Wireless", the welcome (must read) thread named "Network/Internet/Wireless FAQ **READ FIRST** (Updated 4-11-2008)" I found the answer to my problem in the form of a "patch" (In the forum thread, under 'Bluetooth updates', a link named " Utility to enable Bluetooth radio after downgrade from Vista to XP or Vista to Vista if the radio is software disabled on Vista"). After installing the patch, my BT device LED indication was on, I can see the "BT devices" in the system tray, and It was on, it came back alive.
My advice to all those in distress due to your computer malfunction, head to Dell forums, read and search and read and .... chances are you can get things working by yourself. Dell forum is a great help and its very active. The way they categorized the forum is very neat and easy on the new users.
Saturday, March 29, 2008
Installing KDE4 on Ubuntu (Hardy Heron)
Friday, March 28, 2008
What do you mean by free software
When we speak of Free Software, we mean freedom, not price.
Have a read here
Saturday, March 22, 2008
Friday, January 11, 2008
ffmpeg and mencoder GUI for Windows
There in the web, I found a GUI wrapper for ffmpeg and mencoder for windows called Media coder. This is an open source software distributed under GPL license. Download it and try it (I have done some basic conversion _single files | not in batch_ and it worked okay) and do not forget to convey your gratitude to the author/developer of the application if it helped you in any way.
ffmpeg with AMR (nb & wb), lame, FAAC and FAAd codec.
Below is how I have installed and used ffmpeg to convert avi and wmv files to 3gp format so that I can store and play them in my mobile phone. I have a very rough guide, but hope that will help you in understanding more about the procedure by doing your own research. Consider the below scribble as a pointer to get things started. Now that being said, lets get started..
Download the source for amr_nb (nb stands for narrow band; amr is for the 3gp support). If you can find the sources for both you can use both of them. I was not able to find the source for amr_wb and at last I had to beg in irc://irc.freenode.net (#ffmpeg) to get the source from a fellow who had it uploaded in some file sharing site for me.
For mp3 support, get the lame codec from sourceforge
Download faac, faad2 from sourceforge.net and get them installed.
get the amr and lame codecs compiled and installed.
Get the source for ffmpeg from the svn or search for the tarball.
svn://svn.mplayerhq.hu/ffmpeg/trunk
Get things going with the configure, make & make install.
./configure --enable-libmp3lame --enable-libvorbis --enable-libamr-nb --enable-libamr-wb --enable-gpl --enable-libfaac --enable-libfaad --enable-shared
voila.. you are ready to convert video files for your mobile ~smile~
Below is the way I use ffmpeg to convert. Figuring out the options for ffmpeg is your job (hint: man ffmpeg)
./ffmpeg -i /home/old_desktops/sabarish.old/laptop_backup/Azureus\ Downloads/Kylie\ Minogue\ -\ Spinning\ Around\ \(xvid\ K-rip\).avi -f 3gp -vcodec mpeg4 -acodec faac -ar 8000 -ac 1 -ab 12.2k -y Kylie.3gp
I have used options, -acodec libamr_wb also but had some issues with the sound in the video, so rolled back using faac audio codecs. You can experiment around and use the best to get things done.
vtap.com or regionalized India.vtap.com !
What would you do when you want to see the new Rs. 1 Lakh car which was presented to us, Indians by TATA Motors ? What if you want to see the video of the car to find the look and feel of it ?
My choice would be to search in vtap.com. This ultimate video search engine gives me the power to find out informational videos, entertainment videos, news videos, sports, user videos (which are hugely crappy or pathetic, but a few gems), music videos etcetera. The most powerful feature of vtap engine is its search capability, where it does an incremental search and you can see results of the typed in query without you clicking on the "Go" button. The search is so good that, I don't have to type in the whole characters of my (current) favourite singer "alizee" to find her videos. All it takes is type up to "aliz" and I can see the results already showing the pretty singer smiling at me.
vtap.com also provides your mobile (iphone, windows mobiles (source available here), large number of web enabled phones and itouch) with this search facility where you can use either a downloadable client or by going to vtap for mobile (http://m.vtap.com). Alas, one feature missing in vtap for mobile is the incremental search, so you have to go "clicky clicky" each time you want to see the results. Over the gprs in India this will really test your patience, talking about rigorous testing. Though at office or home, with those wifi enabled mobile, its a virtue.
Latest news is that vTap is bundled with Motorola mobile phones starting from their latest model MOTO Z10 onwards. I bought a Motorokr E6 recently and now I feel I should have waited a little while more so that I can buy MOTO Z10 with vTap bundled.
If you have a mobile which is supported by vtap and have a data plan activated, do try out vTap. Even with a PC you can use vTap to do more precise search than any other video search feature provides.
Let CamStudio make videos of your computer screen!
Below are two quotes from their home page which caught my eyes.
uno:
CamStudio is able to record all screen and audio activity on your computer and create industry-standard AVI video files and using its built-in SWF Producer can turn those AVIs into lean, mean, bandwidth-friendly Streaming Flash videos (SWFs)
Due:
You can download and use it completely free - yep - completely 100% free for your personal and commercial projects as CamStudio and the Codec are released under the GPL (for more details on this license, click here.)
This was all I wanted to know about CamStudio and there ended my search for a screen capture utility. After installing and trying, CamStudio left me with no reason to hit Google.com for more software of similar nature. I wanted this for giving a video demo configuring route based VPN on our Juniper Netscreen NS25. This proved to be a very handy tool for creating demos and short video tutorials for people who need support beyond voice. I have not tried any feature in CamStudio other than creating a screen shot video. But that was all I wanted and CamStudio did it extremely well in with very simple steps.
I suggest you download and install it. You will never know when you want to tell a video story to someone who has no receptive ability enable by default on his/her ears when it comes to technical trouble shooting.
~
In honour of "nickthegeek" and "windycity" (Project Admins)
Thursday, January 10, 2008
Clean way to get one's network IP address? - comp.lang.python | Google Groups
The best way of finding the IP address using python, that I have seen so far. Look for "Jean Paul Calderone's" post in the below link.
Clean way to get one's network IP address? - comp.lang.python | Google Groups
Here is what he posted.
>>> from socket import socket, SOCK_DGRAM, AF_INET
>>> s = socket(AF_INET, SOCK_DGRAM)
>>> s.connect(('google.com', 0))
>>> s.getsockname()
('192.168.1.113', 43711)
Friday, December 28, 2007
Motorola Rokr E6, made a mistake buying it?
I bought this mobile after a very brief survey on the net. First I bought it for my fiancee and then when I saw it, without thinking much went and bought one for myself. The facts that made me like this phone are,
- being a Linux based phone (E6 is powered by Motorola's custom kernel) I had a hope that we a lot of modified firmware as well as custom kernels which will enhance the phone features etcetera.
- The cheapest touch screen phone AFAIK.
- Had trust with Motorola as I have seen my friend using a moto for over 2 years and we literally played football with that phone. I heard that phone is still working after 5+ years.
Well its been 1 month+ that I am using this phone. I have not done much with this phone except, flashing it once and put a modified firmware which enable a few features in the phone. The firmware which I used is AhMan's Hybrid. You can see the release info and features added in his forum thread. One feature that made me smile wide was that I was able to edit the shortcuts in the home screen. I always wanted to change the FM shortcut to Alarm shortcut.
But...
Should I have bought this phone for the reason that it was running Linux and hence its open source ? Well Motorola is not a sweet and user friendly company as they seems to be (more). Motorola has set up a nice web page which has a FQDN http://opensource.motorola.com. It looks like only the web site has the name open source, not that they have released the source for E6 which, seems from the forum conversation, is licensed under GPL. A Motorola spokesman repeatedly assures that its their obligation to release the code as per the GPL terms blah blah, but seems to be "working on it for eternity". The commitment Motorola has shown in releasing the source for E6 puts me off from thinking that Motorola is a customer/community friendly company. They seems to be more committed to working on newer versions after releasing the E6 and hence there is no update firmware from Motorola for E6. Guess I made a mistake in buying this model without a proper research.
Still...
My phone works as a phone. I can make calls, I can use the camera, I can listen to songs and FM, I can browse the web. So I am not at a great loss, after all, features are a fantasy come true for a day and then you just go back to 'using it as a phone'.
Thursday, December 27, 2007
Benazir Bhutto, featured in history from today.
Zulfikar Ali Bhutto, Benazir's father was former Prime Minister of Pakistan who was executed in 1979 by more or less a politically motivated action directed by the General Muhammad Zia-ul-Haq. Now Pakistan was on the verge of election that this mishap, the demise of the probable Prime Minister of Pakistan occurred. Bad luck for our neighbours ? I say bad luck for the world, as now there seems to be nothing to control the whole country, Pakistan is going to be a feeding ground for terrorism. If a country has only one aim, that is to buy more and more weapons, not to defend itself, but to boast to the neighbours that we are a super power
I do not hope for any improvement in Pakistan's political scene, nor do I hope that the relationship with India would improve in any ways. This is me not being an optimistic, typical Indian, but since I learned the term "terrorism" the same time I learned about Pakistan and for all these years nothing has changed favourable in Pakistan, I am just saying what I feel inside.
(Added on 31st Dec 2007)
It looks like Musharaf and Pakistan government officials should at least learn to lie smartly. Claiming that the Lady was not dead by the shot but due to her head banged on the car roof's lever, ah, they are in an impression that rest of the world are people with their head filled with clay and not grey cells. Government accusing the terrorist and the terrorists denying the accusation, this is a kindergarten play ? WIth a literacy rate of approximately 50%, its understood why this happens in Pakistan. I do not have any interest in the proceedings regarding this, as, if there was anything up to this point, I have lost it. God bless Pakistan.
Jai Hind |
Online PC Scanning resource.
Here are a few sites which offer free Online PC scan for spy wares and other malicious content. I find it useful at times when you suspect that you are infected. In the end its the best practice to buy a anti virus package for your windows machine, this will come handy before something screw your machine.
Microsoft One care PC Scan
Symantec PC Scan (virus and online threats)
McAfee Online PC Scan
Trend Micro Online PC Scan
BitDefender Online PC Scan
Kaspersky Online PC Virus Scan
Panda Security Online PC Scan
F-Secure Online PC Scan
Online File Scanner by Kaspersky
Kaspersky Online File Scan
Free PC scan/security resources
TheFreeCountry.com
Convert -File System- ext2 to ext3
Lets get started.
If you can un-mount the partition which needs the change, perfect. Else you can remount it in
read-only mode
mount -o remount,ro /dev/xxx
If you want to un-mount the partition and it complains that the device/resource is busy, you can use a little brute force to get things done if you are sure nobody else is using it.
lsof | grep "<mount point>" | awk '{print $2}' | xargs kill -9
The above command may disturb other users logged in and if they are using the machine. You should be sure that the machine is not shared with anyone else, hence make sure before you do. If the above trick does not work, you know what it does I hope, hence you can try do it yourself some other way. Once done, you can un-mount the partition. Next step is
tune2fs -j /dev/xxx
This will create ext3 file system in the partition specified. Once this is over "without any errors" you should change the "file system type" in /etc/fstab and make it ext3. Then do a
mount -a
To check whether its mounted properly and the file system type, do
mount
Monday, December 24, 2007
Offline weblog editors
| This is how to start it. Select the tools> Accounts to see the image on the right side. Select "Another weblog service" from the radio selection and click on next. | |
| You will get the the screen on the left after the click on next. Here you have to enter the weblog homepage URL - This is the blog home home page which You want to use. In my case it was http://kryptoz.wordpress.com. Username - Your WordPress username Password - Your password for the WP username. Additionally if you have the option for proxy setup. |
After finishing the mentioned, when you click next, windows live writer will do its part and collect info from the WordPress for your account (styles, posts, keywords, etcetera) and you are ready to blog. There are a few plug-ins for the MS Writer, which are available at gallery@live.com. I did not find any of them interesting for me but, You are not me, so go have a look!
I am planning to use this as my primary weblog editor now. Not that I am a regular blogger, but it makes things easy whenever I want to scribble anything on the blog. Windows Live Writer saves me from, typing in the URL on my Firefox browser Address bar. Though, since I save my username and password in Windows Live Writer, I expected direct access to my dashboard (logged in) when I clicked on my link called "Dashboard" on Windows Live Writer. Currently it opens up WordPress login page. For me that should be okay for now, unless I get more lazy and want the auto login to the dashboard from Windows Live Writer.
Apart from this a few that are in my 'Apps to try' list are...
BlogDesk, Ecto, w.bloggar and QTM
These AFAIK are free tools which runs in either Windows (majority) and Linux (QTM) or both (QTM).