This is a super simple command but there is something about the following sequence of characters that I simply cannot retain in my brain.
Continue reading “Debugging PHP by monitoring errors in terminal”
Gem from the UrbanGiraffe blog.
To close a frozen SSH connection, just type in the following order…
Continue reading “Close a frozen SSH connection”
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”
Here is a short one to get me blogging again.
The hosts file is a plain text file that the operating system uses to link host names to IP addresses. When you are developing in a sandbox environment, you can place host names in this file to direct your browser to the IP address of your sandbox. Continue reading “Edit your Host File on Mac or Windows”
If you have ever deployed code from a SVN repository with a bug in it and you need to revert to a working revision then you may find the following handy.
First find the revision numbers for the file(s) in question.
Use the log command to get the info from previous commits including revision numbers.
So something like… Continue reading “Revert or rollback a SVN revision”
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”
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 firstname.lastname@example.org 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 email@example.com -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.
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”