Thursday, April 21, 2011

How to reset forgot MAC root password

1. boot computer and hold the "apple" key and the "s" key.
2. wait for terminal show
3. release keys
4. type without the quotes: "/sbin/mount -uaw"
5. press enter
6. type without the quotes: "rm /var/db/.applesetupdone
7. press enter
8. type without the quotes: "reboot"
9. press enter

this will let you create a new admin account when you reboot your computer.
Tuesday, April 5, 2011

How to incress swap file size of linux server

dd if=/dev/zero of=/temp/swapfile1 bs=1024 count=6000000 6000000 GB

/sbin/mkswap /temp/swapfile1

/sbin/swapon /temp/swapfile1

/temp/swapfile1 swap swap defaults 0 0


Procedure to add a swap file

You need to use dd command to create swapfile. Next you need to use mkswap command to set up a Linux swap area on a device or in a file.

a) Login as the root user

b) Type following command to create 512MB swap file (1024 * 512MB = 524288 block size):
# dd if=/dev/zero of=/swapfile1 bs=1024 count=524288

c) Set up a Linux swap area:
# mkswap /swapfile1

d) Activate /swapfile1 swap space immediately:
# swapon /swapfile1

e) To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file using text editor such as vi:
# vi /etc/fstab

Append following line:
/swapfile1 swap swap defaults 0 0

So next time Linux comes up after reboot, it enables the new swap file for you automatically.

g) How do I verify swap is activated or not?
Simply use free command:
$ free -m