quarta-feira, 19 de julho de 2017

MySQL Backup and Restoration Scripts

#!/bin/bash
PASSWORD=XXXXXX
HOST=XXXXXX
USER=XXXXXX
DATABASE=databasename
DB_FILE=dump.sql
EXCLUDED_TABLES=(
table1
table2
table3
table4
tableN   
)

IGNORED_TABLES_STRING=''
for TABLE in "${EXCLUDED_TABLES[@]}"
do :
   IGNORED_TABLES_STRING+=" --ignore-table=${DATABASE}.${TABLE}"
done

echo "Dump structure"
mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} --single-transaction --no-data ${DATABASE} > ${DB_FILE}

echo "Dump content"
mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} ${DATABASE} --no-create-info ${IGNORED_TABLES_STRING} >> ${DB_FILE}

Original source: https://stackoverflow.com/questions/425158/skip-certain-tables-with-mysqldump/425172

quarta-feira, 12 de julho de 2017

Restrict users from changing the wallpaper in Windows

Navigate to the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Policies\System
Create a new string value called "Wallpaper" and set it to the full path and filename of the image.
Additionally, to specify the display style, create a new string value called "WallpaperStyle" and set it to either "0", "1" or "2" according to the list below.
  • 0 - Centered (Default)
  • 1 - Tiled
  • 2 - Stretched
NOTE: You may need to restart Windows for the changes to take effect.
Original Source: https://support.microsoft.com/en-us/help/555429