Executing MySQL Queries and Commands from the Command Line to a Remote Server

Following are a couple of ways to execute SQL on a remote MySQL server via the shell.

Executing SQL directly from the command line:

$ mysql -u uid -p -h remote.host database -e ‘SQL query here;’

Executing SQL from a file on the local host on the remote server:

$ mysql -u uid -p -h remote.host database < file.sql

You can also connect to the remote mysql server and from the command line execute SQL from files on the local → Continue reading “Executing MySQL Queries and Commands from the Command Line to a Remote Server”

Executing Dynamically Generated SQL Queries from a Shell Script

Following is how to generate dynamic SQL in a shell script and then execute those queries.

Let’s say, for instance, that you have a list of tables that you want to flush regularly during development and don’t want to type in the SQL queries each time.  Moreover, you just want to maintain a list of the table names and add and remove from it when necessary and have your script dynamically generate and execute the delete statements.

For the purposes → Continue reading “Executing Dynamically Generated SQL Queries from a Shell Script”

Send a Text Message To Your Cell Phone From E-mail

This might be old news but I came accross this today and wanted to make a note of it for myself for future reference.

All that you need to do is address the message to the phone number @ the service prodivers designated domain that they use to convert and forward the message content to your mobile device.

What I see interesting in this is being able to send txt messages from a system or service that encounters an error → Continue reading “Send a Text Message To Your Cell Phone From E-mail”

Setting Up Android SDK and Plugin in an Existing Install of Eclipse

To set up an existing install of Eclipse to do some Android development do the following:

  • Go to http://developer.android.com/sdk/index.html and look for and download the ADT bundle for your OS (in my case I was using Fedora Core 18 at the time)
  • Unpack it as the user that is going to be running Eclipse and/or after you unpack it make sure that your user has read/write/execute permissons for the files in this directory (obviously, you don’t need execute permssion for
Continue reading “Setting Up Android SDK and Plugin in an Existing Install of Eclipse”

Showing Hidden Files and Folders Under Mac OSX

By default the Mac hides a number of different Folder as well as any file or folder that starts with a “.” character.

To show all of these files/folders in the Finder open a terminal and enter teh following commands:

$ defaults write com.apple.Finder AppleShowAllFiles TRUE

$ killall Finder

The Finder should restart and you should be able to see all of the files and folders on the machine.→ Continue reading “Showing Hidden Files and Folders Under Mac OSX”