Skip to content

Instantly share code, notes, and snippets.

@ledger123
ledger123 / webmon.sh
Created December 8, 2020 03:00 — forked from starsinmypockets/webmon.sh
Website monitor
#! /bin/bash
##
# Quick and dirty website monitor
#
# add to cron:
# */5 * * * * $HOME/webmon.sh >> $HOME/logs/user/cron.log 2>&1
##
if curl -s http://website.org | grep -q "Page title";
@ledger123
ledger123 / mysql_backup.sh
Created April 7, 2019 02:39 — forked from chill117/mysql_backup.sh
Bash script to perform backups on one or more MySQL databases.
#!/bin/bash
#
# Use this script to perform backups of one or more MySQL databases.
#
# Databases that you wish to be backed up by this script. You can have any number of databases specified; encapsilate each database name in single quotes and separate each database name by a space.
#
# Example:
# databases=( '__DATABASE_1__' '__DATABASE_2__' )
@ledger123
ledger123 / backup_mysqldb.sh
Last active October 2, 2019 02:51 — forked from skarllot/backup_mysqldb.sh
Bash script to backup all mysql databases thru mysqldump
#!/bin/bash
# Destiny folder where backups are stored
DEST=/tmp/bacula/server01
CURRDATE=$(date +"%F")
# Hostname where MySQL is running
HOSTNAME="srv-mysql"
# User name to make backup
USER="root"
@ledger123
ledger123 / wp.sh
Created December 7, 2018 16:54 — forked from FeChagas/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "Instalador de Wordpress"
echo "============================================"
echo "Host do Banco de dados: "
read -e dbhost
echo "Nome do Banco de dados: "
read -e dbname
echo "Usúario do Banco de dados: "
@ledger123
ledger123 / create-mysql.bash
Created November 26, 2018 16:20 — forked from askz/create-mysql.bash
Simple bash script to create mysql db, user with generated password
#!/bin/bash
# The script will fail at the first error encountered
set -e
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
@ledger123
ledger123 / pgx.rst
Created July 17, 2016 10:25 — forked from runekaagaard/pgx.rst
Bash scripts for extracting individual databases from a sql file dumped using pg_dumpall

Postgresql Xtra commands

  • pgx_list_dbs: Lists the names of databases in an .sql file dumped using pg_dumpall.
  • pgx_extract_db: Extracts a single database from a sql file dumped with pg_dumpall and outputs its content to stdout.

Installation