The scribble pad of doom

Month

March 2011

2 posts

Copying a MySQL database between servers over SSH

Usually when I need to copy a database from one spot to the other I log into the server that has the original database and then SSH the data to the server that is supposed to have it:

mysqldump source_database source_table | ssh user@host mysql target_databases

However in this case I couldn’t get the server to connect to another server via SSH, so the command changes slightly. Instead we log into the receiving server and change our command to pull the data to us from the original database.

ssh user@host "mysqldump source_database source_table" | mysql target_database
Mar 27, 201132 notes
#Database #MySQL #SQL #SSH
Setting up a SMTP server for debugging

I wrote a client that was sending emails over SMTP server and needed to debug it, but didn’t want muddle my way through setting up an actual SMTP server. Instead I found two convenient options. The first is to use python where you can starts a dummy SMTP service that prints to stdout with:

sudo python -m smtpd -n -c DebuggingServer localhost:25

Another option is to sign up for http://dummysmtp.com that offers a free dummy SMTP server, showing the emails on the web interface.

Mar 27, 201118 notes
#Debugging #DummySMTP #Email #Python #SMTP
Next page →
2011 2012
  • January 1
  • February
  • March 1
  • April
  • May
  • June 1
  • July
  • August
  • September 1
  • October
  • November
  • December
2010 2011 2012
  • January
  • February 1
  • March 2
  • April 3
  • May 3
  • June
  • July 2
  • August
  • September
  • October
  • November
  • December
2010 2011
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August
  • September 4
  • October 2
  • November 6
  • December 7