backup all mysql databases

#! /bin/bash TIMESTAMP=$(date +”%F”) BACKUP_DIR=”/home/mysql_backup/$TIMESTAMP” MYSQL=/usr/bin/mysql MYSQLDUMP=/usr/bin/mysqldump MYSQL_USER=”root” MYSQL_PASSWORD=”************” mkdir -p $BACKUP_DIR databases=`$MYSQL -u$MYSQL_USER -p$MYSQL_PASSWORD -e “SHOW DATABASES;” | grep -Ev “(Database|information_schema)”` for db in $databases; do echo $db $MYSQLDUMP –force –opt –user=$MYSQL_USER -p$MYSQL_PASSWORD –databases…

wordpress plugin add custom menu

//add custom menu to backend / admin dashboard add_action(‘admin_menu’, ‘register_my_custom_menu_page’); function register_my_custom_menu_page() { add_menu_page( ‘page title’, ‘menu Title’, ‘manage_options’, ‘my_custom_menu’, ‘my_custom_menu_page’, ”, 101 ); add_submenu_page( ‘my_custom_menu’, ‘page subtitle’, ‘sub menu’, ‘manage_options’, ‘my_custom_submenu’, ‘my_custom_submenu_page’ ); add_submenu_page(…

Programers Jokes

An int, a char and a string walk into a bar and order some drinks. A short while later, the int and char start hitting on the waitress who gets very uncomfortable and walks away….