Skip to content

Instantly share code, notes, and snippets.

View alessandro-fazzi's full-sized avatar
🇺🇦

Alessandro Fazzi alessandro-fazzi

🇺🇦
View GitHub Profile
@alessandro-fazzi
alessandro-fazzi / wpinstall.sh
Created June 15, 2012 14:10
Install latest WordPress release in a specific path wigth a single command
#!/bin/bash
#Install latest WordPress release in a specific path
#and don't bother any more! :)
if [[ ! $1 ]]; then
echo "Please, pass to me destination path as first argument! :)"
exit 1
fi
path=$1
@alessandro-fazzi
alessandro-fazzi / custom_registrations_hooks.php
Created June 8, 2012 10:56
Wordpress Custom registration form width connected custom user profile's meta
<?php
/*
* Queste action aggiungono nel profilo utente i campi personalizzati.
* L'HTML è ovviamente da personalizzare a piacere.
* $user è una variabile passata in automatico dalla action di WP.
* 'custom_info' è la parte personalizzabile...si dovrebbe capire come e dove ;)
***/
add_action( 'show_user_profile', 'my_show_custom_user_info' );
@alessandro-fazzi
alessandro-fazzi / chef-server-virtualbox-bootstrap.sh
Created December 27, 2011 11:04 — forked from bmarini/chef-server-virtualbox-bootstrap.sh
Quick start to setup a chef server on virtualbox (debian)
#!/bin/bash
#
# Install virtualbox:
# - http://www.virtualbox.org/wiki/Downloads
# - Download iso: http://releases.ubuntu.com/10.10/
# - Create a new virtualbox using the iso as the install media
# - Change network adapter to bridged
# - Use ifconfig to get ip address
#
# Once you have a clean install of debien...
@alessandro-fazzi
alessandro-fazzi / bkpdb.conf
Last active September 28, 2015 17:38
Automate dayly/monthly backup of mysql and pgsql dbs
#Inizializzo l'array con tutti i nomi dei DB che mi interessano.
#+Inserire tra le parentesi tonde il nome del database da backuppare
#+rigorosamente uno per riga
#DB MySql
#E' possibile qui usare "all" come magic word per includere tutti i DB presenti. "all" va usata comunque come prima dell'elenco o meglio come unica
dbarray_mysql=(
foo
bar
)
@alessandro-fazzi
alessandro-fazzi / processcontrol.sh
Created July 9, 2011 16:33
Watch number of instances of a process and restart it if greater than x
#!/bin/bash
initscript="/etc/init.d/myprocess"
mail=$(which mail)
destinatario="[email protected]"
oggetto='Mail subject'
data=$(date)
limite=190 #must be an integer
process="" #if the process to restart differ from the name of the initscript, then set it here
#if $process isn't set than we set with the same name of the initscript
@alessandro-fazzi
alessandro-fazzi / sysusrmaildel.sh
Created July 9, 2011 15:26
A script to delete a GNU/Linux system user with his home dir and his system mailbox. Previously backed up
#!/bin/bash
#Aggiungere variabili configurabili
saved_dir=/root/saved
#Stampa l'utilizzo dello script
usage(){
echo -e "Utilizzo: `basename $0` username"
exit 1;
}