Archive for the ‘Linux’ Category

How to fix sshfs “Connection reset by peer”

Sunday, November 16th, 2008

Clear out the /etc/hosts.deny file on the destination server

Also, make sure these lines are uncommented in your sshd_config file on the destination server:

/etc/ssh/sshd_config:
Subsystem       sftp    /usr/libexec/openssh/sftp-server
DenyGroups nossh

Faster File Copy Using Tar and SSH

Thursday, October 2nd, 2008

How to quickly copy a file or directory over SSH using tar:

tar -cf - myfile | ssh target_host tar -xf -

If you want to change the target directory, use this:

tar -cf - myfile | ssh target_host “cd /target_dir; tar -xf -”

How to SVN merge directories recursively

Thursday, September 25th, 2008

The correct way to recursively merge two branches using Subversion:

svn merge target_dir@revision source_dir@revision working_dir

Notice:

  • working_dir is most likely the target_dir
  • target_dir comes before source_dir
Use this example when you’re in the working directory you’re trying to merge into:

svn merge .@head source_dir@head .

After merging, you’ll want to check that the merge succeeded:

diff -u –recursive source_dir target_dir

Change file permissions in Subversion

Wednesday, September 24th, 2008

propset svn:executable “*” myfile.txt

Copying directory trees with tar pipe tar

Friday, September 5th, 2008

# tar cf - source_dir | ( cd target_dir && tar xBf - )

How to setup a basic SVN repository and server

Wednesday, June 18th, 2008

Become root and install subversion via yum

# yum install -y subversion

Create your svnroot directory

# mkdir /home/svnroot

Edit your svnserve.conf

# vim /home/svnroot/conf/svnserve.conf

Your basic svnserve.conf will look like this:

[general]
anon-access = none
password-db = passwd
authz-db = authz
realm = Masao’s First Repository

Edit your authz file

# vim /home/svnroot/conf/authz

to look like this

[/]
masao = rw

Edit your passwd file

# vim /home/svnroot/conf/passwd

to look like this

[users]
masao = mypassword

Start your svn server

/usr/bin/svnserve -d -r /home/svnroot/

Create a directory and some files in it

$ mkdir myproject

$ cd myproject

$ touch myfirstfile mysecondfile

$ svn import . svn://localhost/myproject -m “initial commit”

Adding mysecondfile
Adding myfirstfile
Committed revision 1.

Now checkout your project

$ cd /tmp

$ svn co svn://localhost/myproject
A myproject/mysecondfile
A myproject/myfirstfile
Checked out revision 1.

You’re done!  Thanks Ian!

libMagick.so.10: cannot open shared object file

Tuesday, June 3rd, 2008

Can’t load ‘…/auto/Image/Magick/Magick.so’ for module Image::Magick: libMagick.so.10: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.

  1. Add /usr/local/lib to /etc/ld.so.conf
  2. Run ldconfig as root.