Showing posts with label Troubleshooting. Show all posts

LOG: logger shutting down Error Postgresql (With Restart)

Login with postgres user
# su postgres

And then restart PostgreSQL
$ pg_ctl -D /usr/local/pgsql/data restart

Traceroute With Port Email

Sometime you must your internet provider for check what network support for email server:

# traceroute -n -T -p 25 gmail-smtp-in.l.google.com

BIND 9 Install / Named in Ubuntu


Bind is great DNS software. If you want to install follow this intruction:

  1. apt-get update
  2. apt-get upgrade
  3. apt-get install bind9
  4. /etc/init.d/apparmor teardown
  5. update-rc.d -f apparmor remove
  6. wget --user=ftp --password=ftp ftp://ftp.rs.internic.net/domain/db.cache -O /etc/bind/db.root
  7. Change/Add this line in /etc/bind/named.conf.option in option{}
    allow-query { any; };
    allow-recursion { any; };
    forwarders {
    8.8.8.8;

    8.8.4.4; 

    };
    dnssec-validation no;
  8. /etc/init.d/bind9 restart
  9. update-rc.d bind9 defaults

Done thank's

Nur Choliku Anwar

KeyError: 'eth0' pada saat install Clear OS

Problems with installing? KeyError: 'eth0' ?
When I tried to install ClearOS on a certain computer I had a problem under the installation. It came with an error like "KeyError: 'eth0'" and then just stopped the installation.

The solution for this problem is to start the installation with a parameter. You type in the parameter when being in the first menu under the installation (the menu where you choose if you want to install, upgrade etc.). You need to be on the first option in the menu, then hit the "Tab"-key on your keyboard. Afterwards a command line is displayed. Add a space at the end of the line and then type biosdevname=0 and hit Enter.

The installation should proceed now without any errors.

could not create semaphores: No space left on device (Shared Memory and Semaphores)

Pernah ketemu problem kaya gitu?

Postgresqlnya ga bisa hidup...nyebelin kan..

Trus Gimana?


  1. Kurangi nilai max_connections pada postgresql.conf
  2. Tambahkan nilai kernel.shmmax dan kernel.shmall pada /etc/sysctl.conf
  3. #sysctl -p
  4. service postgresql start
  5. FINISH

Change Password Postgresql

  1. Bypass login with setting /var/lib/pgsql/data/pg_hba.conf From "MD5" to "ident" (REMEMBER!: return back after finish), example:
    local all all ident
    host all all 127.0.0.1/32 ident
    host all all 0.0.0.0/0 md5
    host all all ::1/128 ident
  2. service postgresql restart
  3. su postgres
  4. psql
  5. ALTER USER postgres WITH ENCRYPTED PASSWORD 'password';
  6. \q
  7. exit
  8. service postgresql restart
Salam,

Nur Cholikul Anwar

Disable IPV6 Centos

# vim /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

# sysctl -p

Device eth0 does not seem to be present, delaying initialization

For Solve that problem:

# echo "" > /etc/udev/rules.d/70-persistant-net.rules
# vim /etc/sysconfig/network-scripts/ifcfg-eth0 # reboot

HWADDR=YOUR_MAC_ADDRESS

Salam,

Nur Cholikul Anwar

Repositori Centos 6.3 ke kambing UI




[Add-Ons]
name=CentOS
baseurl=http://kambing.jaringankantor.com/centos/6.3/addons/i386/
enabled=1
gpgcheck=1
gpgkey=http://kambing.jaringankantor.com/centos/RPM-GPG-KEY-CentOS-6

[CentOS-Plus]
name=CentOS
baseurl=http://kambing.jaringankantor.com/centos/6.3/centosplus/i386/
enabled=1
gpgcheck=1
gpgkey=http://kambing.jaringankantor.com/centos/RPM-GPG-KEY-CentOS-6

[Extras]
name=CentOS
baseurl=http://kambing.jaringankantor.com/centos/6.3/extras/i386/
enabled=1
gpgcheck=1
gpgkey=http://kambing.jaringankantor.com/centos/RPM-GPG-KEY-CentOS-6

[Fasttrack]
name=CentOS
baseurl=http://kambing.jaringankantor.com/centos/6.3/fasttrack/i386/
enabled=1
gpgcheck=1
gpgkey=http://kambing.jaringankantor.com/centos/RPM-GPG-KEY-CentOS-6

[OS]
name=CentOS
baseurl=http://kambing.jaringankantor.com/centos/6.3/os/i386/
enabled=1
gpgcheck=1
gpgkey=http://kambing.jaringankantor.com/centos/RPM-GPG-KEY-CentOS-6

[Update]
name=CentOS
baseurl=http://kambing.jaringankantor.com/centos/6.3/updates/i386/
enabled=1
gpgcheck=1
gpgkey=http://kambing.jaringankantor.com/centos/RPM-GPG-KEY-CentOS-6


Find Content File in linux And count

#grep -r “oci_connect” /data/lms/htdocs


This will search the contents of the file with the word "oci_connect" in the folder / etc is recursive
Options that are often used are:
- R: recursive to sub folder
- S: supressed altogether error message, usually because there is no file access authority
- F: looking for fix-string, in expression


And so how to count that line that containt "nurcholikulanwar"?
grep -r "nurcholikulanwar" /data/lms/htdocs | wc -l

Last ID in PostgreSQL using adodb


$sql="INSERT INTO pollquestion (question,pollID,dtcreated,dtmodified) values (".
tosql($txtquestion,"Text").", ".
tosql($pollid,"Number").", ".
"Now(),Now())";
$svdb=clone $db;
$svdb->query($sql.' RETURNING questionid');
$svdb->next_record();
$qid=$svdb->f("questionid");

and you can try:
$this->master_conn->PO_Insert_ID('announcement','modid');
=>> 'announcement': table name
=>> 'modid': an increment id

How To fix invalid byte sequence for encoding "UTF8"

To solve that: clear the spaces between the commas in sql query PHP or you can add/change to:
utf8_encode($variabel);

Salam,

[NCA]

Differences Postgresql Script and Mysql Script


This is Differences Postgresql Script and Mysql Script


mysql: SHOW DATABASES
postgresql: \l
postgresql: SELECT datname FROM pg_database;


mysql: SHOW TABLES
postgresql: \d
postgresql: SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';


mysql: DESCRIBE TABLE
postgresql: \d+ table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';


mysql: SHOW COLUMNS
postgresql: \d table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';


Export Data MySQL kedalam file format CSV

mysqldump -u [username] -p -t -T/tmp [database] --fields-enclosed-by=\" --fields-terminated-by=,

If you have problem don't change /tmp directory :-)

and this is an output (example):

"1","Nur Cholikul","Anwar","2000-01-01 01:01:01"
"2","Putri","Yuniartis"," 2000-01-01 01:01:01 "
"3","Jaringan","Kantor"," 2000-01-01 01:01:01 "

Membuat Perbandingan atau rasio Terkecil antar 2 (dua) angka Excel

Misalkan:
Ada Dua buah angka yang berada di A1 dan B1 untuk hasilnya ditampikan pada C1
     |  A   |  B   |  C  |
 1  | 12  | 16 | 3:4 |

Maka rumus untuk C1 adalah:
=IF(OR(A1=0, B1=0),A1&":"&B1,(A1/GCD(A1,B1))&":"&(B1/GCD(A1,B1)))

GCD: digunakan untuk mencari FPB (Faktor Persekutuan Besar)


Suppose that:
There are Two numbers are in A1 and B1 to C1 results are displayed in

     |  A   |  B   |  C  |
 1  | 12  | 16 | 3:4 |


Then the formula for C1 is:
= IF (OR (A1 = 0, B1 = 0), A1 & ":" & B1, (A1/GCD (A1, B1)) & ":" & (B1/GCD (A1, B1)))

GCD: used to find gcd (a factor of the Great Guild)


Salam damai selalu,

NCA :-)

Chown with folder/file name

Example you have a folder or file name at /home

abdillah             fauzan            kjbi           rosmaniar
adbis                fehmeed           kji            sekretariat
admin                fikri             kmk            sekretariatpd1
admniaga             grafika           kopma          sekretariatpd2
agah                 gretha            ksa            sekretariatpd3
agung                hani              ksm            sekretariatpd4

and then you want that folder/file get owner same as folder/file name.

Try this:

  1. cd /home
  2. Type at terminal:
     for file in *; do
    chown  -R $file'.pnj' $file;
    done
  3. Finish :-)

Authentication With LDAP


   # setup
+--------[ Choose a Tool ]---------+
| |
| Authentication configuration |
| Firewall configuration |
| Keyboard configuration |
| Network configuration |
| System services |
| Timezone configuration |
| X configuration |
| |
| +----------+ +------+ |
| | Run Tool | | Quit | |
| +----------+ +------+ |
| |
| |
+----------------------------------+
Pilih : Authentication configuration
+----------------[ Authentication Configuration ]-----------------+
| |
| User Information Authentication |
| [ ] Cache Information [*] Use MD5 Passwords |
| [ ] Use Hesiod [*] Use Shadow Passwords |
| [*] Use LDAP [*] Use LDAP Authentication |
| [ ] Use NIS [ ] Use Kerberos |
| [ ] Use Winbind [ ] Use SMB Authentication |
| [ ] Use Winbind Authentication |
| [ ] Local authorization is sufficient |
| |
| +--------+ +------+ |
| | Cancel | | Next | |
| +--------+ +------+ |
| |
| |
+-----------------------------------------------------------------+
Choose "*" like example, and then click Next.
+-----------------[ LDAP Settings ]-----------------+
| |
| [ ] Use TLS |
| Server: ldap://127.0.0.1/_______________________ |
| Base DN: dc=jaringankantor,dc=com________________ |
| |
| +------+ +----+ |
| | Back | | Ok | |
| +------+ +----+ |
| |
| |
+---------------------------------------------------+
Input server with 127.0.0.1 and Base DN : dc=jaringankantor, dc=com

Setting Root Directory Http to Own Home Directory


  1. Disabled selinux:
    # vim /etc/selinux/config
    SELINUX=disabled
    ESC => :wq
  2. Restart your PC
  3. Config httpd.conf:
    # vim /etc/httpd/conf.d/welcome.conf
    and mark with #
    #<LocationMatch "^/+$">
    #    Options -Indexes
    #    ErrorDocument 403 /error/noindex.html
    #</LocationMatch>
    ESC => :wq
    # vim /etc/httpd/conf/httpd.conf
    User anwar
    Group anwar
    .
    .
    DocumentRoot "/home/anwar/public_html"
    .
    .
    <Directory "/home/anwar/public_html">
    ESC => :wq
  4. Restart httpd:
    # service httpd restart
  5. FINISH

Making OpenVPN client connection on startup (Windows XP)

This has been tested on a Windows XP machine, NOT on Vista. If you have a scenario where you can connect to multiple sites via VPN, I would not recommend this as there may be IP address conflicts on the client machine. Here's what you do on the client to make it happen:
IDENTIFY CONFIGURATION FILES AND PROPER LOCATION

References to sitename are for the name of the site you have distributed VPN client keys for. Substitute your appropriate site name here.
  • Use Windows Explorer to drill down to C:\Program Files\OpenVPN\config. This directory should contain sitename.conf, sitename.ovpn and subdirectory untangle-vpn.
  • The lower-level untangle-vpn directory should contain two .crt files and a .key file
OPEN VPN MODIFICATION
  • Go to START -> CONTROL PANEL -> ADMINISTATIVE TOOLS -> SERVICES
  • Right click on OPENVPN and select PROPERTIES
  • Change STARTUP TYPE to AUTOMATIC
  • Click OK
  • Close the Services window
  • Close the Administrative Tools window
  • Close Control Panel
REGISTRY MODIFICATION
  • Goto START -> RUN -> REGEDIT
  • Drill down to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • Locate the entry for "openvpn-gui"
  • The command reference should say:
C:\Program Files\OpenVPN\bin\openvpn-gui.exe
Change it to:
C:\Program Files\OpenVPN\bin\openvpn-gui.exe --connect sitename.ovpn
...where sitename is customized for your specific site.
  • Close RegEdit

When your client machine restarts, the user will automatically be connected via VPN client. They may disconnect and reconnect at will. If they need to use a second VPN connection to another location, it is recommended that they disconnect from the first connection before creating a different connection.

How to backup MYSQL database

# mysqldump -u username -p database_name > dump.sql


and enter your password