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
#!/usr/bin/perl | |
use Net::SMTP; | |
$smtp = Net::SMTP->new($ARGV[0], | |
Hello => 'myserver.app', | |
Timeout => 60, | |
Debug =>1); | |
$smtp->mail('root@myserver.app'); | |
if ($smtp->to('somthing@example.com')) { | |
$smtp->data; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<key name="Software"> | |
<key name="ConEmu"> | |
<key name=".Vanilla" modified="2017-10-28 10:57:45" build="170910"> | |
<value name="StartType" type="hex" data="02"/> | |
<value name="CmdLine" type="string" data=""/> | |
<value name="StartTasksFile" type="string" data=""/> | |
<value name="StartTasksName" type="string" data="{Default Split}"/> | |
<value name="StartFarFolders" type="hex" data="00"/> | |
<value name="StartFarEditors" type="hex" data="00"/> |
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
#Replace $SITE and $CONTENT | |
sshz-site $SITE | |
echo -n $CONTENT > pages/fileauth.txt.html | |
#eg | |
#sshz-site zeald | |
#echo -n 201709190334595r84u8lue4jgdynncckpw7pruhtmj0vrzjtgnm4bgongfb2gc9 > pages/fileauth.txt.html |
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
#To use: | |
# (assuming you trust it): | |
#curl https://gist.githubusercontent.com/jonathonsim/cc286f3baed66faed69e3be2d4608858/raw/ | bash | |
cd ~ | |
chmod 777 ~/bin/* | |
cat > ~/.bash_profile <<'EOF' | |
# source the users bashrc if it exists | |
if [ -f "${HOME}/.bashrc" ] ; then | |
source "${HOME}/.bashrc" |
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
#To run this add something like this to your Vagrantfile: | |
# | |
# | |
# config.vm.provision "shell", inline: <<-SHELL | |
# # Default Vagrant LAMP stack https://gist.github.com/jonathonsim/2cfdafc876984f6a6a0bdb35ebd9a74f | |
# export VAGRANT_DIR=/var/www/html #We mount an nfs share here, along with the regular vagrant share on /vagrant, as nfs is faster. But it has weird behaviour with some apps as well | |
# curl https://gist.githubusercontent.com/jonathonsim/2cfdafc876984f6a6a0bdb35ebd9a74f/raw/ | bash | |
# SHELL | |
# | |
# |
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
#To use: | |
# (assuming you trust it): | |
#curl https://gist.githubusercontent.com/jonathonsim/6a5b25a4bebf2badde9a10740476fc3a/raw/ | bash | |
export DEBIAN_FRONTEND=noninteractive | |
#Use local mirrors | |
echo "deb http://nz.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" > /etc/apt/sources.list && \ | |
echo "deb http://nz.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list && \ | |
echo "deb http://nz.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse" >> /etc/apt/sources.list |
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
#!/bin/bash | |
# Database backup script | |
# | |
#Large tables - we only keep one copy of these | |
export mysql_large_tables="track_page track_visit emails_message_body emails_message_body_new" | |
export dumpopts=" --single-transaction --max_allowed_packet=32M --compact " | |
export mysqldump="mysqldump -Q $dumpopts" | |
export backup_root='/srv/backup/temp-databases' | |
export ldap_dumpall="/usr/sbin/slapcat" |
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
#!/usr/bin/perl | |
# Simple script to cleanup mysql binlogs if you start running out of diskspace. | |
# Running out of diskspace is fatal on a mysql database. But you also want to keep as many binlogs as possible, so when your replication dies | |
# you have time to fix it. This script will delete all logs except 2 if disk space free falls below 6% | |
# | |
# has a few dependencies : to install on debian(ish) systems: | |
# apt-get install libfilesys-diskspace-perl libmime-lite-perl libdbd-mysql | |
# | |
# Add this to cron with something like: |
NewerOlder