Youry's Blog

Youry's Blog

Archive for November 2010

Malware Infects More than 1.2 Million Web Sites: Dasient

leave a comment »

Malware Infects More than 1.2 Million Web Sites: Dasient from http://www.eweek.com
By: Fahmida Y. Rashid
2010-11-22
According to the latest quarterly malware report from Dasient, the number of infected Websites has doubled to 1.2 million.
More than 1.2 million Websites were infected by malware in the third quarter of 2010, according to security firm Dasient. This includes legitimate sites belonging to government agencies and malvertisements, or malicious advertisements.

Written by youryblog

November 29, 2010 at 9:21 AM

SVN setup and SVN tricks

leave a comment »

Now I need to work with several partners and need to install a new repository into a Linux account.

very good paper how to work with versions: http://www.sepcot.com/blog/2007/04/SVN-Merge-Branch-Trunk

1. First of all I create a new repository it described below.

mkdir -p ~/Documents/REPOS
cd ~/Documents/REPOS/
ls
svnadmin create –fs-type=fsfs ./<repos>
ls -la test_repo/

2. to get access by other user you should read this paper http://kb.mediatemple.net/questions/776/HOWTO%3A+%28gs%29+SVN+multiple+users#gs

3. add new users to the owner user group:

Add existing user tony to ftp supplementary/secondary group with usermod command using -a option ~ i.e. add the user to the supplemental group(s). Use only with -G option :
# usermod -a -G ftp tony

see more here: http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/

+++  Old one +++

I write nothing new in this post, simply a reminder for myself how to setup and work with svn on linux (fedora and mac hosts). I like version control for my source code and documents and already started to use this for my work documents (on my work’s servers) and on my the customer’s and home’s servers. I used this site as a guideline: http://tig.csail.mit.edu/twiki/bin/view/TIG/UsingSubversionAtCSAIL

Create the empty repository structure.
mkdir -p ~/Documents/REPOS
cd REPOS/
ls
svnadmin create —fs-type=fsfs ./test_repo
ls -la test_repo/

Import stuff into the repository:
cd ~/Documents
mkdir test_project
touch test_project/test_file.c
ls test_project/test_file.c
ln -s ./REPOS /REPOS
svn import ./test_project/ svn+ssh://macmini/REPOS/test_repo/ –message “initial import of test_project”

Make sure you can checkout a copy of the repository.
mkdir checkouts
cd checkouts
ls
svn checkout svn+ssh://macmini/REPOS/test_repo

change a working copy and update the repository
svn commit -m “your comments”

I have the latest version of files in my working copy
svn update

see more in SVN Book

Other issues:
correct any errors in place:
svnadmin recover

dump all svn actions to a log:
svnadmin dump > svn.dump

move existing repos out of the way:
mv papers papers.bdb

recreate repos; default type is FSFS:
svnadmin create papers

replay the log:
svnadmin load < svn.dump

group access setup: http://www.if-not-true-then-false.com/2010/svn-subversion-access-control-with-apache-and-mod-authz-svn/

+++ Some tricks, what I need in everyday life from  very good paper how to work with versions: http://www.sepcot.com/blog/2007/04/SVN-Merge-Branch-Trunk

1. Perform an SVN copy:

svn copy svn+ssh://server/path/to/trunk svn+ssh://server/path/to/branch/newBranch -m "Cut branch: newBranch"

2. Some useful commands:
  • conflict resolution: svn resolve –accept=working  workingFile  (for working file update)
    or =base Choose the file that was the BASE revision before you updated your working copy. That is, the file that you checked out before you made your latest edits.

    mine-full Resolve all conflicted files with copies of the files as they stood immediately before you ran svn update.
    theirs-full Resolve all conflicted files with copies of the files that were fetched from the server when you ran svn update.

    see more http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.resolve.html

3. very good site http://www.abbeyworkshop.com/howto/misc/svn01/

useful paper: http://designbygravity.wordpress.com/2009/10/19/what-mother-never-told-you-about-svn-branching-and-merging/

Written by youryblog

November 22, 2010 at 9:16 AM

Posted in IT, UNIX/Linux tricks

Auto SSH Login without Password

leave a comment »

1. ssh tuneling http://www.revsys.com/writings/quicktips/ssh-tunnel.html

2. How to check tunnel: http://wiki.metawerx.net/wiki/SSHTunnel

Not everything work in Fedora, but this one works very good, at least in the Fedora 13. Good paper
http://linuxtoolkit.blogspot.com/2009/05/auto-ssh-login-without-password.html
Steps 1: At the Host Machine
1. Logon to the root home directory.
2. Make sure the hidden .ssh directory has the permission 700. If not execute the command
chmod 700 .ssh
3. Change Directory to .ssh directory by executing the command
cd .ssh
4. Generate the public-private keys using the ssh-keygen command.
# ssh-keygen -t rsa
5. The resulting file id_rsa and id_rsa.pub rsa type public key
# ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host -> Copy the public key to the remote server:

scp ~/.ssh/id_rsa.pub user@remote.host:pubkey.txt
ssh user@remote.host
mkdir ~/.ssh
chmod 700 .ssh
cat pubkey.txt >> ~/.ssh/authorized_keys
rm ~/pubkey.txt
chmod 600 ~/.ssh/*
exit

See more here: http://www.mtu.net/~engstrom/ssh-agent.php

Some extra steps should be done:
Start the ssh-agent:
eval `ssh-agent`
ssh-add #Add your private key to the agent’s cache:

Test the connection again

Setup an automated start-agent script:
First, click here for his sssha script. It is a BASH shell script, so if you use a different login shell, you will have to modify it. Once you download it, place it in your ~/.ssh/ directory and add this to your ~/.bashrc configuration script, presumably at or near the end:

# setup ssh-agent, if appropriate
if [ -f “$HOME/.ssh/sssha” ]; then
source $HOME/.ssh/sssha
fi

Finally, if you are truly paranoid, make sure to kill your ssh-agent when you are done using any machine on which you have started one. This can be accomplished most simply with ssh-agent -k.

Note: I personally prefer to add an alias to the .bashhrc profile:
alias ssha=’eval \`ssh-agent\`; ssh-add’

and run it manually when I need it.

Written by youryblog

November 19, 2010 at 10:29 AM