(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| # transfer your public key to another computer | |
| # variables that need changing marked with <> | |
| public_key_path="<./ssh/machine-2/id_rsa.pub>" | |
| remote_username="<james>" | |
| remote_hostname="<192.168.x.x>" | |
| key=$(cat $public_key_path) && \ | |
| ssh $remote_username@$remote_hostname "echo $key >> ~/.ssh/authorized_keys" | |
Remove any libgit2 packages you already have, otherwise these will be included first and they do not necessarily have everything needed that you need for pygit2/git2go.
sudo apt-get purge libgit2-0 libgit2-dev
From http://www.pygit2.org/install.html
wget https://github.com/libgit2/libgit2/archive/v0.23.4.tar.gz
tar xzf v0.23.4.tar.gz
cd libgit2-0.23.4/
cmake .
| Some Go/Cgo code | |
| go run cgo.go |
| #!/bin/bash | |
| RED='\033[0;31m' | |
| NC='\033[0m' # No Color | |
| # pre-commit hook to check new files are always added to the master branch and deletions are always made in feature branches. | |
| # useful when master should contain all the files ever added (eg. in a media project), and the feature branches can offer 'views' of parts of them | |
| branch_name=$(git rev-parse --abbrev-ref HEAD) |
I'm a developer living/working in Malmö, Sweden. I mostly write in Javascript, some Java and increasingly more Go and Python, and bash when it's needed.
My main interests technologically include web technologies, automation and image processing.
You can find my PGP key on pgp.mit.edu. I try and remember to PGP sign when I tag. You can use git verify-tag to verify the tag! My key ID is 83868A38.
| #!/usr/bin/python | |
| ''' | |
| Tool to find files with the same name within a directory. | |
| Developed to help with detection of unused files that weren't being detected as unused by require.js as they had the same names as other files that were being imported. | |
| usage: | |
| python find-duplicate-filenames.py [path] | |
| options: | |
| path: path on which to look. Defaults to the current working directory. |
| #!/bin/bash | |
| # get the working directory of processes | |
| search_term="$1" | |
| pgrep "$search_term" | xargs -I {} readlink -f /proc/{}/cwd |