OpenVZ allows multiple Linux distributions to run on a single computer or server, each with their own dedicated resources and configurations, also known as "Virtual Private Servers" (VPS). It is the free and open source alternative to VMWare and Virtuozzo (actually based on OpenVZ and has many similarities).
Preparing and Installing OpenVZ
1. It is recommended, but not necessary, to create a separate partition for the VE. Use gparted if needed to resize partitions. After the partition is made, create the /vz directory (even if skipping the partition):
sudo mkdir /vz
2. If making a separate partition, add the following to /etc/fstab:
/dev/sda1 /vz ext3 noatime,relatime,errors=remount-ro 0 1
3. Create a symbolic link from /vz to a /var/lib/vz
sudo ln -s /vz /var/lib/vz
4. Make sure backports is enabled.After backports is enabled, install the openvz packages
sudo apt-get install linux-openvz
and then reboot into the openvz kernel.
5. After rebooting into the openvz kernel, install some tools
sudo apt-get install vzctl vzquota
6. Edit the /etc/sysctl.conf with some necessary info:
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
7. Restart the vz service:
sudo /etc/init.d/vz restart
Creating the VE
1. Get an OS template to create the VE. I am using the ubuntu 8.04 template, there are more available at http://wiki.openvz.org/Download/template/precreated
wget download.openvz.org/template/precreated/ubuntu-8.04-i386-minimal.tar.gz
sudo mv ubuntu-8.04-i386-minimal.tar.gz /var/lib/vz/template/cache/
2. Create the VE (don't use less than 101, since those are for internal use):
sudo vzctl create 101 --ostemplate ubuntu-8.04-i386-minimal
Configuring the VE
1. Add the appropriate network settings to the VE. For a static IP
sudo vzctl set 101 --ipadd 192.168.1.101 --hostname testvps --nameserver 192.168.1.100 --nameserv
2. Edit /etc/vz/conf/101.conf to give the VE some usable resources
# UBC parameters (in form of barrier:limit)
KMEMSIZE="16384000:18022400"
LOCKEDPAGES="4096:4096"
PRIVVMPAGES="262144:292912"
SHMPAGES="131072:131072"
NUMPROC="400:400"
PHYSPAGES="0:2147483647"
VMGUARPAGES="102400:2147483647"
OOMGUARPAGES="102400:2147483647"
NUMTCPSOCK="500:500"
NUMFLOCK="200:220"
NUMPTY="64:64"
NUMSIGINFO="512:512"
TCPSNDBUF="5365760:10485760"
TCPRCVBUF="5365760:10485760"
OTHERSOCKBUF="1503232:4063232"
DGRAMRCVBUF="262144:262144"
NUMOTHERSOCK="500:500"
DCACHESIZE="4194304:4317184"
NUMFILE="9312:9312"
AVNUMPROC="200:200"
NUMIPTENT="128:128"
# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="5048576:5153024"
DISKINODES="1000000:1020000"
QUOTATIME="0"
3. Start the VE:
sudo vzctl start 101
4. Enter & test the VE's networking:
sudo vzctl enter 101
ping
ping google.com
5. If it's working you can start using your VE just like another copy of Ubuntu or whatever distro you used for the OS template. Note: the Ubuntu template is a minimal install (only uses 46MB default). I updated the VE's /etc/sources.list to match my HN's repos, then installed whatever software I needed, using 'apt-cache search
Useful Commands
List all VEs and their state: vzlist -a
Delete VEs: vzctl destroy
More commands: man vzctl
See VE stats: vzctl exec
Troubleshooting
Weird errors? Make sure you are booted into the openvz kernel:
uname -a
Linux vpsu4.4domains.com 2.6.24-19-openvz #1 SMP Thu Aug 21 04:18:17 UTC 2008 i686 GNU/Linux
And all the openvz modules are loaded on the HN:
sudo modprobe vzethdev vznetdev vzrst vzctp vzmon vzdquota vzdev
Sunday, 28 September 2008
How to Install and Configure OpenVZ on Ubuntu 8.04 (Hardy)
Sunday, 21 September 2008
How to change the start-here icon (Start Menu Icon) in Ubuntu
* Manually putting them into the directory
* Recreating the folder
You can go into the following directory:
/usr/share/icons/themename/24x24/places/start_here.png
Once you're in there make sure you open your icon and it's scaled for 24x24. One thing you probably should do is backup the old icon, copy it and put it in a folder. So once you've done that, remove the "start-here.png" file from the directory, then rename your new logo "start-here" and put it in the directory. After that, you want to run this command:
sudo gtk-update-icon-cache /usr/share/icons/Human/
After you've done that, go into Terminal and run this command:
killall gnome-panel
The Gnome panel should disappear for a second and come back with your desired logo.
The simplest way to do it (and I forget which thread I read this in, but kudos to whomever suggested it first) is to create a folder in your home directory for the icon theme you use and then put your custom icon in there.
One of the more simpler ways to do this (and I forget which thread I read this in, but thanks to whoever suggested it) is to create a folder in your home directory for the icon theme you use and then put your custom icon that you want to use in there.
So an example would be, if you're using the Human theme create this directory:
/home/username/.icons/Human/scalable/places/distributor-logo.png
Then you can run this in Terminal:
killall gnome-panel
Then you should have your custom icon where the Ubuntu icon was.
How to install Subsonic Ubuntu Hardy
Subsonic is a free, web-based media streamer, providing access to your entire music collection wherever you are. Use it to share your music with friends, or to listen to your own music while at work. You can stream to multiple players simultaneously, for instance to one player in your kitchen and another in your living room.
Subsonic is designed to handle very large music collections (many thousand albums). It uses a combination of directory structure and tag parsing to organize the music. Although optimized for MP3 streaming, it works for any audio or video format that can stream over HTTP (for instance AAC and OGG). By using transcoder plug-ins, Subsonic supports on-the-fly conversion and streaming of virtually any audio format, including WMA, FLAC, APE, Musepack, WavPack, Shorten and OptimFROG.
Step1: Dependencies
sudo apt-get install tomcat5.5
cd; wget http://prdownloads.sourceforge.net/subsonic/subsonic-3.4.zip
Step2: Modify Init For Tomcat & Start
sudo nano /etc/init.d/tomcat5.5
Change TOMCAT_SECURITY=yes to TOMCAT_SECURITY=no
*If anyone has a better solution for this please post.
sudo /etc/init.d/tomcat5.5 start
Step3: Unzip/Install Subsonic
unzip subsonic-3.4.zip
mv subsonic.war /var/lib/tomcat5.5/webapps/
mkdir /var/subsonic
chown tomcat55:nogroup /var/subsonic
Step4: Test
firefox http://127.0.0.1:8180/subsonic
How to set Yahoo Mail as Firefox default e-mail client
Here is the procedure to follow:
1. In Firefox 3 and further versions go to Tools.
2. Click Options.
3. Click on the Application tab.
4. Highlight Mailto and select Yahoo! Mail.
5. Click OK.
6. Done!
Tuesday, 16 September 2008
How to access to music with amarok from anywhere (almost)
The idea is to gain access and playback to any or as many music folders from right clicking on the desktop or any file browser screen.
Works with amarok and probably audacious. (with correct launch comm.) Once it's setup very easy to add or delete 'entries'.
first install this
sudo apt-get install nautilus-open-terminal
This provides a right click - 'open in terminal' on any directory (folder
Useful to run a command or get proper path to a folder without typing errors.
EX.
I have a mp3 music folder - 'derek and the dominos' somewhere. (red is path
Browse to the folder, r. click 'open in terminal'
~/mp3/ruchi And The Dominos (1970) Layla And Other Assorted Love Songs$
Copy the path only and then browse to home dir. -> .gnome2 -> nautilus-scripts.
Inside create a new text docu., name it something simple (I used layla - note; must be lowercase
Use this as a template, replace my path by pasting in copied path. Leave quotes for paths with spaces and or oddities
The file extension must match format of music files
#!/bin/bash
cd ~/mp3/"Derek And The Dominos (1970) Layla And Other Assorted Love Songs"
amarok --load --play *.mp3
Save and backspace to .gnome2, r/ click, 'open in terminal' and run
chmod +x layla
Now a r.click will show a 'Scripts", mouse over and click name chosen. If Amarok is open the folder will load and begin playing, it it isn't Amarok will open, ect.
EX. of flac
#!/bin/bash
cd ~/flac/"Quicksilver Messenger Service (1968) Quicksilver Messenger Service"
amarok --load --play *.flac
You can also create subdirectories in nautilus-scripts if wanted, a right click 'collection' of sorts.We made a couple based on sub dir. = artist, script = album or mix.
Sunday, 14 September 2008
Fix for E: Cannot find filename or size tag error in AptOnCD
I had created a Repository DVD with APTonCD 0.1.98
But when I was go to add this DVD as repository CD-ROM, I got this error :
E: Cannot find filename or size tag
The problem is cached-name of .DEB files. You must remove 1%3a, 2%3a, 3%3a... till 9%3a from all .DEB file names.
There is one problem too. You must create another DVD after doing this. Your old DVD with the error will not repair.
Here is the step-by-step:
1) First, just go to cache folder with this command :
cd /var/cache/apt/
2) Now CHMOD "archives" folder to make permission to rename files inside this folder.
sudo chmod -R 777 archives/
3) Now, do this all commands one by one in terminal/konsole to rename all .DEB files :
for FILE in $(find . -type f -name '*1%3a*'); do NEWNAME=$(echo $FILE|sed s/'1%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*2%3a*'); do NEWNAME=$(echo $FILE|sed s/'2%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*3%3a*'); do NEWNAME=$(echo $FILE|sed s/'3%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*4%3a*'); do NEWNAME=$(echo $FILE|sed s/'4%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*5%3a*'); do NEWNAME=$(echo $FILE|sed s/'5%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*6%3a*'); do NEWNAME=$(echo $FILE|sed s/'6%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*7%3a*'); do NEWNAME=$(echo $FILE|sed s/'7%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*8%3a*'); do NEWNAME=$(echo $FILE|sed s/'8%3a'//); mv -v $FILE $NEWNAME; done
for FILE in $(find . -type f -name '*9%3a*'); do NEWNAME=$(echo $FILE|sed s/'9%3a'//); mv -v $FILE $NEWNAME; done
(Help : This command will remove the "1%3a" with "2%3a" "3%3a" "4%3a"... till "9%3a" )
4) DONE.
Thursday, 11 September 2008
How to create an ubuntu 8.04.1 boot floppy
There are various posts about this topic already, but none of them actually worked for me using a new Ubuntu 8.04.1 installation.
For reference, my computer is setup like this:
Windows Xp installed on an IDE drive /dev/hda using whole disk
Ubuntu 8.04.1 installed on SATA drive /dev/sda using whole disk
Kubuntu 8.04.1 installed on SATA drive /dev/sdb using whole disk
If the BIOS are set to an IDE boot I get windows. If the BIOS are set to SCSI boot I boot into GRUB on the MBR of the primary SATA disk. This is how I have the BIOS set for the remainder of this post (to boot to GRUB on the MBR of a SATA disk). If I change the BIOS boot order it breaks GRUB, I think because the disks get assigned in a different order (hd2,0) becomes (hd0,0) etc. (this is annoying....)
Once booted into Ubuntu I wanted to make a backup floppy boot disk just in case something ever happened to the Linux install. I followed various posts I could find on the internet but none actually worked. Below is what finally did work for me:
1. Open a terminal window
2. $ su and enter password to become the root 'super user'
3. # gformat --device=/dev/fd0
Set format type to DOS in the GUI application, for some reason whenever I tried to format these to Linux ext2 the floppy could not be used in later steps. I can't explain this. The command line "fdformat" also would not make usable floppies. However, once you have a usable blank formatted floppy:
4. # mke2fs /dev/fd0
5. # mount /dev/fd0 /media/floppy
6. # mkdir -p /media/floppy/boot/grub
7. # cd /boot/grub
8. # cp * /media/floppy/boot/grub
Note I copied ALL files, not just stage1, stage2, menu.lst and device.map files like some other posts suggested. The resulting floppy would not fully work for me unless I copied ALL files.
9. # umount /dev/fd0
10. # grub
11. grub> device (fd0) /dev/fd0
Note the need for the 2nd parameter, device (fd0) would not work
12. grub> root (fd0)
Ignore the message about not recognizing the partiton header.
13. grub> setup (fd0)
14. grub> quit
15. # exit
16. $ exit
The floppy you just wrote should now be bootable and have the entire GRUB menu on it (and actually working). Make sure your BIOS are set to try a floppy boot before the hard disk boot to test the boot loader floppy.
Tuesday, 9 September 2008
How To Cover you tracks with truecrypt in gnome
when browsing around in your true crypt mount your data might not be as secure as you think. Gnome keeps track of a list of your recent files and creates thumbnails of your files. They will be there even after you dismount. To fix this issue we wrote the following script to prevent gnome from tracking you while you use truecrypt.
#!/bin/sh
#save old recently used stuff, and stop tracking recently used
mv ~/.recently-used ~/.recently-used.bak
mv ~/.recently-used.xbel ~/.recently-used.xbel.bak
mkdir ~/.recently-used.xbel
truecrypt
#restore old recently used stuff
rm -r ~/.recently-used.xbel
mv ~/.recently-used.bak ~/.recently-used
mv ~/.recently-used.xbel.bak ~/.recently-used.xbel
#shred the thumbnail folder
find ~/.thumbnails -type f -execdir shred -u '{}' \;
How to backup MySQL and recovery Using Zmanda Recovery Manager
Zmanda Recovery Manager (ZRM) for MySQL simplifies life of a database administrator who needs an easy to use yet flexible and robust backup and recovery solution for MySQL server. Significant features are:
* Schedule full and incremental logical or raw backups of your MySQL database
* Centralized backup management
* Perform backup that is the best match for your storage engine and your MySQL configuration
* Get e-mail notification about status of your backups
* Monitor and obtain reports about your backups (including RSS feeds)
* Verify your backup images
* Compress and encrypt your backup images
* Implement Site or Application specific backup policies
* Recover database easily to any point in time or to any particular database event
* Custom plugins to tailor MySQL backups to your environment
* MySQL backup using Linux LVM and Solaris ZFS snapshots
Release 2.0 of the community project can be downloaded from Zmanda downloads page(http://www.zmanda.com/download-zrm.php). It supports all Linux and Solaris distributions. The documentation is available on ZRM wiki(http://mysqlbackup.zmanda.com). ZRM forums (http://forums.zmanda.com) can be used to get questions answered about the project.
This example assumes that the ZRM server and MySQL server are the same machine. We are backing up MySQL database
myisamnetflix
to the same machine running Ubuntu 7.04.
ZRM For MySQL Installation
* Installation has to be done as super user.
* ZRM for MySQL requires perl 5.8.7 or later. Ubuntu 7.04 already has perl 5.8.8 installed.
* Install perl-DBD and perl-XML-parser modules
# apt-get install libxml-parser-perl libdbd-mysql-perl
* Download ZRM for MySQL debian packages from Zmanda downloads page.
* Install ZRM for MySQL (ZRM server package is sufficient because MySQL server and ZRM server are the same machine).
# dpkg -i mysql-zrm_2.0_all.deb
Selecting previously deselected package mysql-zrm.
(Reading database ... 108342 files and directories currently installed.)
Unpacking mysql-zrm (from mysql-zrm_2.0_all.deb) ...
Setting up mysql-zrm (2.0) ...
Updating ownership of previously backedup data sets
MySQL Server Configuration
* Check to see if MySQL server is running. If MySQL server is not installed, please install "mysql-server" using "apt-get" command. Update the "root" MySQL server with a password using mysqladmin command (mysqladmin --user root password boot12). We are using "boot12" as the root password. This user will be used for doing MySQL backups and restores. It is better to user a specific user with minimal privileges to do MySQL backups instead of using "root" MySQL user.
* The MySQL server has to run as "mysql" user and "mysql" OS user should belong to "mysql" group. The default installation of ZRM for MySQL requires MySQL server to run as "mysql" user.
* "ps" output shows mysql server is running using the default MySQL port
mysql 22034 21995 0 14:38 pts/2 00:00:09 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
* Enable binary logging on the MySQL server. Binary logging must be enabled to do incremental backups of the MySQL server.
* Edit /etc/mysql/my.cnf configuration file. Add "log-bin" in mysqld section.
[mysqld]
log-bin
* We have mysql database "myisamnetflix" that contains two tables. We will be backing this database. This database uses MyISAM storage engine:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| myisamnetflix |
| mysql |
+--------------------+
3 rows in set (0.00 sec)
mysql> use myisamnetflix;
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> show tables;
+-------------------------+
| Tables_in_myisamnetflix |
+-------------------------+
| MovieID |
| MovieRatings |
+-------------------------+
2 rows in set (0.00 sec)
mysql> select count(*) from MovieID;
+----------+
| count(*) |
+----------+
| 17770 |
+----------+
* MySQL client commands are installed in /usr/bin/ directory. If they are not, accordingly configure the client command location and binary log location in mysql-zrm.conf.
ZRM Configuration
* This should be done as mysql user:
$ id
uid=1002(mysql) gid=1001(mysql) groups=1001(mysql)
* Create the backup set directory. The backup set is called "netflix".
$ mkdir /etc/mysql-zrm/netflix
* Create mysql-zrm.conf configuration file. Backup compression is enabled and "myisamnetflix" database is being backed up. The location of MySQL binary logs are also specified ("mysql-binlog-path").
$ cat /etc/mysql-zrm/netflix/mysql-zrm.conf
host="localhost"
databases="myisamnetflix"
password="boot12"
user="root"
compress=1
mysql-binlog-path="/var/log/mysql"
Perform ZRM Backups
* This should be done as "mysql" user.
* Perform full backup of the database immediately using "mysql-zrm-scheduler".
$ mysql-zrm-scheduler --now --backup-set netflix --backup-level 0
schedule:INFO: ZRM for MySQL Community Edition - version 2.0
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
backup:INFO: ZRM for MySQL Community Edition - version 2.0
netflix:backup:INFO: START OF BACKUP
netflix:backup:INFO: PHASE START: Initialization
netflix:backup:INFO: backup-set=netflix
netflix:backup:INFO: backup-date=20080326161652
netflix:backup:INFO: mysql-server-os=Linux/Unix
netflix:backup:INFO: host=localhost
netflix:backup:INFO: backup-date-epoch=1206573412
netflix:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.0
netflix:backup:INFO: mysql-version=5.0.38-Ubuntu_0ubuntu1.4-log
netflix:backup:INFO: backup-directory=/var/lib/mysql-zrm/netflix/20080326161652
netflix:backup:INFO: backup-level=0
netflix:backup:INFO: backup-mode=raw
netflix:backup:INFO: PHASE END: Initialization
netflix:backup:INFO: PHASE START: Running pre backup plugin
netflix:backup:INFO: PHASE END: Running pre backup plugin
netflix:backup:INFO: PHASE START: Flushing logs
netflix:backup:INFO: PHASE END: Flushing logs
netflix:backup:INFO: PHASE START: Find table type
netflix:backup:INFO: PHASE END: Find table type
netflix:backup:INFO: PHASE START: Creating raw backup
netflix:backup:INFO: raw-databases=myisamnetflix
netflix:backup:INFO: PHASE END: Creating raw backup
netflix:backup:INFO: PHASE START: Calculating backup size & checksums
netflix:backup:INFO: next-binlog=mysql-bin.000009
netflix:backup:INFO: backup-size=122.27 MB
netflix:backup:INFO: PHASE END: Calculating backup size & checksums
netflix:backup:INFO: PHASE START: Compression/Encryption
netflix:backup:INFO: compress=
netflix:backup:INFO: backup-size-compressed=37.65 MB
netflix:backup:INFO: PHASE END: Compression/Encryption
netflix:backup:INFO: read-locks-time=00:00:01
netflix:backup:INFO: flush-logs-time=00:00:00
netflix:backup:INFO: compress-encrypt-time=00:02:20
netflix:backup:INFO: backup-time=00:00:15
netflix:backup:INFO: backup-status=Backup succeeded
netflix:backup:INFO: Backup succeeded
netflix:backup:INFO: PHASE START: Running post backup plugin
netflix:backup:INFO: PHASE END: Running post backup plugin
netflix:backup:INFO: PHASE START: Mailing backup report
netflix:backup:INFO: PHASE END: Mailing backup report
netflix:backup:INFO: PHASE START: Cleanup
netflix:backup:INFO: PHASE END: Cleanup
netflix:backup:INFO: END OF BACKUP
/usr/bin/mysql-zrm started successfully
* Delete some entries from the "myisamnetflix" database (so that we can do incremental backup of the database)
mysql> use myisamnetflix;
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> delete from MovieID where MovieTitle = "Alien Hunter";
Query OK, 1 rows affected (0.01 sec)
* Perform incremental backup of the backup set.
$ mysql-zrm-scheduler --now --backup-set netflix --backup-level 1
schedule:INFO: ZRM for MySQL Community Edition - version 2.0
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log
backup:INFO: ZRM for MySQL Community Edition - version 2.0
netflix:backup:INFO: START OF BACKUP
netflix:backup:INFO: PHASE START: Initialization
netflix:backup:INFO: backup-set=netflix
netflix:backup:INFO: backup-date=20080326164433
netflix:backup:INFO: mysql-server-os=Linux/Unix
netflix:backup:INFO: host=localhost
netflix:backup:INFO: backup-date-epoch=1206575073
netflix:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 2.0
netflix:backup:INFO: mysql-version=5.0.38-Ubuntu_0ubuntu1.4-log
netflix:backup:INFO: backup-directory=/var/lib/mysql-zrm/netflix/20080326164433
netflix:backup:INFO: backup-level=1
netflix:backup:INFO: PHASE END: Initialization
netflix:backup:INFO: PHASE START: Running pre backup plugin
netflix:backup:INFO: PHASE END: Running pre backup plugin
netflix:backup:INFO: PHASE START: Flushing logs
netflix:backup:INFO: PHASE END: Flushing logs
netflix:backup:INFO: PHASE START: Creating incremental backup
netflix:backup:INFO: incremental=mysql-bin.[0-9]*
netflix:backup:INFO: PHASE END: Creating incremental backup
netflix:backup:INFO: PHASE START: Calculating backup size & checksums
netflix:backup:INFO: next-binlog=mysql-bin.000013
netflix:backup:INFO: last-backup=/var/lib/mysql-zrm/netflix/20080326162210
netflix:backup:INFO: backup-size=0.03 MB
netflix:backup:INFO: PHASE END: Calculating backup size & checksums
netflix:backup:INFO: PHASE START: Compression/Encryption
netflix:backup:INFO: compress=
netflix:backup:INFO: backup-size-compressed=0.00 MB
netflix:backup:INFO: PHASE END: Compression/Encryption
netflix:backup:INFO: read-locks-time=00:00:00
netflix:backup:INFO: flush-logs-time=00:00:00
netflix:backup:INFO: compress-encrypt-time=00:00:00
netflix:backup:INFO: backup-time=00:00:00
netflix:backup:INFO: backup-status=Backup succeeded
netflix:backup:INFO: Backup succeeded
netflix:backup:INFO: PHASE START: Running post backup plugin
netflix:backup:INFO: PHASE END: Running post backup plugin
netflix:backup:INFO: PHASE START: Mailing backup report
netflix:backup:INFO: PHASE END: Mailing backup report
netflix:backup:INFO: PHASE START: Cleanup
netflix:backup:INFO: PHASE END: Cleanup
netflix:backup:INFO: END OF BACKUP
/usr/bin/mysql-zrm started successfully
ZRM Backup Reports
* Use "mysql-zrm-reporter" to look at the status of backups available.
$ /usr/bin/mysql-zrm-reporter --where backup-set=netflix --show backup-status-info
REPORT TYPE : backup-status-info
backup_set backup_date backup_level backup_status comment
-----------------------------------------------------------------------------------------------------------
netflix Wed 26 Mar 2008 04:44:33 1 Backup succeeded ----
PM PDT
netflix Wed 26 Mar 2008 04:16:52 0 Backup succeeded ----
PM PDT
* ZRM reports can also provide information on impact on MySQL application.
$ /usr/bin/mysql-zrm-reporter --where backup-set=netflix --show backup-app-performance-info
REPORT TYPE : backup-app-performance-info
backup_set backup_date backup_level backup_size backup_time read_locks_time flush_logs_time
-------------------------------------------------------------------------------------------------------------------------------------
netflix Wed 26 Mar 2008 04:44:33 1 0.03 MB 00:00:00 00:00:00 00:00:00
PM PDT
netflix Wed 26 Mar 2008 04:16:52 0 122.27 MB 00:00:15 00:00:01 00:00:00
PM PDT
Database Recovery
* Use ZRM reporting tool to identify the location of MySQL backup images.
$ /usr/bin/mysql-zrm-reporter --where backup-set=netflix --show restore-info
REPORT TYPE : restore-info
backup_set backup_date backup_level backup_directory backup_status comment
-----------------------------------------------------------------------------------------------------------------------------------------------------
netflix Wed 26 Mar 2008 04:44:33 1 /var/lib/mysql-zrm/netflix/20080326164433 Backup succeeded ----
PM PDT
netflix Wed 26 Mar 2008 04:16:52 0 /var/lib/mysql-zrm/netflix/20080326161652 Backup succeeded ----
PM PDT
* You can parse incremental backups to identify database events of interest. In our example, we will look for the "DELETE" event.
$ /usr/bin/mysql-zrm-parse-binlogs --source-directory /var/lib/mysql-zrm/netflix/20080326164433 | grep delete
parse-binlogs:INFO: ZRM for MySQL Community Edition - version 2.0
/var/lib/mysql-zrm/netflix/20080326164433/mysql-bin.000011 | 13634 | 08-03-26 16:28:03 | Query | use myisamnetflix/*!*/; delete from MovieID where MovieTitle = "Alien Hunter"/*!*/;
* Restore the database from the full backup done at 16:16:52.
$ /usr/bin/mysql-zrm-restore --user=root --password=boot12 --source-directory=/var/lib/mysql-zrm/netflix/20080326161652
restore:INFO: ZRM for MySQL Community Edition - version 2.0
BackupSet1:restore:INFO: Restored database from raw backup: myisamnetflix
BackupSet1:restore:INFO: Restore done in 9 seconds.
MySQL server has been shutdown. Please restart after verification.
* Restart the MySQL server
# /etc/init.d/mysql restart
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
* Check the database recovery.
mysql> use myisamnetflix;
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> select * from MovieID where MovieTitle = "Alien Hunter";
+---------+------+--------------+
| MovieID | Year | MovieTitle |
+---------+------+--------------+
| 17770 | 2003 | Alien Hunter |
+---------+------+--------------+
1 row in set (0.02 sec)
Friday, 5 September 2008
Howto Dump and view the cache of BIND9 DNS server
Bind 9 makes it fairly easy to dump and view the cache of a caching BIND DNS server. All you have to do is run under root:
rndc dumpdb -cache
This will create a file called named_dump.db in the /var/cache/bind/ directory. You can easily open this .db with your favorite text editor.
** If your instance of BIND is chrooted, for example to /var/lib/named/, then the cache dump file will be located in the /var/lib/named/var/cache/bind/ directory.
** The dumpdb feature of rndc has other options including a -all or -zone flag. Check 'rndc --help' for more information.
Howto setup PPTP server (VPN) on Ubuntu 7.10
What is PPTP?
PPTP stands for Point to Point Tunneling Protocol. It was developed by a consortium including Microsoft and is used for establishing VPN (Virtual Private Network) tunnels across the Internet. This allows remote users to securely and inexpensively access their corporate network from anywhere on the Internet.
PPTP uses a client-server model for establishing VPN connections. Most Microsoft operating systems ship with a PPTP client, so there is no need to purchase third-party client software. PPTP has the additional advantage over other VPN technologies of being easy to setup.
What is Poptop?
Before Poptop, no solution existed if you wish to connect PPTP clients to Linux servers. Using Poptop, Linux servers can now function seamlessly in a PPTP VPN environment. This enables administrators to leverage the considerable benefits of both Microsoft and Linux operating systems.
The current release version supports Windows 95/98/Me/NT/2000/XP PPTP clients and Linux PPTP clients.
Poptop is free software, licensed under the terms of the GNU GPL.
Features of Poptop include:
* Microsoft compatible authentication and encryption (MSCHAPv2, MPPE 40 - 128 bit RC4 encryption)
* Support for multiple client connections
* Seamless integration into a Microsoft network environment (LDAP, SAMBA) using RADIUS plugin
* Works with Windows 95/98/Me/NT/2000/XP PPTP clients
* Works with Linux PPTP client
* Poptop is, and will remain, totally free under the GNU General Public License
How to install Poptop (PPTPD)?
* Use this command:
sudo apt-get install pptpd -y
* Edit the /etc/pptpd.conf file like this
nano /etc/pptpd.conf
The file looks like this:
###############################################
# $Id: pptpd.conf 4255 2004-10-03 18:44:00Z rene $
#
# Sample Poptop configuration file /etc/pptpd.conf
#
# Changes are effective when pptpd is restarted.
###############################################
# TAG: ppp
# Path to the pppd program, default ‘/usr/sbin/pppd’ on Linux
#
#ppp /usr/sbin/pppd
# TAG: option
# Specifies the location of the PPP options file.
# By default PPP looks in ‘/etc/ppp/options’
#
option /etc/ppp/pptpd-options
# TAG: debug
# Turns on (more) debugging to syslog
#
#debug
# TAG: stimeout
# Specifies timeout (in seconds) on starting ctrl connection
#
# stimeout 10
# TAG: noipparam
# Suppress the passing of the client’s IP address to PPP, which is
# done by default otherwise.
#
#noipparam
# TAG: logwtmp
# Use wtmp(5) to record client connections and disconnections.
#
logwtmp
# TAG: bcrelay
# Turns on broadcast relay to clients from interface
#
#bcrelay eth1
# TAG: localip
# TAG: remoteip
# Specifies the local and remote IP address ranges.
#
# Any addresses work as long as the local machine takes care of the
# routing. But if you want to use MS-Windows networking, you should
# use IP addresses out of the LAN address space and use the proxyarp
# option in the pppd options file, or run bcrelay.
#
# You can specify single IP addresses seperated by commas or you can
# specify ranges, or both. For example:
#
# 192.168.0.234,192.168.0.245-249,192.168.0.254
#
# IMPORTANT RESTRICTIONS:
#
# 1. No spaces are permitted between commas or within addresses.
#
# 2. If you give more IP addresses than MAX_CONNECTIONS, it will
# start at the beginning of the list and go until it gets
# MAX_CONNECTIONS IPs. Others will be ignored.
#
# 3. No shortcuts in ranges! ie. 234-8 does not mean 234 to 238,
# you must type 234-238 if you mean this.
#
# 4. If you give a single localIP, that’s ok - all local IPs will
# be set to the given one. You MUST still give at least one remote
# IP for each simultaneous client.
#
# (Recommended)
#localip 192.168.0.1
#remoteip 192.168.0.234-238,192.168.0.245
# or
localip 192.168.101.1 <— THIS IS YOUR SERVER IP
remoteip 192.168.101.200-245 <—- THIS WILL BE THE IP’S FOR THE CLIENTS
* Now you will need to add a user and password in the /etc/ppp/chap-secrets file. The user will login with this user and password
nano /etc/ppp/chap-secrets
* add a user like this:
# Secrets for authentication using CHAP
# client server secret IP addresses
user pptpd password “*”
The "*" can be a IP address (Ex. 222.222.222.222) and the client will be able to connect only from this IP address or you can put * and the client will be able to connect from anyware
* Kill the pptpd service and start it
killall pptpd
pptpd
Howto Disable Multiple Instances of VLC Media player
Disable the Multiple Instances of VLC , Follow these Steps
1. Open up the Terminal , and type :
gedit vlc.sh
This will open a new blank file , inside the file , copy and paste the following :
#!/bin/sh
#Script to Disable Multiple Instances of VLC Media Player.
pid=$(pidof vlc)
kill $pid
vlc "$1"
Save the File and Close it.
2.Make Script Executable.
In the terminal , do :
chmod a+x ~/vlc.sh
3.Change File Associations.
Right Click a .mp3 file , go to Properties.
Now click the "Open With" tab.
Click Add.
Click "Add a Custom Command".
Click Browse and select the vlc.sh
(Its the file u just created in your home directory in Step 1.)
Click Add.
Click Close.
**Do This For all the Extensions you want to Run using VLC , For example ,AVI ,M3U , MPEG , etc **
Now Whenever u new file , VLC will close if its running and play the new item.
**If you do Not like it , and want to Revert for reasons unknown :P **
Just Change the File Associations
(the one u changed to vlc.sh in Step 3. back to VLC Media Player)
Delete the vlc.sh file (It will be in the ~ Folder).
Optional (Opening files via Browsers Directly) :
The file associations part works great with regard to browsing and double clicking files in Nautilus, on the desktop, or whatever. But if you want to add this function in Firefox , Seamonkey , etc., you will want to set up the file associations in your browser as well.
In Firefox, you would go to Preferences->Applications, find and highlight the file type, scroll down to "use other...", browse to your ~/vlc.sh file, click "Open", move onto the next file type, next, next, ..., and then close your Firefox preferences.
How to create an ubuntu 8.04.1 boot floppy
Once booted into Ubuntu you wanted to make a backup floppy boot disk just in case something ever happened to the Linux install. Procedure to follow
1. Open a terminal window
2. $ su and enter password to become the root 'super user'
3. # gformat --device=/dev/fd0
Set format type to DOS in the GUI application, for some reason whenever I tried to format these to Linux ext2 the floppy could not be used in later steps. I can't explain this. The command line "fdformat" also would not make usable floppies. However, once you have a usable blank formatted floppy:
4. # mke2fs /dev/fd0
5. # mount /dev/fd0 /media/floppy
6. # mkdir -p /media/floppy/boot/grub
7. # cd /boot/grub
8. # cp * /media/floppy/boot/grub
Note:- We copied ALL files, not just stage1, stage2, menu.lst and device.map files like some other posts suggested. The resulting floppy would not fully work for me unless I copied ALL files.
9. # umount /dev/fd0
10. # grub
11. grub> device (fd0) /dev/fd0
Note the need for the 2nd parameter, device (fd0) would not work
12. grub> root (fd0)
Ignore the message about not recognizing the partiton header.
13. grub> setup (fd0)
14. grub> quit
15. # exit
16. $ exit
The floppy you just wrote should now be bootable and have the entire GRUB menu on it (and actually working). Make sure your BIOS are set to try a floppy boot before the hard disk boot to test the boot loader floppy.