Archive for the ‘Freelancing’ Category.

How to remove .svn folder

Windows:

Save the following to the folder to clean to a filename with a .cmd extension (cleansvn.cmd).  After that issue the command, eg., C:\www>cleansvn

for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *svn') do ( rd /s /q "%%i" )

Linux: 

Cleaning a svn folder:

find . -name .svn -exec rm -rf {} \;

Using svn export:
Export from your working copy (doesn’t print every file and directory):

$ svn export a-wc my-export
Export complete.

Export directly from the repository (prints every file and directory):

$ svn export file:///var/svn/repos my-export
A my-export/test
A my-export/quiz

Exported revision 15.

Vi is misbehaving with my arrow keys!

(Note: The following blog entry is for Linux users and may not be of any use to Windows users.  No discrimination intended.)

In my earlier days, I always use nano as my editor of choice whenever I’m on a Linux console because it is easier to use by a person accustomed to using Windows. Later, I have adjusted myself and found vi interesting and easier to use! Ever since, I am solely a vi user until I encountered a difficulty running vi on my hosting server.

The problem is that whenever I open or create a file and start using the arrow keys, I instead got the following:

Up arrow outputs “A” + next line
Down arrow outputs “B” + next line
Right arrow outputs “C” + next line
Left arrow outputs “D” + next line

By googling, I found the solution on Digitalblueprint. So it’s basically creating or editing the .vimrc file on your home folder. Linux home folder is your default folder after logging in to your Linux computer and you can return to the home folder from anywhere by entering the cd, change directory, command without any parameter.

Here’s what you need to have on your .vimrc file:

filetype plugin on
filetype indent on
syntax on

Also after this fix, you would see the normal status messages that shows – INSERT –, – REPLACE – on the bottom of the screen.

Happy vimming!

Tired of entering you svn password everytime?

I have set up svn repositories on dedicated Linux server of my clients but the constant typing of svn password everytime I access the repository makes life for a developer less livable. Until I found the solution…

So here it is, follow the step and hurray!

  1. Generate an SSH key pair of your Linux workstation so that you can set up automatic authentication (no more password asking). If you’ve already generated a DSA key pair, skip to step 2. Open a Terminal window. (On OS X, you can find this in /Applications/Utilities/Terminal)
    ssh-keygen -b 1024 -t dsa

    Do not enter a passphrase. Hit enter when prompted for one.

  2. Execute the following to display your public key:
    cat ~/.ssh/id_dsa.pub

    Copy the output to the clipboard.

  3. Log into your Server’s account’s shell via SSH. Once you’re logged in, execute
    cd .ssh

    If the directory doesn’t exist, create it:

    mkdir .ssh
    cd .ssh
  4. Execute the command
    vi ~/.ssh/authorized_keys

    Hit i to enter Insert mode and then paste your public key (if there is already a key in this file, move to the bottom before pasting). Hit the ESC key to leave Insert mode and type :wq and hit enter to save and exit vi.

That’s it, no more password typing while doing your svn stuff.  Go ahead and try your svn commands.

Tortoise guide to do the same on Windows.