Skip navigation

If you often switch between machines (like a laptop and desktop), and want to work on the same application, here’s what you need to do on the second machine.

Clone the Project

If the project doesn’t exist on your second machine, clone the Git repo first.

git clone git@bitbucket.org:my_username/my_project.git

Link the Project

Next link the existing application folder to your Heroku remote:

git remote add heroku git@heroku.com:my_project.git

If you want to use the Heroku CLI, do this:

heroku git:remote -a my_project

Add the SSL Keys for the New Machine to Heroku

heroku keys:add

Resources:

http://stackoverflow.com/questions/5129598/how-to-link-a-folder-with-an-existing-heroku-app

So I needed to add myself and another user to the “admin” and “wheel” groups on my work machine, since I was only part of the work domain group. A quick google search reminded me of the “dseditgroup” command.

sudo dseditgroup -o edit -a usernametoadd -t user admin
sudo dseditgroup -o edit -a usernametoadd -t user wheel

Source:

  • http://superuser.com/questions/214004/how-to-add-user-to-a-group-from-mac-os-x-command-line

You may run into the time when you need to remotely log off another user from a machine. If you have an Admin account and SSH, there are a few commands you can use to kill the “LoginWindow” process, which in turn kills all processes for that user (and essentially logs them out). This is not a clean method, but gets the job done.

ps -Ajc | grep loginwindow
sudo kill -9 <pid>

Reference:

  • http://superuser.com/questions/40061/what-is-the-mac-os-x-terminal-command-to-log-out-the-current-user

Leading a busy life, there are definitely things I want to experiment with when I get a free moment… Since I already use Private Internet Access as my private VPN Service, I think it would be great to have this work on my Raspberry Pi device!

Here are two articles that first show how to connect to your VPN service, and then modify your init.d file to make sure it loads on Pi startup:

  • https://dotslashnotes.wordpress.com/2013/08/05/how-to-set-up-a-vpn-private-internet-access-in-raspberry-pi/
  • https://dotslashnotes.wordpress.com/2013/08/07/how-to-run-a-command-automatically-at-system-boot-in-raspberry-pi-linux/

Happy Pi Day.

When zipping up a file in MacOS, you can often be found including an unwanted .DS_Store file. Use this option to make sure it doesn’t exist in your .tar.gz file.

tar --exclude='*DS_Store' -zcvf random_number_generator.tar.gz random_number_generator
a random_number_generator
a random_number_generator/interface.json
a random_number_generator/random_number_generator.json
a random_number_generator/random_number_generator.py

You will notice the folder will not contain the .DS_Store file.

This is an essential plugin to install, if you use the command line for your Git operations:

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

Then modify your .profile or .bash_profile:

if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi

References:

– http://apple.stackexchange.com/questions/55875/git-auto-complete-for-branches-at-the-command-line/55886#55886

Found these awesome GIT resources for doing presentations or slides…

  • http://lab.hakim.se/reveal-js – Reveal JS
  • http://imakewebthings.com/deck.js/ – Deck.JS
  • https://slides.com/ – A commercial host for Deck.JS
  • http://bartaz.github.io/impress.js – Impress.JS – 3D and seems to be the best
  • http://strut.io/ – A commercial editor for Impress.JS

Git-Logo-White

 

Deleting a file or folder from git uses the rm command.

  • Delete the folder locally and remotely.
git rm dist
git commit -m "Removing distribution files from repo."
  • Delete the folder ONLY from the remote branch:
git rm --cached dist
git commit -m "Removing distribution files from repo."

References:

StackOverflow saves the day again:

  • http://stackoverflow.com/questions/2047465/how-can-i-delete-a-file-from-git-repo

 

Git-Logo-White

This is a great article on the Git Branching Model.

http://nvie.com/posts/a-successful-git-branching-model/

Basically, all development work should be done on a separate branch off the master, which we would call “develop”. Any features would be branches off develop and merged back to develop once tested and complete.

Atlassian also describes several Git models, with the branching model also explained:

https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow/

Git-Logo-White

 

Deleting a remote branch seems is easy.

  • First, delete the branch locally.
git branch -d feature-to-delete
  • Next, delete the branch remotely by “pushing” the deletion.
git push origin --delete feature-to-delete
  or
git push origin :feature-to-delete

Note that doing a push to delete a remote branch deletes the remote-tracking branch (there are actually 3 branches when a local branch has a remote), so no pruning is necessary.

Pretty easy right!

Things to note: the -d will give you a warning if the branch has not yet been merged. The -D option will do a force deletion and you may lose your un-merged changes.

References:

This StackOverflow article has a lot of good answers:

  • http://stackoverflow.com/questions/2003505/delete-a-git-branch-both-locally-and-remotely