This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gracefulStop = make(chan os.Signal) | |
signal.Notify(gracefulStop, syscall.SIGTERM) | |
signal.Notify(gracefulStop, syscall.SIGINT) | |
go func() { | |
sig := <-gracefulStop | |
fmt.Printf("caught sig: %+v", sig) | |
fmt.Println("Wait for 5 second to finish processing") | |
time.Sleep(5 * time.Second) | |
os.Exit(0) | |
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208 | |
# Configuration name server generated for [email protected] at 2018-06-10 10:08:14 | |
[mysql] | |
# CLIENT # | |
port = 3306 | |
socket = /var/lib/mysql/mysql.sock | |
[mysqld] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################################### | |
# File name: my.ini | |
# Created By: The Uniform Server Development Team | |
# Edited Last By: Mike Gleaves (ric) | |
# V 1.0 24-7-2016 | |
######################################################################## | |
[mysql] | |
default-character-set=utf8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$binPhash = base_convert($phash, 16, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func addToLog(text string, logfile string) { | |
f, err := os.OpenFile(logfile, os.O_APPEND|os.O_WRONLY, 0600) | |
if err != nil { | |
panic(err) | |
} | |
defer f.Close() | |
if _, err = f.WriteString(text); err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int32(time.Now().Unix()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#- if use a different port, change the port. | |
rsync -av -exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} -z --rsh='ssh -p22' --delete --progress --exclude [email protected] /local/destination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//this: https://help.directadmin.com/item.php?id=589 | |
$dirs = scandir('/home/'); | |
shuffle($dirs); | |
$ignoreDirs = [ | |
'.', | |
'..', | |
'tmp', | |
'ftp', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Clean database. Truncates all tables except from everything that loads with fixtures. | |
* Used as a fast clean. | |
*/ | |
public function cleanDB() | |
{ | |
$excludeTables = array(); | |
$em = $this->em; | |
$connection = $em->getConnection(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#repeat x times | |
#run 5 ls - runs ls 5 times | |
function run() { | |
number=$1 | |
shift | |
for n in $(seq $number); do | |
$@ | |
sleep 1 | |
done | |
} |
NewerOlder