Clear linux cached memory

if you want to clear the linux cached memory run “echo 3 > /proc/sys/vm/drop_caches”

root@pc:~# free
 total used free shared buffers cached
Mem: 3951136 2979376 971760 0 29704 2488576
-/+ buffers/cache: 461096 3490040
Swap: 3050492 2268 3048224
root@pc:~#  echo 3 > /proc/sys/vm/drop_caches
root@pc:~# free
 total used free shared buffers cached
Mem: 3951136 511264 3439872 0 1828 99752
-/+ buffers/cache: 409684 3541452
Swap: 3050492 2268 3048224

it clears it all 🙂

liveupgrade if you have SVM metadevices

if you have SVM (solaris volume manager,disk suite,metadevices), you can still liveupgrade….

consider this scenario, the OS lives in mirrored disks d0,d3,d4,d6:

root@myserver # df -h | grep -i md
/dev/md/dsk/d0 4.9G 3.2G 1.7G 66% /
/dev/md/dsk/d3 9.9G 4.1G 5.7G 42% /usr
/dev/md/dsk/d4 9.9G 3.4G 6.3G 35% /var
/dev/md/dsk/d6 101G 7.5G 93G 8% /opt
/dev/md/dsk/d5 4.9G 4.6G 336M 94% /spare

the metadevices look like this:

d0 -m d10 d20 1
d10 1 1 c1t0d0s0
d20 1 1 c1t1d0s0
d6 -m d16 d26 1
d16 1 1 c1t0d0s6
d26 1 1 c1t1d0s6
d5 -m d15 d25 1
d15 1 1 c1t0d0s5
d25 1 1 c1t1d0s5
d4 -m d14 d24 1
d14 1 1 c1t0d0s4
d24 1 1 c1t1d0s4
d3 -m d13 d23 1
d13 1 1 c1t0d0s3
d23 1 1 c1t1d0s3
d1 -m d11 d21 1
d11 1 1 c1t0d0s1
d21 1 1 c1t1d0s1

So we create two Boot Environments (BE), sol10u6(the current), and sol10u9(the one that will be upgraded)

lucreate -c sol10u6 -n sol10u9 
-m /:/dev/md/dsk/d40:ufs,mirror -m /:/dev/dsk/c1t0d0s0:detach,attach,preserve 
-m /usr:/dev/md/dsk/d43:ufs,mirror -m /usr:/dev/dsk/c1t0d0s3:detach,attach,preserve 
-m /var:/dev/md/dsk/d44:ufs,mirror -m /var:/dev/dsk/c1t0d0s4:detach,attach,preserve 
-m /opt:/dev/md/dsk/d46:ufs,mirror -m /opt:/dev/dsk/c1t0d0s6:detach,attach,preserve

Notice we create the alternate metadevices d40,d43,d44 and d46, to substitute d0,d3,d4 and d6 in the sol10u9 BE.

when we boot from the sol10u6 BE we will still see d0,d3,d4 and d6, when we boot the sol10u9 BE we will see  d40,d43,d44 and d46.

Next, we create the file to skip auto registration:

# echo "autoreg=disable" > /var/tmp/no-autoreg

Now we run the upgrade:

# luupgrade -k /var/tmp/no-autoreg -u -n sol10u9 -s /sol10u9

after the upgrade, we activate the sol10u9 BE

# luactivate sol10u9

Now, we restart the server, do not use “reboot”!

# init 6

Luckily the server comes up with sol10u9

create a pptpd vpn server

1. Install pptpd.

 sudo apt-get install pptpd

2. the contents of my pptpd.conf:

option /etc/ppp/pptpd-options
debug dump
logwtmp
localip 192.168.2.6
remoteip 192.168.2.230-239

The local IP address is the IP address of your server, the one in ifconfig. The remote IPs are a range you would like the remote user to use on your LAN.

3. My /etc/ppp/pptpd-options:

name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
nodefaultroute
lock
nobsdcomp

4. Add user names and passwords for the users you want to give access to your vpn.

 rdpm pptpd mypassword *

5. Enable ipv4 forwarding in /etc/sysctl.conf:

net.ipv4.ip_forward=1

6. enable the ipv4 forwarding setting

sysctl -p

7. restart pptpd

/etc/init.d/pptpd restart