Backup & Recovery for a subversion repository
Create a backup of the repository using the following command:
svnadmin dump /path/to/repository | gzip > repository-backup.gz
Run the svnadmin recover command on the repository:
svnadmin recover /path/to/repository
Delete any unused log files in the repository:
svnadmin list-unused-dblogs /path/to/repository | xargs rm -vf
Delete any remaining shared-memory files in the repository:
rm -f /path/to/repository/db/__db.0*
Dump/Restore for Subversion Repository
Data repository dump:
Dump first entry to current:
svnadmin dump /home/svn/repos --revision 0:HEAD > repos.dump
Dump revision 150 to current:
svnadmin dump /home/svn/repos --revision 150:HEAD --incremental > repos-150.dump
Data repository load:
First load:
svnadmin load /home/svn/repos < repos.dump
Incremental load:
svnadmin load /home/svn/repos < repos-150.dump
How to install Microsoft Core Fonts on Suse 10.2
Installing Microsoft's TrueType core fonts for the web on any rpm based linux box with TrueType support is now easy:
I will show you a few solutions with the same final result :)
1. download the .spec file:
wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
* build the binary rpm with:
rpmbuild -bb msttcorefonts-2.0-1.spec
* install the package:
rpm -ivh /usr/src/packages/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
* reload xfs server
/sbin/service xfs reload
2. a)
Get the install script:
wget http://penguinfonts.com/packages/fetchmsttfonts.sh
* And run it as root:
sh ./fetchmsttfonts.sh
b)
Or you can build an rpm package, get the spec file:
wget http://penguinfonts.com/packages/msttcorefonts-2.0-1.spec
* Then build it:
rpmbuild -ba msttcorefonts-2.0-1.spec
* Then install the resulting rpm file:
rpm -i /usr/src/packages/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
* reload xfs server
/sbin/service xfs reload
3. just download and install this package:
MicrosoftFonts-1-jen14.noarch.rpm
The fonts are: Andale Mono, Arial, Comic Sans MS, Courier New, Georgia, Impact, Times New Roman, Trebuchet MS, Verdana and Webdings. Andale, Courier New and Lucida Console are monospaced fonts that are suited for terminal apps.
Copy and pack your files into an ISO
To create the iso file do:
mkisofs -o /storage/myfiles.iso -J -R -r -V -v /dir/path/
Replace /dir/path/ with the full path to whatever directory contains the files you wish burned to CD.
How to use octave to generate png images of equations
octave
a=0:0.1:5
plot(a,kernelGauss(a,2))
xlabel(’r')
ylabel(’W(r)’)
title(’Gaussian Smoothing Kernel - h=2′)
print(’kernel.png’,'-dpng’)
Making movies with mencoder from png images
mencoder “mf://*.png” -mf fps=10 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4
News feed reader in Opera browser
Here are some tips & tricks for Opera browser:
News feed reader
* to mark all messages inside a feed as read: CTRL + SHIFT + a
* show the news only for current week and the new posts at the top. For this you have to edit .opera/mail/index.ini, is necessary to do this modifications for every feed :
Model Age=1
Sort Type=4
Sort Ascending=0
* the update frequency at every 30 minutes:
Update Frequency=1800
How to install a Perl module
1. Download, extract, cd into directory
2. Compile & Install
perl Makefile.PL
make
make install
the second method can be:
perl -MCPAN -e shell
install modulename
Protect a web directory with password
vim /path/of/your/dir/.htaccess
Paste this into:
AuthType Basic
AuthName "Private Dir"
AuthUserFile /path/of/your/dir/.htpasswd
require valid-user
Then we must create the password file /path/of/your/dir/.htpasswd.
We want to log in with the username "user", so we do this:
htpasswd -c /path/of/your/dir/.htpasswd user
Enter a password for "user", and you're done!
Nice and useful commands
To capture the running state of the system. Start with the running processes on the system. Enter the following:
(ps -aux; ps -auxeww; lsof) > current_procs.txt
Grab the contents of the /proc directory. Enter the following:
tar -cvpf proc_directory.tar /proc/[0-9]*
Take a snapshot of the network state of the system. Enter the following:
(date; uname -a; netstat -p; netstat -rn; arp -v) > network_status.txt
Take a snapshot of the currently active and kernel memory.
dd bs=1024 < /dev/mem > mem
dd bs=1024 < /dev/kmem > kmem
Taking a Disk Snapshot:
dd if=/dev/hda1 bs=1024 > hda1