Skip to content

Instantly share code, notes, and snippets.

@morganp
morganp / info.md
Last active Oct 5, 2017
Matlab Tab competion for user functions
@morganp
morganp / info.md
Created Aug 7, 2017
Fixing OS X local permissions for successful back up and restore.
View info.md

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 Jul 19, 2017
OS X Sierra Kindle book (azw) location
View info.md

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 Mar 28, 2017
Notes On practicing Guitar
View guitar.md

Video

Justin Guitar

Practice

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

Software

@morganp
morganp / tips.md
Last active Mar 27, 2017
Bash and (G/M)vim Tips
View tips.md

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 Oct 16, 2016
Crontab with rvm
View crontab
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 Sep 9, 2016
Get SMART disk info OS X
View smart.md
@morganp
morganp / spreadsheet.md
Last active Sep 8, 2016
Lightweight spreadsheet for OS X
View spreadsheet.md

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 Sep 4, 2016
Change date on git commits
View git-cdc.sh
#!/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 Sep 4, 2016
Script Transmission to remove torrent, and move data after specified time
View transmission_end_seed.sh
#!/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`