Create a SVN Repository on local drive
Answer:
To create a SVN Repository on local drive, you can use the following command:
# cd /data/
# svnadmin create svn
Now you have created a SVN repository located at file:///data/svn/
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Create a SVN Repository on local drive
Answer:
To create a SVN Repository on local drive, you can use the following command:
# cd /data/
# svnadmin create svn
Now you have created a SVN repository located at file:///data/svn/
Create a swap partition using LVM
Answer:
To create a swap partition using LVM, you just need a few commands!
1. Create a 1G swap partition
# lvcreate -L 1G -n /dev/vg0/swap0
2. Set up a Linux swap partition
# mkswap /dev/vg0/swap0
3. Enable it
# swapon -s /dev/vg0/swap0
You might also want to put the settings in the /etc/fstab, so it will be mounted automatically when your system boot next time.
# sudo vi /etc/fstab
/dev/vg0/swap0 none swap sw 0 0
Save and restart your system to test if it is working when system reboot.
How to echo string to standard error (stderr)?
Answer:
To echo string to the standard error (stderr), rather than the standard output (stdout), you can define the following function in your shell (put in your ~/.bashrc file)
# function echo2() { echo "$@" 1>&2; }
Then you can execute the command like:
# echo2 test
Setting up local username and email with git
Answer:
Before you make any changes to a local git repos, it is always recommended to setup you username and email first.
To do so, use the commands below:
# git config --global user.name "John Doe"
# git config --global user.email [email protected]
That's it.
Revert the effect of an earlier changeset in Mercurial
Answer:
In Mercurial, if you want to revert the effect of an earlier changeset, even the changes have been pushed to remote, it is still possible with the hg backout command.
1. Find the revision you want to backout using hg log
# hg log
2. Assume you want to backout to the revision 99, then you can
# hg backout -r 99