Category Archives: General

SVN: exclude folder from update

I had to checkout a very large repository which included branches, tags and trunk in a subfolder of the project. So checking out the basedir gets all branches and tags which makes SVN very slow. So I was looking for a way to exclude folder from checkout. The following statement makes SVN ignore and delete folders locally but lets them untouched on the server.

svn update --set-depth=exclude <foldername>

After this the folder with name <foldername> is deleted and wont be updated anymore. This is NOT the same as the svn:ignore property!

Openssl

here is a list of often needed openssl commands to work with ssl keys:

  • Create new private key + CSR:
openssl req -new -newkey rsa:2048 -nodes 
  -keyout common_name.key -out common_name.csr
  • Create CSR from existing private key:
openssl req -new -key common_name.key -out common_name.csr
  • Check CSR:
openssl req -text -noout -verify -in common_name.csr
  • Check private key:
openssl rsa -in common_name.key -check
  • Check certificate:
openssl x509 -in common_name.crt -text -noout
  • Remove password from key:
openssl rsa -in common_name.key.bak -out common_name.key
  • Self-sign a CSR
openssl x509 -req -days 365 -in common_name.csr 
  -signkey common_name.key -out common_name.crt
  • Check host certificate:
openssl s_client -connect HOST:PORT

move local git project to gitosis

I use git to share my projects with my workstation and my notebook. So I often start a project locally on one of them and want to continue on the other. Because I’ve already installed a central gitosis server this is no problem. Here is how to move the local project to gitosis after having created it in gitosis-admin:

cd </path/to/project>
git remote add origin git@<domain>:<project>.git
git push origin master:refs/heads/master
cd ..
mv <project> <project>2
git clone git@<domain>:<project>.git
cd <project>

Then check if you’ve configured some maybe needed resources to be ignored and run your tests to verify nothing important is missing. If so there is a backup in <project>2 folder if you haven’t deleted the project instead of renaming it as proposed above.

 

SSH config

If you are using special ports or different usernames on different ssh-hosts you can simplify your connect commands with a .ssh/config file like the one in the following example.

Host test1
    HostName 8.8.8.8
    Port 12345
    User myname
Host test2
    HostName fubuntu
    User horaz
Host *
    User root

ssh test1 equals ssh myname@8.8.8.8 -p 12345. The last entry lets you use root for all other hosts.

Welcome

… to my blog. I am going to publish solutions to everyday problems a system administrator/software developer has to solve. If you have better solutions than mine please don’t hesitate to write a comment or a mail.