Wednesday, 14 May 2014

7 easy steps to reset forgotten root password on CentOS/Red Hat Linux

Terlupa centos root password?

7 langkah mudah untuk memperbaharui kata-laluan root di CentOS/Red Hat.


7 easy steps to reset forgotten root password on CentOS/Red Hat


1. Boot the system and when you see the following message "Press any key to enter the menu", press any key. (You will see the list of available kernel versions.)

2. Press e in order to edit commands before booting.

3. Highlight the list item with vmlinuz in it by using the arrow keys and press e.

4. Now type single or init 1 at the end of the line.

5. Then press enter and b to boot the system with the new argument. (The system will boot into single user mode and you will see bash prompt)

Now it's time to change the password:
6. Type passwd


1.### Shell Commands ###
2.passwd
3.Enter new UNIX password:
4.Retype new UNIX password:
5.passwd: password updated successfully

7. Type reboot to restart the system.

Saturday, 10 May 2014

OSS adalah singkatan untuk "Open Source Software" atau "Perisian Sumber Terbuka"

Pengenalan.

OSS adalah singkatan untuk "Open Source Software" atau "Perisian Sumber Terbuka". Sekiranya anda telah menggunakan Google atau Yahoo, telefon pintar yang menggunakan Android, maka anda adalah seorang pengguna OSS!


Mengapa OSS?

OSS menjimat wang.
OSS menghalang cetak-rompak.
OSS menggalak daya-cipta.
OSS mengurang wang keluar negara.

How to Set Default Font in LibreOffice / OpenOffice.org

 

Set Default Font in LibreOffice / OpenOffice.org Calc/Writer

After much struggling with wanting to change the default font in Calc/Writer to anything but eco green fonts, I discovered just how to change the default font. I will be using Liberation Sans for this example, but any font installed on your system will work.

Set a Default Font

First, we will need to set a default font. With LibreOffice Calc open, select Styles and Formatting from the Format menu. This will open the Styles and Formatting window. Default should be the default item select (first item). Right click default and choose Modify… Choose the font settings you wish to set for the default font and click OK. The font information will change to the settings you just set.
You’re not done yet. We need to save as a template.

Save as Template

From the File menu, choose Templates > Save… (Shift+F11). Enter a name for the template and click OK. The default template, listed in the right area for the Templates window is default. I did not want to overwrite this template, so I called mine Liberation Sans.
Now that we have created and saved the template, we need to set it as the default template.

Set as Default Template

We will be setting the template we just created as the default template to use. From the File menu, choose Templates > Organize… This will open the Template Management window. The left area will display the template folders. The template we just created above is inside My Templates. Double click the My Templates folder. The templates will appear right below the folder. Choose the template you wish to use.
On the right hand side of the window there a button labeled Commands. Click Commands and select Set as Default Template. Click Close.
Now when you create a new file in LibreOffice Calc, the template you created, saved and set as default will be used.

(Original Source: os4me.com)

Terima Kasih.
Hj Mohsin bin Sarip

Friday, 27 September 2013

How to enable CD/DVD boot on ASUS BIOS notebook ASUS A450C

Bagaimana untuk membolehkan CD/DVD memulakan komputer bimbit ASUS 450C; untuk memasang linux. (How to enable CD/DVD boot on ASUS notebook ASUS A450C - to install linux:)


--------------------------------------------------------------------------------------------------------------------------

ESC or F2 to enter the BIOS setup, Boot tab Fast Boot is set to Disabled, Security tab secure boot is set to Disabled, F10 to save restart.
--------------------------------------------------------------------------------------------------------------------------

F2 re-enter the BIOS, Boot tab Launch CSM is set to Enabled, F10 to save restart. 
--------------------------------------------------------------------------------------------------------------------------

F2 re-enter the BIOS, Boot Option can be selected at BOOT USB devices.
--------------------------------------------------------------------------------------------------------------------------



================================================


Linux Ubuntu 10.04  (telah dinaiktaraf kepada Ubuntu Mate 16.04.6)

Jadi saya ingin memasang linux yang biasa saya gunakan sejak beberapa tahun lalu. (Skg ini pun saya menggunakan firefox di ubuntu linux 10.04, pc acer dual-core).

(Ubuntu 10.04 desktop - telah dinaik-taraf kpd Ubuntu Mate 16.04.6 LTS)

Mengapa saya memilih Ubuntu? Ubuntu adalah sistem operasi yang lengkap, sangat stabil dan yang paling penting ia tidak dijangkiti virus. Ubuntu boleh dipasang di PC atau komputer bimbit dengan percuma, hanya muatturun salinan ISO dari internet, bakar ke CD/DVD dan boleh terus dipasang ke PC ataupun komputer bimbit.

Tetapi... Komputer bimbit Asus ini tidak mahu boot drp CD/DVD! Puas saya mencari-cari dlm internet akhirnya dapat juga... ini dia:

-----------------------------------------------------------------------------------------------------------------------

ESC or F2 to enter the BIOS setup, Boot tab Fast Boot is set to Disabled, Security tab secure boot is set to Disabled, F10 to save restart.
-------------------------------------------------------------------------------------------------------------------------- 
F2 re-enter the BIOS, Boot tab Launch CSM is set to Enabled, F10 to save restart. 
--------------------------------------------------------------------------------------------------------------------------

F2 re-enter the BIOS, Boot Option can be selected at BOOT USB devices.
--------------------------------------------------------------------------------------------------------------------------

Reply to Post Good Library About | Site Map | Help | Imprint Copyright © 2009-2013 OKBASE.NET All Rights Reserved Copyright good library

Tuesday, 13 August 2013

How to sync your zimbra's calendar -> google's -> smartphone's

Alhamdulillah! How to sync your zimbra's calendar to google's then to your Android?, Sangat mudah!


0. Update/Create an event in your MBMB's Zimbra Calendaring System. Add reminder etc. 
1. Log to your gmail, then Open your Calendar. 2. Click at Other calendars. 3. Click URL 4. Add your server's url, use this format "http://webmail.mbmb.gov.my/home/mohsin@mbmb.gov.my/Calendar?fmt=ics" (pls buang the ""; tukar "hjmohsin" kpd email id yg anda gunakan) 5. Tekan enter 6. Event drp zimbra calendar akan di paparkan di google calendar anda:

7. if you set reminder, it will be sent to you by google (sms or email orr even s-planner!).
8. your email system at MBMB will prompt you like this:
Selamat mencuba...

Tuesday, 25 June 2013

Converting lvm to a normal partition

Converting lvm to a normal partition I've recently set up a new gentoo-box and first decided to use lvm2 on my root. Well, I ran into some issues with the kernel and initrd which I could figure out and fix. But then I noticed that, because of the lvm, I won't be able to access the disk from Windows with the free ext3-drivers that are available. Linux will even boot faster because I'll have no need for the initrd anymore. That's when I decided to get rid of the lvm.And that's actually easier than you'd think: If you have a spare-partition or -harddisk around that is at least the size of the logical volume that you'd like to convert to a partition, you can easily do this with dd. Imagine that /dev/vg/volume is a logical volume that consists of only one partition, /dev/sday:

 sh# dd if=/dev/vg/volume of=/dev/sdbx bs=8M
 sh# dd if=/dev/sdbx of=/dev/sday bs=8M

 That's it. This will back up the logical, continuous data that's hosted on the lvm to a partition. After the first dd you'll be able to mount /dev/sdbx and see how the content of /dev/vg/volume has been copied. The mounted partition's usable size will be exactly the same as the volume's size, even if the partition itself is much bigger. That's because the filesystem on it will still be the same size it was before. You could (but it wouldn't make much sense because we want to move the data to the other partition anyways) fix this with resize2fs (if you use ext2 or ext3, that is). The second dd copies the data back to the partition that it was formerly stored on, but without the additional lvm-abstraction. The lvm will be overwritten by the 'flat' filesystem-data. If sdbx happens to be bigger than sday, an error will be printed that dd reached the end of the partition. This is nothing to worry about since the data left on sdbx is not interesting to us anyways. You can fix the filesystem-size to the actual partition size with resize2fs. Since the lvm itself needs some space, too, it will be slightly (a few bytes) larger now.

4 comments:

 Logu July 1, 2011 at 6:05 AM
 Excelent buddy. I was really looking for it. I am going to do this for a vmware vm
1. Create virtual disk (sdb) to hold the LVM enabled disk on the guest
2. Partiton the disk similar to the LVM layout.
3. Boot the LVM machine with a live CD.
4. dd if=/dev/vg/volume|ssh vmguest > /dev/sdbx
 Reply
 ---------------------------------------------------------------------------------------------
 IkemFebruary 3, 2013 at 6:11 AM > If you have a spare-partition _or_ -harddisk around
 Reply
 Replies Daniel AlbuschatFebruary 4, 2013 at 4:02 AM
Fixed - thanks!
 Reply
 ----------------------------------------------------------------------------------------------

Mohsin sarip June 25, 2013 at 7:44 AM
Tqvm Daniel. this command:
" dd if=/dev/vg/volume of=/dev/sdbx bs=8M "
 this will overide all data in /dev/sdbx (possibly your ext harddisk).

 what if we use this command:
 " mount /dev/sdbx /mnt "
 " dd if=/dev/vg/volume of=/mnt/datafile.dd bs=8M "
 my 2 cent

Sunday, 27 January 2013

Zimbra Open Source Edition Backup Procedure


Incremental backup of Zimbra on LVM volume with duplicity

The best way to do a reliable backup of Zimbra Community Edition (ZCS) and minimize downtime is to put /opt/zimbra on a dedicate LVM volume.
The reason why you have to satisfy this requirement is that you cannot simply backup /opt/zimbra while Zimbra is running.
At the same time, creating a backup of a full Zimbra installation can take from several minutes to a few hours, depending on the size of your mailboxes and the resources of your server. This means that you cannot stop Zimbra, backup it and restart it as it would cause a huge downtime.

Welcome LVM.

Making a snapshot of a LVM volume takes only a few seconds. All we have to do is:
  • stop zimbra
  • make a snapshot of the LVM volume mounted under /opt/zimbra
  • start zimbra
  • mount the snapshot on a temporary dir
  • backup the temporary dir
  • unmount the snapshot
  • destroy the snapshot
You can find many examples of this procedure on Zimbra Wiki, but I wasn’t satisfied with any of them because they didn’t support incremental remote backups.

Welcome duplicity.

Duplicity is a nifty piece of software which can do either a full or incremental backup of a directory and store it on a local disk or on a remote storage, via ftp or scp.
duplicity is smart enough to detect when the last full backup was performed more than 1 month ago and will automatically switch from “incremental backup” to “full backup” in that case.
As a bonus it can also purge old backups automatically, without the need for additional scripting.
In my example, I use duplicity to do a remote backup via ftp.
I choose to use symmetrical encryption because I’m lazy. Asymmetrical encryption is supported too, though.

The script shall be run by cron everyday, as root. E.g.:
0 3 * * * /root/bin/backup-zimbra.sh

You need a little more than 2 GB of free disk space inside $TEMPDIR ! duplicity is smart enough to write one backup volume at a time (the size can be set in $VOLSIZE – in my example it’s 2GB), upload it, delete it, and then start writing the next backup volume. At any given time, your TEMPDIR will contain only a single 2GB backup volume.

SECURITY WARNING: in this example script, I put all passwords inside the script itself. Make sure to chmod 700 and chown root:root the script or any user will be able to download and decrypt your backups! Alternatively, you can move the configuration vars to an external file, chmod 600 it and source it inside the script.
#!/bin/bash LOGDIR="/var/log" TEMPDIR=$(mktemp -dp /var/tmp zimbra-backup-XXXXX) FTP_USER='myuser' FTP_PASSWORD='mypass' FTP_HOST='ftpserver.tld' PASSPHRASE='changeme' DUPLICITY='/usr/bin/duplicity' VERBOSE=5 RETENTION=3 VOLSIZE=2048 export FTP_PASSWORD export PASSPHRASE # what to backup, in my case: /dev/vgdata/mail VG=vgdata LV=mail # snapshot name LV_SNAP=ZimbraBackup # lvcreate and lvremove commands path lvcreate_cmd="/sbin/lvcreate" lvremove_cmd="/sbin/lvremove" echo Backup started at `date` # Stop the Zimbra services echo "Stopping the Zimbra services..." /etc/init.d/zimbra stop || exit echo "Creating a snapshot called $LV_SNAP" # depending on the time it takes to create the backup \
 and the traffic of your server,\
 you may need to increase the 2G value $lvcreate_cmd -L2G -s -n $LV_SNAP /dev/$VG/$LV # Create a mountpoint to mount the logical volume to echo "Creating a mountpoint for the LV..." mkdir -p $TEMPDIR/$LV_SNAP # Mount the logical volume to the mountpoint echo "Mounting the snapshot..." # WARNING: if you use xfs you MUST add nouuid option here! mount -o ro /dev/$VG/$LV_SNAP $TEMPDIR/$LV_SNAP/ # Start the Zimbra services echo "Restarting the Zimbra services..." /etc/init.d/zimbra start || echo "ERROR restarting zimbra" # Create the current backup FTP_PATH=zimbra DUPOPTS="-v$VERBOSE --full-if-older-than 1M --tempdir $TEMPDIR \
--exclude $TEMPDIR/$LV_SNAP/store/delme/ \
--allow-source-mismatch --volsize $VOLSIZE" # Clean up incomplete backup archive files $DUPLICITY cleanup --force -v$VERBOSE \ ftp://$FTP_USER@$FTP_HOST/$FTP_PATH/$i >>/$LOGDIR/$FTP_PATH.log # remove old backup sets: keep only the last N full backups,\
 where N is the value of $RETENTION $DUPLICITY remove-all-but-n-full $RETENTION --force -v$VERBOSE \ � ftp://$FTP_USER@$FTP_HOST/$FTP_PATH >>/$LOGDIR/$FTP_PATH # create new backup $DUPLICITY $DUPOPTS \ � $TEMPDIR/$LV_SNAP/ \ � ftp://$FTP_USER@$FTP_HOST/$FTP_PATH >>$LOGDIR/$FTP_PATH.log # Unmount /tmp/$lv_zimbra and remove the logical volume echo "Unmounting and removing the snapshot." umount /dev/$VG/$LV_SNAP $lvremove_cmd --force /dev/$VG/$LV_SNAP echo $lvremove_cmd /dev/$VG/$LV_SNAP # Done! echo Zimbra backed up to $FTP_PATH on $FTP_HOST echo Backup ended at `date`

Note: when you cut & paste the script, make sure the resulting file is in UNIX format.
Last update: 9 Aug 2010
andynz says: