MySQL is the current database of the hour and has grown steadily over the last few years. With MySQL comes a number of useful tools and one of them is 'mysqldump'.
What is mysqldump? It's an indispenable tool for backing up your vital mysql data. You normally use the tool in the following ways:
mysqldump -u[username] -p[passowrd] [database] [table]
or maybe a more compilcated version such as:
mysqldump -u[username] -p[passowrd] --add-drop-table --all-databases
But what happens if you don't want to dump all the databases or tables,
maybe you want to just dump one row from one table. Looking at the
man page or the help screen for the tools doesn't reveal much.
After digging around for a while I found the following to work:
mysqldump -u[username] -p[passowrd] [database] [table] "--where=id=123" -t
This will just dump out one row from the database and table matching the
where condition. The '-t' option at the end supresses the schema information.
Rutland Penguins runs a number of websites and we also do some consulting for a couple of local companies with their websites. Recently we were asked to come up with a small set of standards for one of our clients and their development team.
As we done this work free of charge, we are releasing this document for all to see. The Coding Standard is specifically for the website layouts that we and our customers use. The base layout source code for all these sites will be made available as soon as we have finalised the polished product.
For us followers of gentoo, a mention in a funny cartoon script: Gentoo Reference and another.
Vim. What a brilliant editor! This is a very powerful editor
but it's a bit like Marmite;
you either love it or hate it!
It's different from nearly all other editors in the way that it works. It doesn't have the usually trappings of a nice user interface (but can have via the Gvim shell). What you get is an almost blank screen where you editing and viewing takes place.
From this blank interface there are three modes of operation: 1. View mode. This is the default mode and you can view the file your working on and do the usual page up and page down stuff. 2. Edit mode. This is where you can edit the text while still moving round. 3. Command line. This mode is where you can enter commands to effect the text and issue commands to vim.
Swapping between modes is normally part of what you are doing and becomes natural with a bit of practise. For example, to go from the view mode to editing mode is just a case of pressing the insert (or 'i') key. To leave this mode you press the ESC key.
The big problem with Vim is that there are a LOT of commands to learn. If you just want a reference of the commands, there are many online references. Here's one that we use: Vim Reference
We use GIT as our source control for all our website content and to manage all our source for projects we work on.
As hardcore Linux buffs, we also use Vim as our editor of choice. This editor, as with most editors, creates temporary work files for each file you are editing and the last thing you need is to have these temporary files being checked into your source control system.
To prevent this from happening in GIT, create a file in your home directory called "~/.gitignore" and place the following inside this file:
.DS\_Store *.sw?After you have saved off this file issue the following command to git:
git config --global core.excludesfile ~/.gitignore
What all this does is to tell GIT to ignore all those temp vim files so they don't get put into the source tree and won't get tracked and checkout to other users when they take a clone for their own use.
Well, we had to do it - this is the Rutland Penguins Blog!
This is really a collection of notes to keep track of what we do on a day to day/week to week basis for our own use. If you find anything of use in here then we are glad to have been of service :)