YourSite - Slogan Here!

Cara menjalankan ntpdate under virtual machine Proxmox

Some of OpenVZ containers, on servers that I manage, had problems with wrong date being displayed. Well, no big deal, I can just issue good old ntpdate command. Or not.

ntpdate[22082]: Can’t adjust the time of day: Operation not permitted


On HW host:

/usr/sbin/vzctl stop  <ctid>

/usr/sbin/vzctl set <ctid>  –capability sys_time:on  –save

/usr/sbin/vzctl start  <ctid>

Check if everything is working now:

ntpdate[3238]: adjust time server offset -0.142383 sec

Comments Off

Change local time

Change local time Centos on Proxmox

mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/Asia/Jakarta /etc/localtime

Comments Off

Upgrade Clamav from Portupgrade

Install portupgrade if you didn’t already. Skip this part if you have it on your system.

# portsnap fetch

# portsnap update

# cd /usr/ports/ports-mgmt/portupgrade

# make install clean

Here comes the regular upgrading part. First we need to update our ports tree everytime we decide to upgrade ClamAV package. Then we create or update (+fix) the system package database which is used by the portupgrade tool suite. We stop the services and we let portupgrade take care of the rest.

# portsnap fetch

# portsnap update

# pkgdb -Fu

# /usr/local/etc/rc.d/clamav-clamd stop

# /usr/local/etc/rc.d/clamav-freshclam stop

# portupgrade clamav

Upgrade FreeBSD to FreeBSD 9.0-RELEASE

Step 1: The upgrade

Let’s get right to it. Here’s the first step in the upgrade process:

freebsd-update upgrade -r 9.0-RELEASE

Once all files have been fetched, you will be asked a number of questions about merging config-files. They all seemed reasonable to me, so I just answered ‘y’ to all of them, but it might differ for you. Make sure you read the diff before accepting it.

If you get the following error:

The update metadata is correctly signed, but failed an integrity check. Cowardly refusing to proceed any further.Then simply patch your freebsd-update using the following command (source):

sed -i -e ’s/=_/=%@_/’ /usr/sbin/freebsd-updateand then re-run the upgrade command again.

If that went fine, it’s time to update the actual system. To do that, run:

freebsd-update installOnce the update is done, reboot your system:

shutdown -r nowWhen it comes back up, make sure you run the install-again to install again to intall the userland updates:

freebsd-update install

Once you’ve run this, you’ll get the message:

Completing this upgrade requires removing old shared object files.   Please rebuild all installed 3rd party software (e.g., programs installed from the ports tree) and then run “/usr/sbin/freebsd-update install” again to finish installing updates.This is of course a massive pain in the butt, but you need to do this nonetheless. Depending on how many packages from ports you have installed, this may take everything from a few minutes to a long time.

The easiest way to do this is to run portupgrade (if you don’t have portupgrade, install it from ‘sysutils/portupgrade’):

rm /var/db/pkg/pkgdb.db && pkgdb -Ffuv && portupgrade -afp

I added the ‘p’-flag, as this allows you to run ‘portupgrade -afP’ on other nodes (assuming you have a shared ports-tree) and just install the packages without having to re-compile them.

Finally, when you’ve done this, you can run (for the last time):

freebsd-update install

FreeBSD Patch

Untuk melakukan patching di OS FreeBSD cukup mengetikkan :

freebsd-update fetch
freebsd-update install


CVSUP Syntax

*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix

Untuk menghapus ^M pada script PHP



Note : ^M = Ctrl + vm

Cara Compile Kernet FreeBSD 64bit

#cd /usr/src/sys/amd64/conf
#vi MySMP
ubah GENERIC menjadi MyGENERIC

tambahkan text dibawah
options         IPFIREWALL
options         IPFIREWALL_VERBOSE
options         IPDIVERT

#cd /usr/src/
#make buildkernel KERNCONF=MySMP
#make installkernel KERNCONF=MySMP
#cd /etc
#vi rc.conf

tambahkan :
#vi /etc/ipfw.rules

tambahkan :
$fwcmd -f flush
$fwcmd add allow ip from any to any via lo0

Tambahkan rules ipfw sesuai kebutuhan

Untuk menghapus file yang jumlahnya banyak di *nix

for i in *; do echo $i; rm -f $i; done

Kalo mau lebih cepat pakai ini

time perl -e 'for(<*>){((stat)[9]<(unlink))}'

Kalo untuk menghapus Content SPAM

find /PATH/ -type f -exec grep -qiF MAILER-DAEMON \{\} \; -print

find /PATH/ -type f -exec grep -qiF MAILER-DAEMON \{\} \; -delete

How do I change mysql root password?

If you are setting a root password first time, use any one of the following command syntax:
mysqladmin password “NEW-PASSWORD
mysqladmin -u root password “NEW-PASSWORD
mysqladmin -u root -h localhost password “NEW-PASSWORD