Posts Tagged ‘sysadmin’

Hard drive fail!

November 30, 2010 Leave a comment

Update:So it turns out that it wasn’t a windows update problem after all. My Samsung hard drive was faulting and had gone bad. Even though the Hard Drive S.M.A.R.T monitor was telling it was bad, there was no monitor on this machine and so I never saw it. Well, I got another WD hard drive over Christmas on Amazon for cheap. Samsung hard drives are no good, it seems. Lasted only as long as the warranty, 3 years.

So, about 1 month ago, I log into my server and see that I got about fifty windows update waiting to be installed. I think, oh what’s the harm and goes ahead and clicks update. And there began my month long attempt to bring this site back up.

First, windows would not boot back up anymore. No safe modes and windows repair couldn’t fix it either. And I think, this is as good a time as any to upgrade to windows server 2008 r2. So I go ahead and install it. I was doing periodic backups of data to another drive and so I didn’t I would lose anything.

But of course, I had never thought to test any of my backups. So, I got myself a brand new windows installation and my sql server database backup is messed up. All of my personal data was safe though. So, what happened was that sql server uses some sort striped multi-file backup mechanism and I only had 1 of 2 files required to restore my blog database. Great! You’ll get a nice little error message talking about having only 1 file out of a media set. You can read a good explanation here.  I’m not sure where the other file got backed up to.

Anyways, so I’ve scraping google and bing cache to get my blog posts back. Lots of fun! Luckily, I didn’t have much posts to begin with, so it isn’t too much work. It just took a month mainly because this has been a pretty tough semester. Machine Learning is not an easy subject and I’ve started interviewing for full-time jobs. Better start early than late. Only 1 more semester to go! Hope to have everything backup in order in 2 weeks. Until then, things are probably going to look a little messy.


Create SVN repositories using a standard folder structure

December 10, 2009 Leave a comment

This is shell script that you can use to create all of your repositories using the same standard folder structure. You need to replace the following variables for it to run:

  1. Replace [name] with the correct username of a user who will have permissions on the repository.
  2. Replace [password] with the correct password of the user
  3. Replace with the path to where your svn repositories are stored

call the script: ./scriptname reponame and it will create a new repository with the name reponame.

Here’s what the script does:

  1. The script creates the new repository folder
  2. It gives apache permissions on the folder. If you are not using apache, uncomment the line.
  3. If you are using an access file to provide fine-tuned directory permissions, you may want to uncomment the two lines that refer to access.txt. Those two lines add the new repo to the access file and gives the admin group rw permissions on the repository.
  4. It then goes and creates the standard folder structure, ie, trunk, branches adn tags folder.
svnadmin create $1;
chgrp -R apache $1;
chmod -R g+rw $1;
#echo "[$1:/]" >> access.txt
#echo "@admin = rw" >> access.txt
svn –username [name] –password [pass] mkdir ""$1"/trunk" -m "ADD: /trunk";
svn –username [name] –password [pass] mkdir ""$1"/branches" -m "ADD: /branches";
svn –username [name]—password [pass] mkdir ""$1"/tags" -m "ADD: /tags";

echo "------------------------------------------";
echo "Standard Repo Layout Created";

Installing SVN server

November 25, 2009 Leave a comment
  1. Install latest Apache http server
  2. Install SVN
    1. Make sure to install mod_dav_svn and mod_authz_svn. mod_authz_svn is only needed if you plan on doing fine-grained directory permissions on your SVN repositories
    2. Load the mod_dav_svn and mod_authz_svn modules in httpd.conf. You may also need to load the mod_dav module if you don’t have it yet:
    LoadModule dav_module modules/
    LoadModule dav_svn_module modules/ 
    LoadModule authz_svn_module modules/ 

    3. Modify apache httpd.conf to add the following:

    <Location svn> 
    DAV svn 
    SVNParentPath D:/svn 
    SVNListParentPath on 
    AuthType Basic 
    AuthName &quot;Subversion Repository&quot; 
    AuthUserFile passwd.txt 
    Require valid-user

    4. You should now be able to browse to your SVN repos at

    5. If you would like to enable anonymous checkouts, replace the Require valid-user above with the following. Check-ins will still require authentication.

    # For any operations other than these, require an authenticated user. 
    Require valid-user

    6. If you are not going to be using per-directory access control, you might as well turn off path authorization (it’s on by default). This improves performance of your server, since its not checking every single path requested to see if the user is authorized to access it. Add this line to turn it off:

    SVNPathAuthz off

    7. Install PHP

    8. Install an SVN browser, WebSVN is the best I’ve seen. It’s built on PHP and works well.

    9. Subclipse is the best SVN client for use with Eclipse IDE

    10. TortoiseSVN is a good SVN windows explorer client

Tags: , ,
%d bloggers like this: