Restoring a MySQL table back to the database
When we need to restore a single MySQL table from big data MySQL backup. Most modern text editors should be able to handle a text file that size, if your system is up to it....
When we need to restore a single MySQL table from big data MySQL backup. Most modern text editors should be able to handle a text file that size, if your system is up to it....
You can use the Adafruit ATMega32u4 breakout board as an Arduino Leonardo by flashing the bootloader in Arduino 1.0.1 to the board. To follow this process, you use another Arduino, like the Arduino Duemilanove, as a...
Simple shell script to backup MySQL databases.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
#!/bin/bash # Simple script to backup MySQL databases # Parent backup directory backup_parent_dir="/var/backups/mysql" # MySQL settings mysql_user="root" mysql_password="" # Read MySQL password from stdin if empty if [ -z "${mysql_password}" ]; then echo -n "Enter MySQL ${mysql_user} password: " read -s mysql_password echo fi # Check MySQL password echo exit | mysql --user=${mysql_user} --password=${mysql_password} -B 2>/dev/null if [ "$?" -gt 0 ]; then echo "MySQL ${mysql_user} password incorrect" exit 1 else echo "MySQL ${mysql_user} password correct." fi # Create backup directory and set permissions backup_date=`date +%Y_%m_%d_%H_%M` backup_dir="${backup_parent_dir}/${backup_date}" echo "Backup directory: ${backup_dir}" mkdir -p "${backup_dir}" chmod 700 "${backup_dir}" # Get MySQL databases mysql_databases=`echo 'show databases' | mysql --user=${mysql_user} --password=${mysql_password} -B | sed /^Database$/d` # Backup and compress each database for database in $mysql_databases do if [ "${database}" == "information_schema" ] || [ "${database}" == "performance_schema" ]; then additional_mysqldump_params="--skip-lock-tables" else additional_mysqldump_params="" fi echo "Creating backup of "${database}" database" mysqldump ${additional_mysqldump_params} --user=${mysql_user} --password=${mysql_password} ${database} | gzip > "${backup_dir}/${database}.gz" chmod 600 "${backup_dir}/${database}.gz" done |
Example output (with mysql password stored inside script):
1 2 3 4 5 6 7 8 9 10 11 |
$ sudo mysql_backup.sh MySQL root password correct. Backup directory: /var/backups/mysql/2012_11_20_20_56 Creating backup of "information_schema" database Creating backup of "notes" database Creating backup of "dokuwiki" database Creating backup of "kalkun" database Creating backup of "mysql" database Creating backup of "performance_schema" database Creating backup of "semantic" database Creating backup of "wordpress" database |
Download IR remote library from the following link
1 |
https://github.com/shirriff/Arduino-IRremote |
Unzip the download.Rename it as IRremote and put it in arduino’s libraries folder. To detect the remote Set up a TSOP sensor like the...
avrdude: stk500_recv(): programmer is not responding In Debian squeeze and Ubuntu you may get an error like this while trying to upload your program…..To fix this error First install arduino software with all its...
Arguably, Microchip’s PIC microcontrollers do not get enough posts here. One of the drawbacks for some of us is that Linux support for PICs is not very well known. The information is out there,...
In this post I will outline the process I used to setup a streaming usb webcam with a web server running php on a TPLink TL-WR703N running OpenWrt. Webcam First we will setup the...
In this post I will show you how I connected an Arduino Uno to my TPLink TL-WR703N running OpenWrt Backfire via the USB port. One thing to note is that it is much easier to...
This is how I used a Tplink MR703 running OpenWrt Backfire to forward the serial port with the Arduino Uno to a telnet port. This could be used as a cheap alternative to an ethernet...
The iotop command is top like utility for disk I/O. It watches I/O usage information output by the Linux kernel (requires v2.6.20 or later) and displays a table of current I/O usage by processes...
ESP8266 / How to Linux / IOT / nodemcu
Install ESP8266 SDK toolchain on Linux (Ubuntu 14.10 Desktop)
17 Sep, 2015