I hereby claim:
- I am johanmeiring on github.
- I am johanmeiring (https://keybase.io/johanmeiring) on keybase.
- I have a public key whose fingerprint is 5572 17A5 BD5B 42C9 71B0 D40F A5CA 6E4F CBA6 3188
To claim this, I am signing this object:
| # Ubuntu / Debian: | |
| export PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]`[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "\[\e[31m\]" || echo "\[\e[32m\]"`$(__git_ps1 " (%s)\[\e[00m\]") \[\e[00m\]\$ ' | |
| # OSX: | |
| export PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]`[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "\[\e[31m\]" || echo "\[\e[32m\]"`$(__git_ps1 " (%s)\[\e[00m\]") \[\e[00m\]\$ ' |
| #!/bin/bash | |
| # Disk space checking script. | |
| # Version 0.2 | |
| # All of the below parameters can be overriden via command line arguments. | |
| # Minimum disk space that should be available, in kilobytes. | |
| THRESHOLD=20971520 | |
| # Partition/Filesystem that we should check. | |
| PARTITION="/dev/md1" | |
| # Email address that mail should be sent to. |
| <?php | |
| /* From: http://www.php.net/manual/en/function.str-getcsv.php#88773 and http://www.php.net/manual/en/function.str-getcsv.php#91170 */ | |
| if(!function_exists('str_putcsv')) | |
| { | |
| function str_putcsv($input, $delimiter = ',', $enclosure = '"') | |
| { | |
| // Open a memory "file" for read/write... | |
| $fp = fopen('php://temp', 'r+'); | |
| // ... write the $input array to the "file" using fputcsv()... | |
| fputcsv($fp, $input, $delimiter, $enclosure); |
| # From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html | |
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" |
| #!/bin/bash | |
| # MySQL Replication Status Checker | |
| # This script will run the SHOW SLAVE STATUS query on the specified server, and then report it if Last_IO_Errno or Last_SQL_Errno do not equal 0. | |
| # Most effective when used as a cron job that runs once every minute. | |
| # Version 0.1 | |
| # DB Info | |
| DBHOST=localhost | |
| USERNAME=root | |
| PASSWORD=lolololol |
| #!/bin/bash | |
| DEST=/root/BACKUPS | |
| # Code to actually create backup files goes here... | |
| # Check if we need to rotate the backup files. | |
| FC=`ls ${DEST}/*.tar | wc -l` | |
| if [[ $FC -gt 6 ]]; then | |
| echo "Too many backup files. Deleting oldest one..." | |
| DELETE_FILE=`ls -tr ${DEST}/*.tar | head -1` |
| #!/bin/bash | |
| for file in $(\ | |
| find . -maxdepth 1 -type d | \ | |
| egrep -v "\.$" | \ | |
| sed -r 's/\.\///'); do | |
| python manage.py schemamigration $file --auto | |
| done | |
| exit 0 |
| #!/bin/bash | |
| COUNTER=1 | |
| rm ips | |
| while [[ $COUNTER -lt 255 ]]; do | |
| ping 192.168.254.$COUNTER -c 1 -W 1 && echo "192.168.254.$COUNTER" >> ips | |
| COUNTER=$(( $COUNTER + 1 )) | |
| done |
| from django.db import models | |
| from django.utils import timezone | |
| from django.contrib.auth.models import BaseUserManager, AbstractBaseUser, PermissionsMixin | |
| class UserManager(BaseUserManager): | |
| def create_user(self, email, first_name, surname, password=None): | |
| if not email: | |
| raise ValueError('Users must have an email address') |
I hereby claim:
To claim this, I am signing this object: