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
By: Fahmida Y. Rashid
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:

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

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

2. to get access by other user you should read this paper

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:

+++  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:

Create the empty repository structure.
mkdir -p ~/Documents/REPOS
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
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:

+++ Some tricks, what I need in everyday life from  very good paper how to work with versions:

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

3. very good site

useful paper:

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

2. How to check tunnel:

Not everything work in Fedora, but this one works very good, at least in the Fedora 13. Good paper
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 rsa type public key
# ssh-copy-id -i ~/.ssh/ remote-host -> Copy the public key to the remote server:

scp ~/.ssh/
mkdir ~/.ssh
chmod 700 .ssh
cat pubkey.txt >> ~/.ssh/authorized_keys
rm ~/pubkey.txt
chmod 600 ~/.ssh/*

See more here:

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

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