How to Install Drupal on your server
You can obtain the latest Drupal release archive from here. The files are in .tar.gz format and can be extracted using most compression tools. On a typical Unix command line, use:
# wget http://drupal.org/files/projects/drupal-x.x.tar.gz
# tar -zxvf drupal-x.x.tar.gz
This will create a new directory drupal-x.x/ containing all Drupal files and directories. Move the contents of that directory into a directory within your web server's document root or your public HTML directory:
# mv drupal-x.x/* drupal-x.x/.htaccess /srv/www/htdocs/drupal
Next step is to create a database using PHPMyAdmin or mysql command line. If you chose to use command line, additional information about privileges, and instructions to create a database using the command line are available in INSTALL.mysql.txt (for MySQL) or INSTALL.pgsql.txt (for PostgreSQL).
To run the install script point your browser to the your website (i.e. http://www.domain.com/drupal). You will be presented with the "Database Configuration" page, where you have to fill the information from the previous step (database name, database user, password)
If you receive in apache log file, next message:
[Sun Jul 29 11:49:32 2007] [alert] [client 127.0.0.2] /srv/www/htdocs/drupal/.htaccess: order not allowed here
then you have to include next lines in your apache.conf:
<Directory /srv/www/htdocs/drupal/>
Options +Includes +FollowSymlinks -Indexes
AllowOverride All
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>
now, point your browser to: http:/domain.com/drupal/ and fill the information regarding database. Create you initial accout, which is admin user, and configure your website.
How to reset MySQL root password
To reset a root password that you forgot (using paths on our system):
[root@host root]#killall mysqld
[root@host root]#/usr/libexec/mysqld -Sg --user=root &
You may have better luck with:
mysqld --skip-grant-tables --user=root
Go back into MySQL with the client:
[root@host root]# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 3.23.41
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> USE mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user
-> SET password=password("newpassword")
-> WHERE user="root";
Query OK, 2 rows affected (0.04 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> exit;
[root@host root]#killall mysqld
Start MySQL the normal way for your system, and all is good. For Red Hat this is:
/etc/init.d/mysqld start
Bye!
How to use vhost.conf in Plesk
Maybe you need to do some specific configurations for a domain or subdomain and you tried to do directly in httpd.include file. You saw that it works for the momment but plesk will delete again your specific configurations from this file. So, in this case the answer is vhost.conf file. This file will be placed inside your domain’s conf directory, usually found at /var/www/vhosts/domain.com/conf. Create a file called vhost.conf in whatever editor you prefer. I use vim.
You can now put in any Apache configuration options like you would into
httpd.include. In my case I wanted to do only one thing, to have
subversion repository accesible over web, without any kind of access
restriction.
Here is my vhost.conf file:
DAV svn
SVNPath /home/svn
Now, you need to tell Plesk to update it’s information.
You have to run:
# /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com
this will configure plesk only for one single domain, in this case
domain.com
If you want to configure it for all sites run:
# /usr/local/psa/admin/bin/websrvmng -a
After this command if you look to httpd.include file, will see that your httpd.include will have an include line for your vhost.conf, something like this:
Include /srv/www/vhosts/domain.com/conf/vhost.conf
There is also a vhost.conf file for subdomain in their DocumentRoot directory, if you want to do some specific things for subdomain.
That's all, bye!
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