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
(define (square x) | |
(* x x)) | |
> (square 3) | |
9 | |
> (sin 2) | |
#i0.9092974268256817 | |
> (max 1 2) | |
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
#List vms | |
VBoxManage list vms | |
#get status of time sync | |
VBoxManage getextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled | |
#NOTE: Make sure to restart the VM after changing these settings. | |
#disable time sync | |
VBoxManage setextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1 |
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
#remove old git remote branches | |
git remote prune origin --dry-run | |
git remote prune origin | |
#fancy git log | |
git log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%an%d%Creset %s %Cgreen(%cr)%Creset' --date=relative | |
#alias, put in ~/.gitconfig | |
#[alias] | |
# lg = log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%an%d%Creset %s %Cgreen(%cr)%Creset' --date=relative |
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
#you will most likely need to sudo these commands | |
#add 14 days | |
date -s "14 day" | |
#subtract 14 days | |
date -s "-14 day" | |
#set date to something specific | |
date -s "02/28/2013 08:24:14" |
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 | |
# dump restore in one command | |
ssh -C {ssh.user}@{remote_host} mysqldump -u {remote_dbuser} --password={remote_dbpassword} \ | |
{remote_dbname} | mysql -u {local_dbuser} --password={local_dbpassword} -D {local_dbname} | |
# grab a backup zip | |
ssh -C {ssh.user}@{remote_host} mysqldump -u {remote_dbuser} --password={remote_dbpassword} \ | |
{remote_dbname} | gzip > {dbname}.sql.gz |
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
# osx | |
ack -l "ReplaceMe" | xargs sed -i "" "s/ReplaceMe/withMe/g" | |
# linux | |
ack -l "ReplaceMe" | xargs sed -i "s/ReplaceMe/withMe/g" | |
#amember | |
ack --php -l "Release: 3\..\..PRO \(.Revision\: .*\)" | xargs sed -i "" "s/Release: 3\..\..PRO.*$/Release: xxxxxxxxxxxxxxxxxxx/g" |
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
#disable | |
launchctl unload "$HOME/Library/LaunchAgents/cx.pow.powd.plist" | |
#enable | |
launchctl load -Fw "$HOME/Library/LaunchAgents/cx.pow.powd.plist" |
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
error_reporting(E_ALL); | |
ini_set('display_errors', '1'); |
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
ls | xargs du -hs | sort -nr |
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/env bash | |
cat {{web_logs}}/access.log | sort -k1 | awk '{print $1}' | uniq -c | sort -k 1 -nr | head -n 20 |
OlderNewer