Wednesday, February 6, 2013

Creating a Private Git Server

So you want to write some super secret code? You want to keep it off public git servers? This is not as difficult as you might think to do. As a matter a fact if you are committing to git locally in a shell then you already have the git client setup.

I assume you have access to a Ubuntu Linux server that you can spin up or have one laying around your pad.

How do I set up a git server?


  1. Boot up a Linux Cloud Server.
  2. Configure user permissions.
  3. Install git-core.
  4. Profit.

You are probably saying what? That's it? Yup! That's really it to get started.

Boot up a Linux Cloud Server

Now that we have a server we can login and update all the packages.

sudo apt-get update
sudo apt-get upgrade

Alright we will call this server my.gitserver.net


Configure user permissions

To configure the system my suggestion is to create a user called: git 

sudo adduser git

Adding your public key to the server will allow you to bypass using a password.
This can be any username that can log into the server.

Install git-core

sudo apt-get install git-core

Easy right?

Setup git project

Login to the server as the git user and create the project.

ssh git@my.gitserver.net
mkdir super-secret-project.git
cd super-secret-project.git
git --bare init

Profit

So now we need our super secret project on a machine with some commits to push up to my.gitserver.net 

mkdir super-secret-project
cd super-secret-project
git init

We need to add the remote for the server to our local repo now.

git remote add origin git@my.gitserver.net:super-secret-project.git
touch somefile.txt
git add somefile.txt
git commit -m "my first commit to my private git server"
git push origin master

Once we push the code up now that commit is now saved somewhere else. 

Suggestions

  • Always back up your data.
  • Harden the security on your server

Resources:

Making my own Raspberry Pi Case

I soured the interwebs for a good case and decided I wanted to make one myself. "Cheap and easy" right? Well after looking around the Raspberry Pi forums and other sites I found some really interesting ideas like cardboard case, plexi-glass case, thick paper cut out case, 3D printer case, or Altoids case. These are all amazing ideas but the one that I think I can easily do with the supplies I have laying around is the thick paper cut out case.

This case is a downloadable PDF or SVG file that has all the cut out lines you can print on any paper. I decided to print it on some photo paper because its the thickest paper i had near me.

So I printed out the PDF to the paper and used an exacto knife and straight edge (ruler) to cut it out.

This turned out but I needed a fold the edges and I did not have a good way to do this. My wife mentioned we needed to use her crafty tools. And I ended up cutting off an edge instead of making it foldable (So I ruined the joints to glue).

My wife looks at me and said she has a machine that will cut out the image automatically. (Now I feel dumb...)

She has a Silhouette Cameo machine that you can cut out any image you want. How awesome is that right? This is similar to the Cricut but you can create custom images with its Design Studio software and buy single images of the web instead of a cartridge package that you might not use all the images in.

After showing my wife this project she thought this was a great opportunity to start playing with her new toy. This was her first time to create a custom cutout with the Cameo so it took a while to figure out how to use the software. Thanks to some awesome YouTube videos she was in business.

She imported the SVG file into her Design Studio and started some magic! She added a nice little Raspberry Pi Logo to the top air vent.
She needed to do a couple test runs to make sure it was going to look correct.










This turned out alright and she was on to cutting it out on red cardstock. She first printed the image and text on the paper with the registration marks. Then sent the cutout to the Silhouette Cameo. Here is the Silhouette Cameo design cutout file made from the others.

I was satisfied with the out come of the cutout and the box looked pretty awesome.

She was not satisfied yet... She needed to emboss the Raspberry Pi logo with her crafty setup.

This was the final product booting up. What an AWESOME Raspberry Pi case! 


Case Resource links:

In conclusion this case is on the cheap side but not as sturdy as I would like but does its job! I think the next case I will attempt to build is a plexi-glass case to see if it will be more sturdy.

Let me know how this design works out for you.