Senin, 23 Februari 2015

Pengalaman Cabut Gigi geraham bungsu di Surabaya

Halo semuanya...

kali ini saya ingin berbagi pengalaman mengenai SERAM nya pergi ke dokter gigi.
SERAM ?? ternyata TIDAK !!.. dokter gigi yang menerima saya masih muda, masih dibawah 30th an.


Jumat, 13 Februari 2015

Install Cacti On Debian 7 [Work] + menampilkan data Graph


Contents:
Overview of Cacti
Cacti is a web based network monitoring and graphing tool. The framework Cacti is built on allows you to poll a vast number of different devices and applications throughout your environment. Everything from Cisco, VMware, Juniper, Apache, Tomcat, Windows, Linux, BSD - you name it and it can probably be monitored and graphed by Cacti. The developers have made Cacti fairly easy to install on a Linux based system but there are a large number of pre-requisites and weird jargon on the Cacti website that it can be intimidating. Here I will outline the steps to install a base Cacti server on Debian 7 ("Wheezy"). In future articles I will outline how to add devices to monitoring, data sources and create graphs.


The steps outlined below can cause data loss. Do not run them on a production system without fully understanding the process and testing in a development environment.



These instructions are not meant to be exhaustive and may not be appropriate for your environment. Always check with your hardware and software vendors for the appropriate steps to manage your infrastructure.


Formatting:
Instructions and information are detailed in black font with no decoration.

Code and shell text are in black font, gray background, and a dashed border.
Input is green.
Literal keys are enclosed in brackets such as [enter], [shift], and [ctrl+c].
Warnings are in red font.




Steps install a Cacti Server

  1. Log in to your system and launch a local shell prompt.

  2. Change your shell to run as root.
    user@debian~$: su -
    Password:
    root@debian~$:

  3. Verify the system information.
    root@debian:~# uname -a
    Linux cacti 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u1 x86_64 GNU/Linux


  4. Perform an update to the package database.
    root@debian:~# apt-get update
    Get:1 http://ftp.us.debian.org stable Release.gpg [1,655 B]
    ...
    Hit http://ftp.us.debian.org wheezy-updates/main Translation-en/DiffIndex
    Fetched 32.8 MB in 13s (2,409 kB/s)
    Reading package lists... Done
    Note that some data was removed for clarity.


  5. Install Cacti using the package manager.
    root@debian:~# apt-get install cacti
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
    apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common dbconfig-common file fontconfig
    fontconfig-config heirloom-mailx javascript-common libaio1 libapache2-mod-php5 libapr1 libaprutil1
    libaprutil1-dbd-sqlite3 libaprutil1-ldap libcairo2 libcap2 libclass-isa-perl libdatrie1 libdbd-mysql-perl
    libdbi-perl libdbi1 libffi5 libfontconfig1 libglib2.0-0 libglib2.0-data libhtml-template-perl libjs-jquery
    libjs-jquery-cookie libldap-2.4-2 libmagic1 libmysqlclient18 libnet-daemon-perl libonig2 libpango1.0-0
    libpcre3 libperl5.14 libphp-adodb libpixman-1-0 libplrpc-perl libpng12-0 libqdbm14 librrd4 libsasl2-2
    libsasl2-modules libsensors4 libsnmp-base libsnmp15 libswitch-perl libthai-data libthai0 libxcb-render0
    libxcb-shm0 libxft2 libxml2 libxrender1 mime-support mysql-client-5.5 mysql-common mysql-server
    mysql-server-5.5 mysql-server-core-5.5 openssl perl perl-modules php5-cli php5-common php5-mysql php5-snmp
    psmisc rrdtool sgml-base shared-mime-info snmp ssl-cert ttf-dejavu ttf-dejavu-core ttf-dejavu-extra
    wwwconfig-common xml-core
    Suggested packages:
    www-browser apache2-doc apache2-suexec apache2-suexec-custom php5-ldap moreutils virtual-mysql-client
    mysql-client postgresql-client exim4 mail-transport-agent php-pear libipc-sharedcache-perl ttf-baekmuk
    ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp ttf-arphic-bkai00mp php5-adodb
    libcompress-zlib-perl libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql
    libsasl2-modules-gssapi-mit libsasl2-modules-gssapi-heimdal lm-sensors snmp-mibs-downloader
    libterm-readkey-perl tinyca ca-certificates perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl
    libpod-plainer-perl librrds-perl sgml-base-doc openssl-blacklist debhelper
    Recommended packages:
    apache2 lighttpd nginx httpd mailx
    The following NEW packages will be installed:
    apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common cacti dbconfig-common file fontconfig
    fontconfig-config heirloom-mailx javascript-common libaio1 libapache2-mod-php5 libapr1 libaprutil1
    libaprutil1-dbd-sqlite3 libaprutil1-ldap libcairo2 libcap2 libclass-isa-perl libdatrie1 libdbd-mysql-perl
    libdbi-perl libdbi1 libffi5 libfontconfig1 libglib2.0-0 libglib2.0-data libhtml-template-perl libjs-jquery
    libjs-jquery-cookie libldap-2.4-2 libmagic1 libmysqlclient18 libnet-daemon-perl libonig2 libpango1.0-0
    libpcre3 libperl5.14 libphp-adodb libpixman-1-0 libplrpc-perl libpng12-0 libqdbm14 librrd4 libsasl2-2
    libsasl2-modules libsensors4 libsnmp-base libsnmp15 libswitch-perl libthai-data libthai0 libxcb-render0
    libxcb-shm0 libxft2 libxml2 libxrender1 mime-support mysql-client-5.5 mysql-common mysql-server
    mysql-server-5.5 mysql-server-core-5.5 openssl perl perl-modules php5-cli php5-common php5-mysql php5-snmp
    psmisc rrdtool sgml-base shared-mime-info snmp ssl-cert ttf-dejavu ttf-dejavu-core ttf-dejavu-extra
    wwwconfig-common xml-core
    0 upgraded, 82 newly installed, 0 to remove and 0 not upgraded.
    Need to get 46.7 MB of archives.
    After this operation, 212 MB of additional disk space will be used.
    Do you want to continue [Y/n]? y [enter]
    Get:1 http://ftp.us.debian.org/debian/ stable/main libcap2 amd64 1:2.22-1.2 [13.6 kB]
    Get:2 http://security.debian.org/ wheezy/updates/main libxml2 amd64 2.8.0+dfsg1-7+wheezy1 [904 kB]
    There is 82 packages it must install on a default Debian 7 install. Allow the download and installation to take place.

  6. The package manager will ask several questions to complete the install. First select the web server.
    Please select the web server for which Cacti should be automatically configured.
    Select "None" if you would like to configure the web server manually.
    Web server:
    apache [enter]
    lighttpd
    None

  7. Enter the MySQL root account password.
    While not mandatory, it is highly recommended that you set a password for the MySQL administrative "root" user.
    If this field is left blank, the password will not be changed.
    New password for the MySQL "root" user:
    abc123[enter]
    Repeat password for the MySQL "root" user:
    abc123[enter]
    Enter a real password.

  8. Configure Cacti with dbconfig-common.
    The cacti package must have a database installed and configured before it can be used. This can be optionally handled with dbconfig-common.
    Configure database for cacti with dbconfig-common?
    Yes[enter]

  9. Provide the root password for MySQL to create the Cacti database.
    Please provide the password for the administrative account with which this package should create its MySQL database and user.
    Password of the database's administrative user:
    abc123[enter]

  10. Provide a password for the cacti MySQL user.
    Please provide a password for cacti to register with the database server. If left blank, a random password will be generated.
    MySQL application password for cacti:
    123abc[enter]
    Password confirmation:
    123abc[enter]
    Note this is NOT the root password but a new account for the user of the cacti database.

  11. The installation will complete but Cacti must be configured. Open a graphical web browser on another system that has access to the server you just installed Cacti on and go to http:///cacti. For my system it was http://10.1.10.107/cacti

  12. Once the web page loads, select New Installation and click next.

  13. If needed, change any of the paths to the correct location if it says "Not Found." By default mine looked like this and did not need modifications.

  14. Log in with the username admin and password admin.

  15. It will force you to change the admin password, do so and hit save.

  16. Cacti is now installed on your server.



Conclusion
Installing Cacti on Debian 7 Linux is straight forward using the package manager. Following this step-by-step guide you should now have a fully functional Cacti monitoring server.

References

*disclaimer* This document is my own and does not represent anything from any other entity. I will not be held liable for anything bad that comes of it.

sumber : http://ewams.net/?date=2014/07/14&view=How_to_install_Cacti_on_Debian_7_Step_by_Step   


kemudian. install snmpd
apt-get install snmpd.
edit /etc/snmp/snmpd.conf

Pada bagian ini
#
#  ACCESS CONTROL
#

                                                 #  system + hrSystem groups on$
view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1


Ubah menjadi
#
#  ACCESS CONTROL
#

                                                 #  system + hrSystem groups on$
view   systemonly  included   .1.3.6.1.2.1.
view   systemonly  included   .1.3.6.1.2.1.25.1

pada pada console -> devices -> add (pada pojok kanan)
lalu isikan informasi tentang device tersebut.
snmp v1 : public
SNMP int -> bw(In/Out) bits

Hasil :

Senin, 02 Februari 2015

VIM Search and Replace, dan find file ukuran tertentu

:%s/foo/bar/g
Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.
:s/foo/bar/g
Find each occurrence of 'foo' (in the current line only), and replace it with 'bar'.
Melihat jumlah file dan file size berukuran tertentu

# find . -type f | wc -l
29

# find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }' | more

atau kebalikannya

find / -type f -size +20000k -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nrk 2,2 | more

setting squid basic

# ACCESS CONTROLS
# -----------------------------------------------------------------------------
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443  # https
acl SSL_ports port 563  # snews
acl SSL_ports port 873  # rsync
acl Safe_ports port 80  # http
acl Safe_ports port 21  # ftp
acl Safe_ports port 443  # https
acl Safe_ports port 70  # gopher
acl Safe_ports port 210  # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280  # http-mgmt
acl Safe_ports port 488  # gss-http
acl Safe_ports port 591  # filemaker
acl Safe_ports port 777  # multiling http
acl Safe_ports port 631  # cups
acl Safe_ports port 873  # rsync
acl Safe_ports port 901  # SWAT
acl purge method PURGE
acl CONNECT method CONNECT

# Ijinkan akses cachemgr hanya dari localhost
http_access allow manager localhost
http_access deny manager

# Ijinkan request purge hanya dari localhost
http_access allow purge localhost
http_access deny purge

# Deny request ke ports yang tidak dikenal
http_access deny !Safe_ports

# Deny CONNECT selain ke port SSL
http_access deny CONNECT !SSL_ports


# Ini adalah network LAN di kantor Anda
acl jaringan_saya src 192.168.1.0/24 192.168.2.0/24
http_access allow jaringan_saya 
http_access allow localhost

# Dan akhirnya deny semua akses ke proxy ini
http_access deny all

icp_access deny all


# NETWORK OPTIONS
# -----------------------------------------------------------------------------

# Squid biasanya dijalankan di port 8080
http_port 8080


# DISK CACHE OPTIONS
# -----------------------------------------------------------------------------

# Saya alokasikan 10000 MB space harddisk
cache_dir ufs /var/spool/squid3 10000 16 256


# LOGFILE OPTIONS
# -----------------------------------------------------------------------------
access_log /var/log/squid3/access.log squid


# OPTIONS FOR TUNING THE CACHE
# -----------------------------------------------------------------------------
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY

refresh_pattern ^ftp:  1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern .  0 20% 4320


# HTTP OPTIONS
# -----------------------------------------------------------------------------

# Apache mod_gzip and mod_deflate known to be broken so don't trust
# Apache to signal ETag correctly on such responses
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

#  TAG: extension_methods
# Squid only knows about standardized HTTP request methods.
# You can add up to 20 additional "extension" methods here.
extension_methods REPORT MERGE MKACTIVITY CHECKOUT


# DNS OPTIONS
# -----------------------------------------------------------------------------
hosts_file /etc/hosts


# MISCELLANEOUS
# -----------------------------------------------------------------------------
coredump_dir /var/spool/squid3


sumber : http://ngadimin.com/wp-content/uploads/2009/10/squid.conf.txt
Related Posts Plugin for WordPress, Blogger...