GIT Clone someone else's repository

Instructions copied from https://stackoverflow.com/questions/18200248/cloning-a-repo-from-someone-elses-github-and-pushing-it-to-a-repo-on-my-github

  1. Create a new repository at github.com. (this is your repository)
    • Give it the same name as as the other repository.
    • Don't initialize it with a README, .gitignore, or license.
  2. Clone the other repository to your local machine. (if you haven't done so already)
  3. git clone https://github.com/other-account/other-repository.git
  4. Rename the local repository's current 'origin' to 'upstream'.
  5. git remote rename origin upstream
  6. Give the local repository an 'origin' that points to your repository.
  7. git remote add origin https://github.com/your-account/your-repository.git
  8. Push the local repository to your repository on github.
  9. git push origin master

Now 'origin' points to your repository & 'upstream' points to the other repository. But if someone else now checks out this repository from your repository it won't have a link back to the original repository. If this is the case, create a new link to 'upstream' that points to the original repository with the following:
git remote add upstream https://github.com/other-account/other-repository.git

It's best to make changes to the code in a new branch. Create a new branch for your changes with
git checkout -b my-feature-branch
You can git commit as usual to your repository. When you want to pull changes from the original repository to your master branch use the following
git pull upstream master

Subversion and GIT servers

http://www.svn-access-manager.org/
and
http://www.isi.edu/~gideon/gitweb.html
and gitlab

Auto Updates for Redhat

http://linuxaria.com/pills/enabling-automatic-updates-in-centos-6-and-red-hat-6

Raspberry Pi Wifi Setup

This website was the most helpful
https://www.raspberrypi.org/forums/viewtopic.php?t=26795
and this helped to make sure it could reconnect all the time
http://docs.brewpi.com/installing-your-pi/rpi-setup.html

Anonymous upload to Google Drive

Clever way to upload files to Google drive, fairly anonymously.
http://lifehacker.com/allow-others-to-upload-files-to-your-google-drive-with-1567528648

Mounting a Windows Shared Folder with Write Permissions

Use the following commands
sudo mount.cifs //COMPUTER_NAME_OR_IP/FOLDERNAME /PATH/TO/MOUNT/LOCATION/ -o user=USERNAME,iocharset=utf8,file_mode=0777,dir_mode=07‌​77
These were learned from the following two websites:
http://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/
http://askubuntu.com/questions/72471/correct-way-of-mounting-a-windows-share

Latex Markup

When submitting a revised paper, I only want to show the new text not the deleted text.

This can be accomplished by running the latexdiff command on the two files and then adjusting some commands in the preamble to be
\providecommand{\DIFdel}[1]{} % Don't show deleted text
\providecommand{\DIFadd}[1]{{\color{blue}\uline{#1}}}

rsh

I found a great article on setting up rsh here: http://people.redhat.com/kzak/docs/rsh-rlogin-howto.html

Webserver Pref Pane

In newer versions of OS X, apparently the web sharing disappears. This can be added back using a prefpane from this link: http://clickontyler.com/blog/2012/02/web-sharing-mountain-lion/

SVN Server on Mavericks - OS X Server

Great instructions here http://pablotips.blogspot.com/2013/12/install-svn-on-mac-os-x-again-this-time.html

First run this
xcode-select --install
Then get the matching version of subversion already installed
Then run these
./configure
make
sudo cp subversion/mod_dav_svn/.libs/mod_dav_svn.so /usr/libexec/apache2/.
sudo cp subversion/mod_authz_svn/.libs/mod_authz_svn.so /usr/libexec/apache2/.
and then run these
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_repos-1.0.dylib /usr/local/lib/libsvn_repos-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs-1.0.dylib /usr/local/lib/libsvn_fs-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_fs-1.0.dylib /usr/local/lib/libsvn_fs_fs-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_util-1.0.dylib /usr/local/lib/libsvn_fs_util-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_delta-1.0.dylib /usr/local/lib/libsvn_delta-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_subr-1.0.dylib /usr/local/lib/libsvn_subr-1.0.dylib
# Optional ? sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_wc-1.0.dylib /usr/local/lib/libsvn_wc-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_client-1.0.dylib /usr/local/lib/libsvn_client-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_diff-1.0.dylib /usr/local/lib/libsvn_diff-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra-1.0.dylib /usr/local/lib/libsvn_ra-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_local-1.0.dylib /usr/local/lib/libsvn_ra_local-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_neon-1.0.dylib /usr/local/lib/libsvn_ra_neon-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_serf-1.0.dylib /usr/local/lib/libsvn_ra_serf-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_svn-1.0.dylib /usr/local/lib/libsvn_ra_svn-1.0.dylib
Also note that if you are using OS X Server, the httpd.conf file in /etc/apache2 is no longer used. Rather, all the configuration files are located in /Library/Server/Web/Config/apache2 (Or something very close to this). Therefore, all the httpd-svn.conf and other files must be placed in the Other folder inside this directory.

Here are a few links that I found helpful when setting things up
https://discussions.apple.com/thread/5283885
http://superuser.com/questions/691808/how-to-customize-mavericks-mac-osx-server-apache-configuration
http://support.apple.com/kb/ht4813

Opening a Port in the Firewall

Instructions found here http://www.cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables/

Linux Cheat Sheet

I found a cool cheat sheet at this website http://linoxide.com/linux-command/linux-commands-cheat-sheet/ Here is a PDF version


Matlab Mex with XCode 4

Some settings have to be changed to get matlab to work with XCode 4.  I found good help here.

http://stackoverflow.com/questions/12643236/matlab-2012a-mex-to-work-with-xcode-4-5-on-mountain-lion

run a single script as root user

The following text is take from http://askubuntu.com/questions/167847/how-to-run-bash-script-as-root-with-no-password
There is a very neat trick in every Linux which will allow you to do so. It is called the SetUI bit.
Keep in mind that you will need to have the permissions locked down tight in this file for this to be secure.
Make the file owned by root and group root:
sudo chown root.root <my script>
Now set the sticky but, make it executable for all and writable only by root:
sudo chmod 4755 <my script>
Keep in mind if this script will allow any input or editing of files, this will also be done as root.
The SetUID bit makes a script or binary always run as the owner of the file/binary, an example of such a binary is 'passwd'.
There is a solution using sudoers here is an example you could use:
Cmnd_Alias        CMDS = /path/to/your/script

<username>  ALL=NOPASSWD: CMDS
Now just place sudo in front of your script and it should run without asking for a password.

Sending mail from the command line

I found a nice tutorial here: http://www.simplehelp.net/2008/12/01/how-to-send-email-from-the-linux-command-line/

OSX Quicklook for other file types

Here's a hack to allow this
https://coderwall.com/p/dlithw

make file

Here's a great tutorial on writing a make file, http://mrbook.org/tutorials/make/

SVN Repository Migration 2

You can merge several repositories by importing a dump into a specific directory with the following command
svnadmin load --parent-dir trunk /Repositories/RaGMirror < Ra.dump
This imports all of the previous revisions as new commits in the repository into which it is being loaded.  These notes come from here.

httpd auth

The following instructions are for providing authorization to an svn repository and come from the SVN Redbean book.
First, create a password file and grant access to users Harry and Sally:
$ ### First time: use -c to create the file
$ ### Use -m to use MD5 encryption of the password, which is more secure
$ htpasswd -c -m /etc/svn-auth.htpasswd harry
New password: *****
Re-type new password: *****
Adding password for user harry
$ htpasswd -m /etc/svn-auth.htpasswd sally
New password: *******
Re-type new password: *******
Adding password for user sally
$
It's important to remember that -c is only used the first time to create the file.

Intel Compiler

./configure CC=icc CXX=icpc F77=ifort FC=ifort