Archive for the 'Open Source' Category

Running Bash Scripts in Windows Scheduler

Normally you can run scripts in the Cygwin shell. But I wanted to run a bash script in Windows scheduler. Find the Cygwin.bat file probably located in C:\cygwin. It looks something like this.


@echo off

C:
chdir C:\cygwin\bin

bash --login -i

This batch file doesn't let you run an external script with it. Add a %1 at the bash command's end like this. What you are doing is passing the first parameter in Windows to bash.


@echo off

C:
chdir C:\cygwin\bin

bash --login -i %1

Now drag and drop the Cygwin.bat file into the Windows scheduler window and edit running time properties etc. Now add the script to run at the end of the Cygwin command. For example like

C:\cygwin\Cygwin.bat ./bin/mysql/db.dilantha.info.sh

Windows Scheduler

Technorati Tags: ,

PHP for Developers

I like to follow up on Why You should learn PHP by rumblinglankan.com which talks about PHP for bloggers and extend it for programmers in general.

I was a full blown Java developer back in the day. I knew many developers who stuck to their guns and did one thing like Oracle, Java or .NET and said it would never go away and there would always be a market for it.

Well things change. Windows administrators are learning Linux, VB6 guys probably moved to VB.NET etc. If you sit still your skills will become obsolete.

A few years ago I saw the potential of PHP. It was simple to learn widely deployed on the Internet. I started building some Intranets with it, thinking I can move some of that logic out to a website later.

That was back in 2005. Now more than 50% of my work day is PHP, MySql, drupal, Code Igniter, WordPress or something other than Java. If I locked myself into Java I wouldn't have got most of the projects or opportunities I got.

Now I use PHP from writing system scripts to extending drupal. I'm also thinking about trying PHP GTK to write a Windows GUI application.

Look around and try something. Software is always changing, try to keep up. :)

Technorati Tags:

File Sharing Between Linux and Windows

I wanted to backup from my work (Windows) box to my personal (Linux) box. I found these useful videos on setting up Samba file sharing. This first guy was right I didn't know about the extra configuration changes.

http://screencasts.ubuntu.com/SAMBA_Filesharing

Funny story. I did all this and didn't see the Linux box on the network. Hmm that's strange. I opened Firefox on Ubuntu to find no Internet either! With a quick glance at the back of the computer I saw the network cable was not plugged in. :)

I need to get another network cable for the mac. I keep switching between them.

Here is the Ubuntu Wiki page for Samba. Which has more details.

Technorati Tags: ,

Drag and Drop from Eclipse Navigator

Eclipse Navigator

My primary editor is Eclipse, EasyEclipse for PHP flavor to be exact. I usually open another few Windows Explorer windows to move files around.

Today out of shear laziness I dragged a file from Eclipse Navigator to my open WinSCP tab in the task bar and into the remote site. It worked! That's my tip.

Configure Pidgin for Google Talk

Still on Pidgin in case you didn't know already you can use it to chat with your Gmail buddies as if you are logged onto the Gmail website or using Google Talk.

How do I configure Pidgin for Google Talk?

Technorati Tags: ,