I hereby claim:
- I am powellc on github.
- I am secstate (https://keybase.io/secstate) on keybase.
- I have a public key ASBxgRKwG3tnw7tfdz9pf0b2oIvtQrkboSA3EbFL7aDObQo
To claim this, I am signing this object:
#!/bin/bash | |
# Location to place backups. | |
backup_dir="/var/backups/databases/" | |
nightly_dir="/var/backups/databases/latest/" | |
#String to append to the name of the backup files | |
backup_date=`date +%d-%m-%Y` | |
#Numbers of days you want to keep copie of your databases | |
number_of_days=15 | |
databases=`psql -l -t | cut -d'|' -f1 | sed -e 's/ //g' -e '/^$/d'` | |
for i in $databases; do if [ "$i" != "postgres" ] && [ "$i" != "template0" ] && [ "$i" != "template1" ] && [ "$i" != "template_postgis" ]; then |
#!/usr/bin/env bash | |
#just want to post something!!!!!! :D | |
sudo pkg install node www/npm git gmake wget | |
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash |
import re | |
import os | |
import git | |
semver_pattern = '(?:(\d+)\.)(?:(\d+)\.)(?:(\d+))' | |
BASE_DIR = os.getcwd() | |
g = git.cmd.Git(BASE_DIR) | |
commits = list(filter(None, g.log("--format=%B").splitlines())) |
xrandr --output HDMI-0 --rate 60 --mode 1360x768 --fb 1360x768 --panning 1360x768* --output HDMI-0 --mode 1360x768 --same-as VGA-0 | |
xrandr --output HDMI-0 --set underscan on | |
xrandr --output HDMI-0 --set "underscan hborder" 40 --set "underscan vborder" 25 |
I hereby claim:
To claim this, I am signing this object:
# Path to your oh-my-zsh installation. | |
export ZSH=~/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="agnoster" | |
# Uncomment the following line to use case-sensitive completion. |
#!/usr/bin/env bash | |
# Path to the bash it configuration | |
export BASH_IT="/home/powellc/.bash_it" | |
# Lock and Load a custom theme file | |
# location /.bash_it/themes/ | |
export BASH_IT_THEME='powerline' | |
# Your place for hosting Git repos. I use this for private repos. |
def add_view(self, request, form_url='', extra_context=None): | |
save_as_new = request.POST.get("_saveasnew", '') | |
if extra_context is None: | |
extra_context = {} | |
# keep the save as new in case of validation errors | |
extra_context['save_as_new'] = save_as_new | |
# but if it is a real new addition, remove _saveasnew from POST | |
if not save_as_new and '_saveasnew' in request.POST: | |
del request.POST['_saveasnew'] |
#!/bin/bash | |
export PASSPHRASE=your_gpg_passphrase | |
export AWS_ACCESS_KEY_ID=your_s3_access_key | |
export AWS_SECRET_ACCESS_KEY=your_s3_secret | |
export MYSQL_PASSWORD=your_mysql_password | |
for DB in app_1 app_2 app_3; do | |
mysqldump -h localhost -u backup_user -p${MYSQL_PASSWORD} ${DB} | gzip > /var/dbdumps/${DB}.sql |
Discovered a pretty huge caveat to using Johnny Cache to speed up Django ORM queries.
Johnny Cache is a really great library that can speed up Django sites that are slowing down with large joins and complex data models. Django has a built in ORM caching mechanism, but Johnny Cache takes it one step further.
That said, there are some monsters in the undiscovered ocean. One of the big ones is,