Jumat, 11 Desember 2009

Partisi SWAP Hilang ? Non Aktif ?

By AinulHakim • October 6, 2007
Dua hari ini saya merasakan kerja laptop kesayangan yang berisikan Edubuntu menjadi berat… hardisk loading terus menerus. Prosedur cek space hdd sudah dilakukan ($df -dh) dan hasilnya masih dibawah 90%.
$top
pun sudah dilakukan dan suspek sementara ada pada gaim dan openoffice… yaa sementara saya non-aktifkan salah satu… hiks… problem solved…sementara. Namun ini tetap aneh, karena pada kondisi sebelumnya saya mainkan OpenOffice, Gaim, Thunderbird dan FireFox secara bersamaan tidak sampai seberat ini yang bahkan bisa dikatakan halted (hang). Akhirnyatiba tiba feeling mengatakan coba
$ free
dan tara…. hasilnya sebagai berikut :
smartikon@smartikon:~$ freetotal used free shared buffers cachedMem: 256088 251456 4632 0 3196 101936-/+ buffers/cache: 146324 109764Swap: 0 0 0
Ayoo mana coba anehnya… yap..swap nya 0 semuanya, langsung deh melakukan pengecekan ke fstab…
hah disana sudah terongok bawah /dev/hda2 masih aktif… akhirnya googling lagi dan alhamdulillah dapat 2 solusi, yaitu
1. Mengecek UUID dari masing masing device hdd kita dengan :
smartikon@smartikon:~$ blkid/dev/hda1: UUID="2f842d03-6725-4e84-8b6e-a558f41a6b9b" SEC_TYPE="ext2" TYPE="ext3"/dev/hda2: UUID="02256835-3354-46ae-a3fc-0783623be670" TYPE="swap"/dev/hda3: UUID="75de2520-5035-4d96-aedc-bb9f0dac8ee7" SEC_TYPE="ext2" TYPE="ext3"
dan ternyata setelah di cek kros dengan UUID pada /etc/fstab hasil pada /dev/hda2 dimana swap terdapat disana berbeda… langsung aja edit itu UUID di fstab hda2 menjadi sama persis dengan hasil blkid, kemudian save dan
$ sudo mount -a
beres….
smartikon@smartikon:~$ freetotal used free shared buffers cachedMem: 256088 251932 4156 0 3360 101976-/+ buffers/cache: 146596 109492Swap: 779144 0 779144
Adapun cara kedua yang saya dapat dari google adalah dengan :sudo swapon -a /dev/
Selamat Mencoba

Jumat, 11 September 2009

php telnet scripts

Baru nemu mu tak coba :

Usage Examples:


Basic usage
NOTE: With PHP Telnet versions before 1.1, the following code will not display error messages for certain types of connection failures. If you are using an older version, either upgrade to the current version or use the next code example.


require_once "PHPTelnet.php";

$telnet = new PHPTelnet();

// if the first argument to Connect is blank,
// PHPTelnet will connect to the local host via 127.0.0.1
$result = $telnet->Connect('www.somewhere.com','login name','password');

if ($result == 0) {

$telnet->DoCommand('enter command here', $result);
// NOTE: $result may contain newlines
echo $result;
$telnet->DoCommand('another command', $result);
echo $result;
// say Disconnect(0); to break the connection without explicitly logging out
$telnet->Disconnect();
}
?>


Display your own error messages
NOTE: With PHP Telnet versions before 1.1, the show_connect_error option was not supported. If you are using an older version, either upgrade to the current version, or delete the line that sets show_connect_error.

require_once "PHPTelnet.php";

$telnet = new PHPTelnet();
$telnet->show_connect_error=0;

// if the first argument to Connect is blank,
// PHPTelnet will connect to the local host via 127.0.0.1
$result = $telnet->Connect('www.somewhere.com','login name','password');

switch ($result) {
case 0:

$telnet->DoCommand('enter command here', $result);
// NOTE: $result may contain newlines
echo $result;
$telnet->DoCommand('another command', $result);
echo $result;
// say Disconnect(0); to break the connection without explicitly logging out
$telnet->Disconnect();
break;
case 1:
echo '[PHP Telnet] Connect failed: Unable to open network connection';
break;
case 2:
echo '[PHP Telnet] Connect failed: Unknown host';
break;
case 3:
echo '[PHP Telnet] Connect failed: Login failed';
break;
case 4:
echo '[PHP Telnet] Connect failed: Your PHP version does not support PHP Telnet';
break;
}
?>