Using Terminal Screen Command

This is a simple one. For some reason, every time I use the screen command in terminal, I forget the commands.

There are probably lots of cool reasons to use screen but I use it to run a script over a longish period. The advantage of screen is I can start the script in the screen instance and detach from it. I can close my laptop and return later to my terminal, open my screen and check the progress of the script. Also, you can run multiple instances of a script as each screen has its own process.

So the basic commands I use and tend to forget are… Continue reading “Using Terminal Screen Command”

Javascript library to manage Flash Local Stored Objects

In an earlier post, I explained how to use Javascript to talk to a Flash file to create and read Local stored objects, a.k.a. Flash cookies.

The only hitch I met was that I couldn’t create cross domain cookies this way as I was hitting the same domain policy. However as pointed out in the comments, it is possible, and simple too… I just needed to add… Continue reading “Javascript library to manage Flash Local Stored Objects”

Microsoft SQL Service Broker

What is Microsoft’s SQL service broker?
Its a message queuing platform on Microsoft’s SQL Server. It allows you to queue up jobs for the database to deal with asynchronously.

Why use it?
I’m no DBA, but in my case, I was working with a database server that was at full tilt and there was work that it could be handle asynchronously to spread the load. So there was data that needed processing but it did not need to be handled immediately, like data for some reports. This data could be placed on a queue to be processed by the database server in it’s own good time, evening out the demands on the server.

How does it work?
Well its pretty straightforward yet it looks a bit ridiculous written down. I think this because as a platform it can handle a lot of data messaging scenario’s and as such the syntax and examples usually given are quite generic.

Here’s the official guide, happy mining through all that!

You can find better ones here and here.

Now for my explanation… Continue reading “Microsoft SQL Service Broker”

Use a PuTTY generated key on Mac OSX

I wanted to use the key I generated using the PuTTYGen tool on my windows laptop, on my now repaired Mac Pro. The standard PuTTY generated key will not work on Linux or Mac OSX, so the key needs to be converted into a standard that will, like OpenSSH. You can convert your key by using the ‘Export to OpenSSH’ option explained in a previous post.

Once you have your new private OpenSSH key, copy it to your Mac.

Open terminal, and go to your root… usually does this automatically, but type cd ~/ just in case.

Create a .ssh directory if it does not already exist and copy the private key in here.

You may need to check that the key has the right permissions, type chmod -R g0-rx ~/.ssh

Enter your ssh command, ssh and hit enter, you should get now have a SSH tunnel to your server.

HANDY TIP: use the vvv flag to debug the ssh command¬† (looks odd but thats 3 v’s by the way!).

So type ssh -vvv to receive a load of debug info that can be really useful in determining where you are screwing up.

Also I found this guide useful.

How to SSH into remote database from Windows

If you find yourself with a bust Mac and you have to fall back on your old ‘reliable’ windows laptop. You need to connect to your development web server using SSH, where do you start… I’ll tell you where, Google, or you may find this guide of some use.

So firstly, I need to set up PuTTY, a free and open source terminal emulator that will allow me to SSH into my remote web server.

Download PuTTY here.

Once downloaded, I need to generate a public/private key to authenticate the SSH connection from my machine to the web server.

Use another tool – PuTTYGen to generate the keys for you.

Download PuTTYGen here.

Here’s a pretty straightforward guide that I cannot be arsed to repeat on how to create the key. One difference for me was we use DSA encryption.

HANDY TIP: If you wish to use this key on a Mac (like I did once it was repaired) so that you can connect from either machine (windows or mac), then do the following.

Once you have your key created you need to export the key as an OpenSSL key and save it for later.

On with the guide…
Continue reading “How to SSH into remote database from Windows”