I find returning to terminal after a break from programming that the simple things sometimes are lost. This document's goal is to capture these, even if otherwise trivial.
$ /bin/ls . | wc -l
Boot into single-user mode (hold ⌘-S during startup) | |
Once the command-line prompt appears, type the following: | |
mount -uw / | |
rm -R /Library/Preferences/ | |
rm -R /Users/your username/ | |
cd /var/db/dslocal/nodes/Default | |
ls to list the files |
I find returning to terminal after a break from programming that the simple things sometimes are lost. This document's goal is to capture these, even if otherwise trivial.
$ /bin/ls . | wc -l
==== SSH keygen for github
https://help.github.com/articles/generating-ssh-keys#platform-mac
http://software.clapper.org/cheat-sheets/mac-os-x.html https://github.com/hjuutilainen/dotfiles/blob/master/bin/osx-user-defaults.sh
<meta content="width=device-width, initial-scale=1.0 maximum-scale=1.0 user-scalable=0" name="viewport" /> | |
<meta content="apple-mobile-web-app-capable" content="yes" /> |
I hereby claim:
To claim this, I am signing this object:
These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).
First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter
(2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.
Finally all remaining files are listed using git ls
, the files to keep are removed from that using grep -v
and the resulting list is passed to git rm
which is invoked by git filter-branch --index-filter
(3.). A bit convoluted but it does the trick.
#!/bin/bash | |
# ~/.dotfiles/.brewfile_local.sh -- loaded by ~/.bashrc for private data, | |
# an example for my github.com/christophera/dotfiles project | |
# | |
# ~/.bash_profile.local is sourced by ~/.bashrc for shell code which will be | |
# .gitignored and thus not be backed up into the .dotfiles repository. | |
# Load on a new machine via: |
file=$(mktemp); curl -s "$url" > $file; $EDITOR $file; sh $file; rm $file | |
curl $URL | ( cat > $HOME/tmp/source; read REPLY; [[ ! $REPLY =~ ^[Yy]$ ]] && cat $HOME/tmp/source ) | sh ; rm $HOME/tmp/source | |
#need some cross platform way to hashpipe check. | |
if [[ `uname` == 'Darwin' ]]; then | |
alias sha256sum='openssl dgst -sha256' | |
fi |
Apple's iMovie saves its Projects and Events files as folders named "/Documents/Movies/iMovie\ Events", "/Documents/Movies/iMovie\ Projects". You are not able to change this location using the app, however, you can use iMovie to move these folders to an external drive. On that drive, both of these folders MUST be at the root, i.e. "/Volumes/Footage/iMovie\ Events" and "/Volumes/Footage/iMovie\ Projects". If you open iMovie while an external drive has these folders at root, iMovie will automatically add them to its event and project library.
Unfortunately, you can't do this trick with network volumes by default. You can do some tricks with symlinks but when using them across volumes they are unreliable and iMovie will loose track of information.