Saturday, May 28, 2011

I hate scripting but love it when it saves time!!

During undergrad, I got addicted to Unix. Since then I became fond of scripting. Though recently I have started using Windows OSs my scripting habits could not be repressed. I reproduced them in the form of batch/cmd scripts.

I have attached approximately 86 scripts with this post and some reusable executable components that help these scripts. I’m putting a compendium here if it comes handy. Here is indeed a big list, but I shall be brief:

1. Get the pronunciation for specified word and play it with media player: getword.cmd

2. Change PC configuration to specified host ip: hack_isp.cmd

Very intelligent script! You'll feel the hack when you understand this one.

3. Install windows updates using patches from specified folder:  install_patches.cmd

4. Switch between ISPS: intconf.cmd

This script is indeed useful in my office!

5. Want to join chromium development? Look at these: ChromeDev_init.cmd & ChromeDev.cmd

6. Open a customized Cygwin prompt: Cygwin_init.cmd & Cygwin.cmd

7. Script includes all steps necessary to compile opengl files when you have windows sdk and glut installed: oglcl.cmd

Are you a opengl programmer? You’d like the last script. But you need to know more about cl

8. Share folder in network using net share command; delete them: addshares.cmd, delshares.cmd

9. Change IP Address of local area connection: change_ip.cmd

10. Change DNS servers for local area connection: change_dns.cmd

11. Check all drives of my hard-disk and shut the pc down: check & down.cmd

12. Display reminders in message box: displaymsgdone.cmd

13. Incomplete Windows Script for rapidshare link downloads: dnrssingle.cmd


Fig: Scripting guy rocks his baby with script :P Know more


14. Open Jar files: ejar.cmd

15. Generate java bytecodes from java sources and run: Ejava.cmd, Ejavac.cmd 

16. Extract single lines from file: file_var.cmd

17. Sink down in disguise: flush_os.cmd

Longtime ago I was doing some assembly programming. Here are those scripts: MASM_Init.cmd, masm32_cls.cmd, MASM32_Init.cmd, mpl.cmd. If you need more help on assembly look here.

18. Wait for specified timer interval and then notify on top of all windows: mdelay.cmd

19. Open any file with notepad++: npp.cmd

20. Create installer from installer script: nsis.cmd

21. Create new source file and open with visual studio: ocf.cmd

22. Rename all other extension files i.e.; .dat to .mpg: 

23. Rename_others_to_mpg.cmd

24. Vista won’t boot because you just reinstalled mbr. So repair it: Repair_vistabootmgr.cmd
25. Start, stop, web services (apache, php, mysql): samp.cmd

It’s my version of web server integrating them manually.

26. Want to just ping using the host id: like your ip is 10 so you type sping 10: sping.cmd

27. Stop mssql services consumes too much CPU; start: StopServicesMSSQL.cmd, StartServicesMSSQL.cmd

28. Shutdown PC when specified file is downloaded completely: stdn.cmd

29. Get an svnadmin prompt: svnadmin_init.cmd and svnadmin.cmd

30. Open a stable svn client: SVNDev_init.cmd, SVNDev.cmd

I was using svn of depot clients from chromium. Now I am using CollabNet for svn(certified binaries).

31. Force Windows Media Player to shutdown: wmpkill.cmd

Video players sometimes won’t hang! That won’t happen!


32. This script enables Integrate Internet Download Manager integration after a specified amount of time and then disable on press key: afd.cmd

I filled bug report to them; they said they will fix the integration problem in next release but Chrome was constantly crashing! Still the script works.


33. Change MAC Address of Network Interface: change_mac.cmd

34. Get HTTP header for any website: checkheader.cmd


Download script files here. You'll find some shortcuts in the folder which directly points to different applicaiton to assist on commandline. For example, try command excel.lnk in cmd.

That’s too much incentive today! If you are in confusion about any script, leave in comments. Some other day I’ll talk about another technology for scripting which you already know: Powershell.

Thanks for visiting.

Attached file with this post: saos-scripts-0.99.zip

Friday, May 20, 2011

PingGuin, Net Notifier Software


Software is about making life easier. It's right that to check whether internet is available we make command line ping requests. To know whether the connection is really active we can just ping to www.anydomain.com i.e; www.saosx.com. Whenever this ping fails we ping to our default gateway to check whether gateway is reachable. A gap between the host and gateway will result unreachability to web servers. When gateway is reachable we further need to check whether DNS servers are reachable. So we need more two pings. I always thought about automating these tasks. I have once indeed written a script that does all these works. Well, that's another story.

I wanted to create a software for general people who can use this tool to automate the ping process to all three servers (gateway, pri dns, sec dns) . Moreover, I implemented feature to show balloon tips on the taskbar notification area whenever internet is available.

I have made attempts to make the software as user friendly as possible. When start the software the initial dialog box is shown which has a static box that updates whether internet is available or not. In that window I have enabled automatic retrieval of network interface settings so that user don't have to go through tedious typing everytime he/she starts the software.


It is really amazing that the entire internet is running on kindness and openness of people. Why not I contribute some from my side! That's the reason behind my delivering of this software as open-source. Together we make a better world. I don't want others to go through same tedious procedure during building components for my software. You can straight visit my project source code here:
http://code.google.com/p/pingguin/source/browse/#svn%2Ftrunk

 It's an opensource project. You have freedom to use my code. But please acknowledge me and my project in comment. I will also welcome anyone to contribute in this project. Contribution can be of many forms. May be pointing out a bug, suggesting features that should be included in the future release or working with the code directly and improving the quality of work.

I would like to acknowledge my endless debts to msdn, microsoft forums, codeproject and all the forgotten resources of internet that helped me to get new ideas and develop and nourish them. msdn is Microsoft Developer Network and forum for VC++ is available here: http://social.msdn.microsoft.com/Forums/en/category/visualc while codeproject is an awesome website for helping developers across many programming languages and frameworks.

Native Software developers can take help on following topics from my this project:
  1. Standard mechanism of accessing Windows Management Instrumentation information
  2. DNS Lookup and PING API (alway check msdn for reference)
  3. Showing Balloon Tips and adding icon in the taskbar
  4. Displaying menu from resource using tray icon
  5. Creating Windows Threads using structure
  6. Unicode string manipulation (using tchar library)
  7. Creating Installer for Native Software (see PingGuin_Installer in the svn trunk)
I'm building an API for network tools and parsing other types of information some of which release under project sasubsync, Wireshark Parser, Stutdown Timer, Blogger Code editor etc. A compendium will be provided in my site in future. So in related topics you are welcome to take help. If some code isn't available you can ask me.

By this time when I'm writing this post this software is available for Windows only. I'm checking user responses. According to that I'll decide whether to release for other platforms. You can download installer of pingguin for windows from here:
http://code.google.com/p/pingguin/downloads/list


This software is built in my off-time (killing my traveling time, yeah I call this little exploring in this universe as traveling, you can't sue me until you're oracle! :P). Hence, this software has still no relation with my software company, Reve Systems. It's all about pingguin, a net notifier software. You are welcome to visit: http://code.google.com/p/pingguin/

Wednesday, January 19, 2011

How to Install UniBijoy in Avro Keyboard 5.1.0

We talked about Avro Keyboard 4.5.3 and how to use UniBijoy layout with it the other day in this post. Today I’ll tell you how to use Unibijoy keyboard layout with Avro Keyboard 5.1.0. Avro Keyboard 5.1.0 comes with some new features i.e, Bangla spell checking, new user interface.


  • Download Unibijoy keyboard from this link (right click the link and click save as): http://archive.saos.co.in/Downloads/UniBijoy.avrolayout

  • After downloading the keyboard layout copy it to avro’s keyboard layout folder: C:\ProgramData\Avro Keyboard\Keyboard Layouts.

    If you are using Windows XP you have to put it in following folder: C:\Documents and Settings\All Users\Application Data\Avro Keyboard\Keyboard Layouts

  • Now exit avro keyboard and start again. Select UniBijoy from Keyboard Layout menu.


That's all. Now you can start typing Bangla with any application that supports Unicode.