Skip to content

Instantly share code, notes, and snippets.

@morganp
morganp / info.md
Last active October 5, 2017 10:48
Matlab Tab competion for user functions
@morganp
morganp / info.md
Created August 7, 2017 08:10
Fixing OS X local permissions for successful back up and restore.

Remove local .DS_Store

find . -name '.DS_Store' -type f -delete

Remove file lock permissions (Perforce)

sudo chflags -R nouchg ~/Documents

Code plan has not restored correct user.

@morganp
morganp / info.md
Last active July 19, 2017 11:38
OS X Sierra Kindle book (azw) location

Kindle.app downloads DRM'd books to this location

"~/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/My Kindle Content/"

@morganp
morganp / guitar.md
Created March 28, 2017 14:33
Notes On practicing Guitar

Video

Justin Guitar

Practice

Use Metronome for equal not spacing. practice scale, then increase speed 5-20bpm.

Software

@morganp
morganp / tips.md
Last active March 27, 2017 08:31
Bash and (G/M)vim Tips

Bash: Backspace word ctrl-w
Vim Folding start {{{ end }}}
Vim Folding Open All zR
Vim Folding Close All zM
Vim list current Colorscheme echo g:colors_name

@morganp
morganp / crontab
Created October 16, 2016 14:56
Crontab with rvm
SHELL = /home/lounge/.rvm/bin/rvm-shell
# Minute Hour Day Month Day of Week Command
# (0-59) (0-23) (1-31) (1-12) (0-6)
0,15,30,45 * * * * /bin/bash -l -c 'cd /path/to/script && ./run_script’
@morganp
morganp / smart.md
Created September 9, 2016 21:58
Get SMART disk info OS X
@morganp
morganp / spreadsheet.md
Last active September 8, 2016 21:52
Lightweight spreadsheet for OS X

https://userbase.kde.org/Calligra/Download#Mac_OS_X

For KDE Home brew https://github.com/adymo/homebrew-kde edit .bashrc

export KDEDIRS=$KDEDIRS:$HOME/Library/Preferences/KDE:/usr/local/kde4
export PATH=/usr/local/kde4/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/kde4/lib:$DYLD_LIBRARY_PATH
launchctl setenv DYLD_LIBRARY_PATH /usr/local/kde4/lib:$DYLD_LIBRARY_PATH
export XDG_DATA_HOME=$HOME/Library/Preferences/KDE/share

export XDG_DATA_DIRS=/usr/local/kde4/share:/usr/local/share:/usr/share

@morganp
morganp / git-cdc.sh
Created September 4, 2016 17:38
Change date on git commits
#!/bin/bash
# commit
# date YYYY-mm-dd HH:MM:SS
# http://stackoverflow.com/a/24584976/97073
# git cdc @~ "2014-07-04 20:32:45"
#Reset commit before HEAD
#commit="$1" datecal="$2"
#temp_branch="temp-rebasing-branch"
#current_branch="$(git rev-parse --abbrev-ref HEAD)"
@morganp
morganp / transmission_end_seed.sh
Last active June 12, 2024 05:34
Script Transmission to remove torrent, and move data after specified time
#!/usr/bin/env bash
# Remove torrents from Transmission after a set number of days.
# Life cylce is: Incomplete -> Completed & Seeding -> Completed & removed for client
# In part based on:
# https://community.wd.com/t/guide-auto-removal-of-downloads-from-transmission-2-82/93156
SERVER='192.168.0.29'
DAYS=21
# Turn Days into Seconds
REMOVE_AFTER=`expr $DAYS \* 24 \* 60 \* 60`