Dapat info penting dari mas chakim yg istrinya kena angin duduk. berikut ini hal2 yang perlu diketahui.
Penyebab :
(1) Sering begadang/pengaruh angin malam
(2) Hobi nahan kentut/boel
(3) Lingkungan/cuaca dingin yang ekstrim dan terus menerus
(4) Telat makan
(5) Masuk angin biasa yang dibiarkan
ciri2nya
(1) rasanya seperti ada yg ngganjel di antara perut+dada
(2) ingin sendawa/kentut tapi susah sekali dan meskipun bisa hampir tidak mengurangi rasa sakit no.1
(3) dibawa duduk/...bungkuk/jalan/bahkan berbaring pun sulit
(4) badan rasanya dingin (bhs jawa: anyep)
Beda sama masuk angin biasa : angin duduk tidak bisa hilang meski sudah dikerokin/minum obat masuk angin/dioles minyak angin yang panas sekalipun
Cara mengatasi :
Sebelumnya olesin perut + dada + pinggang + punggung dengan minyak cap kap*k, bila perlu kerokan, trus masak air, air hangat hasil masak tsb dimasukkan dalam 2 buah botol (botol kaca lebih bagus), botol pertama letakkan di ulu hati atau bagian perut depan tempat angin duduk ga mau keluar, botol kedua diletakkan pada kedua telapak kaki, posisi badan rebah menghadap ke atas, bila perlu pakai jaket + celana training + kaos kaki + selimut tebal, tunggu sampai keringat dingin keluar dan bisa kentut, jika setelah setengah jam tidak kunjung reda, ganti air dalam botol yang udah kurang dingin dengan air hangat baru, dan tempel lagi di tempat spt diatas, semoga bermanfaat, mengingat resiko angin duduk ini adalah meninggal dunia jika terlambat mengatasi (based on a true story)
Angin duduk
| Friday, November 05, 2010
postfix, sendmail dan php
Barusan lagi update script untuk checking quota di mysql.
Scriptnya ini menggunakan PHP. Jika ada database yang melebihi quota yang disediakan maka akan di lock dan dikirim email pemberitahuan.
Nah ternyata waktu check quota ada notifikasi error
locking database /usr/sbin/sendmail not found.
Sepertinya error tersebut terjadi karena saya baru migrasi dari sendmail ke postfix.
Ternyata solusinya mudah. Pertama cari dulu binary sendmail
# whereis sendmail
sendmail: /usr/local/sbin/sendmail
Kemudian edit php.ini pada bagian berikut :
sendmail_path = /usr/local/sbin/sendmail -t -i -f noreply@domain.com
restart webserver dan silhakan test kembali..
install eaccelerator di freebsd
cd /usr/ports/www/eaccelerator
You have installed the eaccelerator package.
Edit /usr/local/etc/php.ini and add:
zend_extension="/usr/local/lib/php/20060613/eaccelerator.so"
Then create the cache directory:
mkdir /tmp/eaccelerator
chown www /tmp/eaccelerator
chmod 0700 /tmp/eaccelerator
u can try to config :
zend_extension="/usr/local/lib/php/20060613/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.shm_size
This setting will allow you to control the amount of shared memory eAccelerator should allocate to cache PHP scripts. The number sets the amount of memory in megabytes. Setting this value to 0 will use the default size.
eaccelerator.shm_size
This setting will allow you to control the amount of shared memory eAccelerator should allocate to cache PHP scripts. The number sets the amount of memory in megabytes. Setting this value to 0 will use the default size.
eaccelerator.shm_size = "0"
On Linux the maximum amount of memory a process can allocate is limited by the number set in /proc/sys/kernel/shmmax. Allocating more than this value will result in eAccelerator failing to initialise. The size in this file is given in bytes. You can raise this amount with:
echo value > /proc/sys/kernel/shmmax
Where value is the size in bytes you want to use. This value is reset to the default value evertime you reboot, but you can raise it permanently by adding the amount you need in /etc/sysctl.conf. This is done by adding:
kernel.shmmax = value
eaccelerator.cache_dir
This directory is used for the disk cache. eAccelerator stores precompiled code, session data, content and user entries here. The same data can be stored in shared memory (for quicker access). The default value is “/tmp/eaccelerator”.
eaccelerator.cache_dir = "/tmp/eaccelerator"
This is easy because that directory is easily writable to everyone, and mounted with noexec. However, it isn’t the best because on a lot of systems this directory is cleared on reboot. A better place is /var/cache/eaccelerator. Create the directory and make sure it’s writable to the process eAccelerator runs under.
A safe bet is making it world writeable, a safer and cleaner way is making the user php runs under (most of the time the same user as apache or lighttpd) the owner and set 0644 permissions.
The lazy way:
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
eaccelerator.enable
With this setting you can enable or disable eAccelerator. This may seem like a pretty stupid setting, but it can be very useful. For example this setting can also be used in the vhost section of the Apache configuration. It allows you to disable eAccelerator for a certian vhost by placing php_admin_value eaccelerator.enable 0 in the vhost section.
Setting this value to “1″ enables eAccelerator, which is also the default value. Setting it to “0″ will disable eAccelerator.
eaccelerator.enable = "1"
eaccelerator.optimizer
Enables or disables the optimizer which may speed up code execution. Setting it “1″ will enable eAccelerator, “0″ disables it. By default the optimizer is enabled. The optimizer will only run when the script is compiled before it’s cached.
eaccelerator.optimizer = "1"
eaccelerator.debug
Enables or disables debug logging. Setting this to 1 will print information to the log file about the cache hits of a file. This is only useful when debugging eAccelerator for bug reports.
eaccelerator.debug = 0
eaccelerator.log_file
Set the log file for eaccelerator. When this option isn’t set then the data will be logged to stderr, when using PHP with Apache these lines will be added to the Apache error log.
eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
eaccelerator.name_space
When using the user cache api for storing data in shared memory, all keys are prepended by the hostname used for the current request. This hostname equals the ServerName? set in the vhost section of apache. This is done to avoid duplicate keys between vhosts. Sometimes this behaviour is desired to share data between vhosts. When setting this option this namespace is used to prepend to each key. By default this is set to “” which instructs eAccelerator to use the hostname as namespace.
When setting this in the main PHP configuration file this namespace will be used by all vhosts. This value can also be set in the vhost section or even in a .htaccess file to allow sharing of data between only two vhosts.
eaccelerator.name_space = ""
eaccelerator.check_mtime
On every hit eAccelerator will check the modification time of a script to see if it changed and needs to be recompiled. Although this is a lot faster then opening the file and compiling it, this still adds some overhead because a stat call needs to be done every time. This setting allows you to disable this check. The downside of disabling this check is that you need to manually clean the eAccelerator cache when you update a file.
By default this check is enabled.
eaccelerator.check_mtime = "1"
eaccelerator.filter
Determine which PHP files can be cached. You can specify the pattern (for example “*.php *.phtml”) the PHP script filename needs to match. If a pattern starts with “!”, the files that match that pattern are excluded from the cache. Default value is “” which will cache all scripts PHP compiles.
Please note that eaccelerator.filter doesn’t work on a URL basis but rather on the absolute filesystem path, so a filter of !/home* would exclude all scripts in /home from being cached.
Multiple patterns need to be seperated by spaces or tabs, but not commas.
eaccelerator.filter = ""
eaccelerator.shm_max
By default there is no limit on the maximum size a user can put in shared memory with functions like eaccelerator_put, the maximum size is controlled by this setting. This value is the maximum size that can be put in the cache, the size is given in bytes (10240, 10K, 1M). The default value is “0″ which disables the limit.
This setting doesn’t affect the maximum size for a script”’
eaccelerator.shm_max = "0"
eaccelerator.shm_ttl
When eAccelerator doesn’t have enough free shared memory to cache a new script it will remove all scripts from shared memory cache that haven’t been accessed in at least shm_ttl seconds. By default this value is set to “0″ which means that eAccelerator won’t try to remove any old scripts from shared memory.
eaccelerator.shm_ttl = "0"
eaccelerator.shm_prune_period
When eAccelerator doesn’t have enough free shared memory to cache a script it tries to remove old scripts if the previous try was made more then “shm_prune_period” seconds ago. Default value is “0″ which means that eAccelerator won’t try to remove any old script from shared memory.
eaccelerator.shm_prune_period = "0"
eaccelerator.shm_only
Enable or disable caching of compiled scripts on disk. This has no effect on session data and content caching. Default value is “0″ which allows eAccelerator to use disk and shared memory cacche for scripts.
eaccelerator.shm_only = "0"
eaccelerator.compress
When using the eaccelerator_content_* api eAccelerator can compress the content before saving it to memory. By default this is set to “1″, to disable compression set it to “0″.
eaccelerator.compress = "1"
eaccelerator.compress_level
Compression level used for content caching. Default value is “9″ which is the maximum compression level.
eaccelerator.compress_level = "9"
eaccelerator.keys | session | content
These settings control the places eAccelerator may cache user content. Possible values are:
- shm_and_disk cache data in shared memory and on disk (default value)
- shm cache data in shared memory or on disk if shared memory is full or data size greater then “eaccelerator.shm_max”
- shm_only cache data in shared memory
- disk_only cache data on disk
- none don’t cache data
eaccelerator.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
The webinterface
eAccelerator can be managed through a webinterface. From version 0.9.5 this webinterface has been fully implemented in php so the settings have been changed.
taken from : http://techgurulive.com/2009/02/02/how-to-install-and-configure-the-eaccelerator-php-cache-on-apache/
Belum sempat nerjemahin.. ntar aja soale lagi seru coba2
Generate pdf problem
www | Wednesday, July 14, 2010
Pernah mengalami generate file dari script php ke pdf dan tidak berhasil?
padahal jika dilocalhost yg memakai xamp berjalan normal.
Setelah saya cek lebih lanjut ternyata jika record yg digenerate tidak begitu banyak, dibawah 100 record berhasil.
Nah lo, mulai berpikir.. apa mgkn konfigurasi buffer file atau cache file di php.ini nya atau webserver confignya.
Setelah mencoba mengulik2, alhamdulillah ketemu.Ini dia, dengan memory limit 96MB, maka generate 2ribu record berhasil dieksekusi. Tinggal disesuaikan dgn kebutuhan saja.
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 96M
libperl.so not found.
Snmp tiba2 ngga jalan. errornya gini :
/libexec/ld-elf.so.1: Shared object "libperl.so" not found, required by "libnetsnmphelpers.so.20"
Hmm file library ga nemu pathnya.. kalo ga abis upgrade2 paling yo kedelete..
Solusinya coba cari sbb :
server2# ldd /usr/local/sbin/snmpd
/usr/local/sbin/snmpd:
libnetsnmpagent.so.20 => /usr/local/lib/libnetsnmpagent.so.20 (0x2807e000)
libnetsnmphelpers.so.20 => /usr/local/lib/libnetsnmphelpers.so.20 (0x280b5000)
libnetsnmpmibs.so.20 => /usr/local/lib/libnetsnmpmibs.so.20 (0x280d3000)
libperl.so => /usr/local/lib/libperl.so (0x281b3000)
libm.so.4 => /lib/libm.so.4 (0x282b4000)
libcrypt.so.3 => /lib/libcrypt.so.3 (0x282ca000)
libutil.so.5 => /lib/libutil.so.5 (0x282e2000)
libnetsnmp.so.20 => /usr/local/lib/libnetsnmp.so.20 (0x282ee000)
libkvm.so.3 => /lib/libkvm.so.3 (0x2838d000)
libcrypto.so.4 => /lib/libcrypto.so.4 (0x28394000)
libc.so.6 => /lib/libc.so.6 (0x28487000)
libcrypto.so.7
server2#cp /usr/local/lib/perl5/5.8.9/mach/CORE/libperl.so /usr/local/lib
server2# snmpd
server2# ps ax | grep snmpd
8945 ?? S 0:00.11 snmpd
Alhamdulillah oke..
Disable SELINUX
Here is the way to disable selinux:
1-Edit /etc/selinux/config and set the SELINUX variable to 'disabled'
2-Use the setenforce command to disable on-the-fly
With solution 1, your changes are permanent but only effective if you reboot the machine.
With solution 2, your changes are NOT permanent but effective immediately.
Hope this clears it up :-).
taken from : http://www.linuxquestions.org
SE Linux
Install SE Linux
# apt-get install selinux-basics selinux-policy-default
# reboot
# nano /etc/default/rcS
edit FSCKFIX=yes
# nano /etc/cron.daily/mlocate (digunakan agar locate database tidak berjalan terus)
tambahkan exit 0 pd baris ke 2
Jika sudah selesai ketikkan :
# check-selinux-installation
# rm /var/run/motd
# ln -s /etc/motd.baru /etc/motd
Security Linux
1. Matikan dan buang service2 yang tidak perlu.
bisa install rcconf u/ mengatur startup.
dan apt-get remove packagegakpenting
2. Edit partisi, matikan eksekusi untuk partisi dimana user menaruh data (terutama web server)
3. Ubah file descriptor di sysctl.conf
your file descriptor must be beyond 65535
4. Upgrade ke kernel paling baru.
5. Atur firewall se secure mungkin. Allow port yang diperlukan saja.
6. Atur akses login user.
7. Sebisa mungkin jangan gunakan default port.
8. Disable root login from remote
9. Edit motd.
10. Coba main2 dgn sysctl.conf (beware, resiko ditanggung sendiri).
11. Secure kan service2 dan option pada program yg terinstall, misalnya : my.cnf, php.ini, httpd.conf, ftp.conf, snmpd.conf named.conf
12. Install tool pendukung monitoring :
- snmpd, ifstat, iptraf, snort, lsof, htop, deborphan, mtr, nikto. well why do i forget other tool in this critical moment..
Nanti ditambahkan kalau ada lagi.
Thx to cakri n google. u;re all da best.
mencari Package tidak perlu
# apt-get install deborphan
# deborphan -sz
# apt-get remove namapackage
atau
# apt-get remove --purge $(deborphan)
atau bisa juga
# orphaner
perintah di atas ada tampilan grafisnya ;)
Cisco2an
cisco | Thursday, April 29, 2010
# sh run
# conf term
# int Fastethernet0/1
# [config] ip address 10.10.10.1 255.255.255.240 secondary
# exit
# exit
# copy run start
# sh vlan
# conf term
# int Fastethernet0/1
dst2.. lali..
postingan ini hanya buat nyubie yg belajar cisco tanpa arah
PureFTPd di Linux.
Hari ini nyoba install via tarball, yg q jadikan eksperimen adalah pureftpd.
1. Download Source
wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.29.tar.gz
2. Ekstrak
tar -xzvf pure-ftpd-1.0.29.tar.gz
3. masuk ke directory hasil ekstrak
4. ./configure
Nah lo..koq pas configure error. :(
Ternyata compiler gak support, jadi harus install dulu
apt-get install gcc
apt-get install g++
Ulangi lagi deh configurenya, kemudian lanjutkan dgn perintah make && make install
kelanjutannya ada di postingan ini
Bagi yang compile dgn support mysql coba install dulu mysql-devel
apt-get mysql-devel
Install Snmpd..
Install snmpd cara praktis aja ya..
# apt-get install snmpd (linux)
# pkg_add -rv net-snmpd (fbsd)
Stl itu copy file konfigurasi :
# cp /etc/snmp/snmpd.conf.orig /etc/snmp/snmpd.conf (linux)
# cp /usr/local/share/snmpd/snmpd.conf.example /usr/local/share/snmpd/snmpd.conf (bsd)
Edit /etc/snmp/snmpd.conf :
com2sec local localhost public
com2sec local ipmrtgserver public
Edit /etc/default/snmpd : (freebsd ga perlu proses ini)
remove ip 127.0.0.1
Restart snmp : /etc/init.d/snmpd restart
Manage startup service
Untuk meremove service di linux sewaktu startup ada bbrp cara :
1. # update-rc.d -f NAMASERVICE remove
contoh :
# update-rc.d -f exim4 remove
2. Install rrconf
# apt-get install rcconf
tunggu proses selesai, ketik :
# rcconf
Tinggal check/uncheck yg ga perlu aja, kayak msconfig gitu..
Kalo di FreeBSD, tinggal cek aja isi /etc/rc.conf atau cek didirectory /usr/local/etc/rc.d
Wokeh.. selamat berbahagia..
bunuh semua!!
Cara membunuh/kill semua proses pada suatu daemon adl sbb :
ps -ax | grep "/usr/local/sbin/httpd" | awk '{print $1}' | xargs kill
atau kalau mau lihat process owner idnya
ps -aux | grep "/usr/local/sbin/httpd" | awk '{print $2}' | xargs kill
nb : bedanya cuman di awk row nya aja..
bigmem Vs PAE
Memory anda lebih dari 4GB? tapi tidak terdeteksi semua?
Apa pasal?
Hal ini dikarenakan OS yg terinstall 32bit dan kernel bigmem (di linux) atau PAE (di FreeBSD) belum diaktifkan.
Untuk FreeBSD ada 2 cara :
1. tambahkan baris berikut di file kernel anda dan compile ulang
options PAE
menambahkan baris tersebut akan menyebabkan beberapa driver tidak disupport, jadi perlu dipertimbangkan apakah driver dipakai atau tidak.
2. Cara kedua adalah dengan cara install ulang dgn ISO AMD64.
Untuk Debian coba langkah berikut.
- Install lshw untuk cek memori real anda
# apt-get install lshw
# lshw -C memory
# dpkg --get-selections | grep bigmem
# apt-get install linux-image-2.6.26.2-686-bigmem
Cek hasil instalasi kernel dgn perintah berikut :
# dpkg --get-selections | grep bigmem
linux-image-2.6.26.2-686-bigmem install
Untuk menu booting lihat dulu
# grep "Debian GNU" /boot/grub/menu.lst | nl -v0
Sesuaikan menu kernel dgn nomer default boot.
mounting...
kalo tiba2 fbsd ngadat n masuk mountroot, gimana donk ?
1. perhatikan kabel HD yg terpasang apakah sudah di set primary?
2. perhatikan jumper HD, sbg master atau slave wkt instalasi.
Kalau sistem msk single mode dan hanya read only mode. Sedangkan kita butuh ngedit /etc/fstab buat ngedit mount pointnya, caranya sbb :
mount -t ufs rw /dev/ad0s1a / (mounting root, nm partisi sesuiakan)
sunlink
Sunlink bukan merk sabun cuci maupun shampo..
Sunlink di freebsd digunakan untuk memblok delete permission dgn kata lain smua user tidak bisa menghapus file yg telah di sunlink.
Perintahnya :
# chflags sunlink ojodidel.txt
Untuk menonaktifkan sunlink sbb :
# chflags nosunlink ojodidel.txt
Mengenal beberapa Unix tool.
1. Sed
Sed adalah stream editor. Pada dasarnya digunakan untuk manipulasi text.
Perintah dasar.
sed [-lrn] [-e 'sedscript'] [file1 file2 ...]
-l : line buffered
-r : extended regex
-n silences default output
Paling males kan baca perintah dasar? soalnya saya blm paham kalau ngga ada contohnya :P.
% echo "Hello there foo" | sed -e 's/foo/bar/'
Hello there bar
nah.. paham kan? perintah diatas dpt digunakan untuk mereplace foo menjadi bar
saya mencoba perintah berikut dan berhasil
# more limit | sed -e 's/fxp1/rl0/' >> limitbaru
perintah diatas adalah membaca file dgn nama limit dan mereplace semua kata yg mengandung fxp1 menjadi rl0 dan hasilnya disimpan dalam file limitbaru
Perintah sed juga bisa berfungsi seperti grep.
% sed -ne '/FreeBSD/p' /etc/motd
FreeBSD 6.2-PRERELEASE (FOO) #0: Sat Nov 11 00:12:52 EST 2006
Welcome to FreeBSD!
Dapat digunakan juga untuk melihat header mail.
% cat mymail \
| sed -ne '/^[A-Za-z0-9]/ { x; /^Received: /{p;}; }; /^[A-Za-z0-9]/!H'
Received: from localhost (localhost [127.0.0.1])
by whitefox.csh.rit.edu (Postfix) with ESMTP id 731F81145C
for
Received: from whitefox.csh.rit.edu ([127.0.0.1])
by localhost (whitefox.csh.rit.edu [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id EURHKUeHSrao for
Sat, 19 May 2007 01:19:16 -0400 (EDT)
2. cut
Cut digunakan untuk memotong bbrp bagian dr data.
Perintah dasar
cut [-d delim -f range] [-c range] [-b range]
% echo "one,two,three,four" | cut -d"," -f 1,3
one,three
yang tdk bisa dieksekusi oleh cut
% echo "one two three" | cut -d' ' -f 2
% echo "one two three" | awk '{print $2}'
two
3. awk
awk merupakan filter tool pada scripting
Perintah dasar
awk [-F
awk mempunyai 2 konsep data spyt pd input file yaitu field dan record
record adalah seluruh baris, pemisah antar record adl baris baru
field adalah kata2, pemisahnya adalah spasi atau tab. default pemisahnya adalah spasi tapi bs juga sebuah karakter atau regular expression.
pattern : [condition_expressions] { [action_expressions] }
% fstat | sed -e 1d \
| awk '{a[$1]++} END { for (i in a) { print i, a[i] } }' \
| sort -nk2
smmsp 8
_dhcp 11
www 45
root 328
jls 482
Show file yg tdk kosong
% ls -l | awk '$5 > 0'
Show log antar 10 May dan 20 May
% cat *.log | awk '$1 == "May" && ($2 >= 10 && $2 <= 20)'
Show ip dari perintah host
% host www.google.com | awk '/has address/ { print $4 }'
Sulit sekali memahami perintah awk ini..
Tapi emang powerfull bgt..
4. xarg
xarg digunakan untuk mengambil argumen dan digunakan untuk menjalakan program.
Perintah dasar
xargs [flags] [command [args]]
# delete png file
% find ./i/ -name '*.png' | xargs rm
% cat /tmp/somehosts \
| xargs -P10 -I"HOST" -n1 sh -c 'ssh HOST uptime | sed -e "s/^/HOST: /"'
Tiba2 koq laper.. :(
Sampe sini aja dulu...
Taken : semicomplete.com
cara reset mikrotik
hardware | Tuesday, November 03, 2009
Teman2 sempat pusing mikirin ada perangkat mikrotik warisan tapi lupa passwordnya. Dari googling ada cara ribet yaitu install ulang OS nya via kabel dan butuh software ini itu [lupa].
Tapi hal itu takkan pernah terjadi setelah nemu postingan di forum berikut :
look above: this little hole is JP1, Stick a screwdriver in it while booting (to short-circuit it) and it will reset the config.
thx a lot to http://forum.mikrotik.com