Thursday, September 1, 2011

Go back in time with Version Control

Like everybody else, you probably have things that you wish you could go into the past and meddle with. While you can't do that in real life. It's possible to on a computer using Version Control software.

Version Control is a fairly simple topic at it's most basic form, and can grow into something much more complex for larger scale projects. At it's simplest, after saving a file, and you're happy with it's current contents, you create a version, which should you need to, you can revert back to. Creating a new version is almost like saving the file(s) using a different file name each time you want to, but it's all managed behind the scenes. The files are stored in a repository, and the SVN software knows how to read the changes made to each file in each revision.

My software of choice is Subversion (abbreviated SVN) purely because it's what I was taught to use, and I understand it, there are others out there (GIT for example). What you'll need is a SVN server (can be your own computer, or an actual webserver) to manage the repository, and your computer with some SVN software on it.

It works by keeping the master copy of the repository on the server, with all of the revision changes, and you "check out" the most recent or HEAD version to your computer. Lets get started with creating a repository to store school documents.

If you don't have it installed already you'll want to install subversion.
$sudo apt-get install subversion

After that installs, we'll want to get started on creating the server side of the repository. I'm going to call mine School_Notes. I like to keep my repositories in the user folder. So lets get there first.
$cd ~/

If you intend to have more than one different repository, it's useful to have them organized in a folder. Lets make one:
$mkdir repositories && cd repositories

We're now ready to create the repository.
$svnadmin create School_Notes/

That wasn't too bad, 4 commands to get started, now lets get some documents there.

Lets navigate to somewhere to keep our local copies somewhere else.
mkdir ~/svn/ && cd ~/svn

Now we're in the folder where we will keep our local files, we need to check out a copy from the server (another folder on your computer at this point) to get access to versioning.
$svn co file:///home/USER_NAME/repositories/School_Notes/ School_Notes/

This will check out Revision 0 of school notes into your SVN file. 6 commands and we're almost done.

Let's say we've added the file Notes.txt, and the folder New_Folder. We now need to add these to the items to be checked in. This only needs to be done when you first create a file.
$svn add *

* tells SVN to add everything in this tier of files to the repository. Alternatively you could type
$svn add Notes.txt
and
$svn add New_Folder

SVN will prompt you saying:
A      Notes.txt
A      New_Folder

At this point these changes haven't been saved (called committing) to the master copy yet. We can do this by typing
$svn ci

ci is short for Commit. A terminal based text editor is now brought up. It will show the files you are updating, as well as a place where you can make comments. Press CTRL-x when you are finished, it will ask where to save, just press enter, this is a temporary file anyway. It will now upload these files to the server (the other folder on your computer)

And you're done! Now each time you make a change to the file Notes.txt, or any other files you have added, you can commit those changes, and then go back to that revision at any time.

You can just re-check out the repository to a different folder with a -r REV_# flag, and it will create the folder as it looked at that revision.

Now, next time you accidentally delete a file, or mess up a program so bad that you need to get it back, you can do it in no time.



Sunday, August 28, 2011

What it's all about

What is life about?
Why are we here?
What are we supposed to do?
How are we supposed to live?

I think everybody asks themselves, or others those question at least once in their life. If everybody was created, what were we created for? The answer is you were created with a specific plan and purpose for your life, and you were created by a God that loves you more than you could ever imagine, more than you could ever fathom, more than you could ever dream of. God is real, He's reaching out His arms to you right now, waiting for you to accept His embrace, His grace. Life is about what He did for you, why He gave His son for you, and what you do with that knowledge.

Ephesians 2:8-10 says:
"For it is by grace you have been saved, through faith—and this is not from yourselves, it is the gift of God— not by works, so that no one can boast. For we are God’s handiwork, created in Christ Jesus to do good works, which God prepared in advance for us to do."
We are saved by God's grace, not through anything that we can do. None of us can say that we on our own have earned righteousness and earned salvation. He was, is, and always will be the winning bidder.  He paid the highest price possible, His son, Himself, in the flesh, on the cross. He created us, knit us together, assembled the pieces, breathed his breath into our lives.


It's like building a computer, you put everything together, but even the best hardware, the fastest processor, the largest hard drive, the biggest fans, the most efficient power supply, the biggest case, is all useless without an operating system, without software, without something to guide each and every part to work, so are we without God. Psalm 127 says 
"Unless the LORD builds the house, the builders labor in vain." 
Unless God builds our lives, we labor in vain. Philippians 1:6 gives us the hope though,
"He who began a good work in you will carry it on to completion until the day of Christ Jesus"
 God started the work when he knit you together in your mothers womb, and He won't be finished with the work until He takes you home. He will use every event in your life, from the smallest encounter of saying hello to somebody in passing, to the lowest points when it seems as if the world around you is falling down on your head, to the times that you feel as if you are on the top of the world. Each of those events can and will be used, to spread His glory, His Kingdom, His Love. He has given His all for us, and with His help, we can give our all to Him.