Archive

Archive for April, 2010

Centos – php json fail

April 30, 2010 Leave a comment

* Installed centos 5.4, and default php, but programs useing json_encode/decode is not working as expected
* Problem is php does not shifted with json, so it need to be installed.

1. yum install pecl

2. json extension need to add


[root@www html]# pecl install json

...

Build process completed successfully
Installing '/var/tmp/pear-build-root/install-json-1.2.1//usr/lib64/php/modules/json.so'
install ok: channel://pear.php.net/json-1.2.1

3. cd /etc/php.d/


[root@www php.d]# echo "extension=json.so" >> json.ini
[root@www php.d]# ls
dbase.ini  imap.ini  json.ini  mbstring.ini  mcrypt.ini  mysqli.ini  mysql.ini  pdo.ini  pdo_mysql.ini  pdo_sqlite.ini
[root@www php.d]# cat json.ini
extension=json.so
[root@www php.d]#

4. Restart apache


[root@www php.d]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Done, now json is available.

Categories: centOS, Fedora 12, PHP

Centos – imap commands

April 28, 2010 Leave a comment

1. telnet domain.com 143

2. . login my@domain.com password

3. . list “” “*”

4. . status “INBOX” (messages)

5. . logout

Categories: centOS, Fedora 12

CentOS – postfix postfixadmin dovecot anti spam

April 24, 2010 Leave a comment

* https://shamuntoha.wordpress.com/2010/01/04/centos-postfix-postfixadmin-advanced/
* According to this setup we can extend, the spam threat

1. By default we have working example for internetwork, but we need to receive public emails (google, yahoo, and cutomers domain) How?


vi /etc/postfix/main.cf

inet_interfaces = all #instead of localhost

2. Because its now on public, we need spam guard, how?


# we allow ourself
permit_mynetwork= $mynetworks
# incoming email/smtp need hello hand shake
smtpd_helo_required = yes

# without this we wouldn't made it so far, with spammers
smtpd_recipient_restrictions =
permit_mynetworks,
reject_unauth_destination,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client pbl.spamhaus.org

# unix another style, linux hash to use file.db, we compile it using "postmap filename" then it becomes filename.db
# /etc/postfix/clients:
# iamspammer.com    REJECT
# iamgoodsite.com      OK
#
smtpd_sender_restrictions = check_client_access hash:/etc/postfix/clients

3.  Still we are not 100%, but yet done

Important notes:
http://jimsun.linxnet.com/misc/postfix-anti-UCE.txt
http://www.sdsc.edu/~jeff/spam/cbc.html

Categories: centOS, Fedora 12, Unix/Linux

CentOS – Nameserver install bind chroot system config

April 24, 2010 Leave a comment

* You have domain name, and you dont have any nameserver, allowing lookups?

1. yum install bind-chroot system-config-bind

2. named service 
[root@example ~]# service named status
rndc: connect failed: 127.0.0.1#953: connection refused
named is stopped
[root@example ~]# 

3. TCP/UDP 53 open
Categories: centOS, Fedora 12, Unix/Linux

CentOS – time ntp automatic

April 24, 2010 Leave a comment

* Some server and some zone, time gets changed, 1 hour+ or 1 hour less, how would you manage it automatic?

1. vi /etc/ntp.conf

2.  service ntpd stop

3. /usr/sbin/ntpdate pool.ntp.org

4. service ntpd start

Categories: centOS, Fedora 12, Unix/Linux

Eclipse ftp sftp remote pdt

April 23, 2010 Leave a comment

* Tired for to wait and get eclipse working for remote ftp ?
* Download: http://www.aptana.org/studio/download

1. Aptana (what eclipse not doing, they are doing for us)

[sun@example Download]$ unzip Aptana_Studio_Setup_Linux_x86_2.0.4.zip

[sun@example aptana]$ ls
about_files  about.html  AptanaStudio  AptanaStudio.ini  artifacts.xml  configuration  dropins  features  full_uninstall.txt  icon.xpm  libcairo-swt.so  p2  plugins  version.txt
[sun@example aptana]$

2.  Execute (put the folder with world permission)

[sun@example aptana]$ ./AptanaStudio

Done.

Note: Aptana is very advance face of eclipse, also got plugins

Categories: centOS, Fedora 12, PHP, Unix/Linux

Kermit ftp ssh telnet directory browse linux unix windows mac

April 21, 2010 Leave a comment

http://www.columbia.edu/kermit/ckdaily.html

[sun@example Downloads]$ ./wermit
C-Kermit 9.0.299 Alpha.06, 7 Apr 2010, for Linux
Copyright (C) 1985, 2010,
Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/home/sun/Downloads/) C-Kermit>

(/home/sun/Downloads/) C-Kermit>ssh
?SSH to where?
?No such file or directory
(/home/sun/Downloads/) C-Kermit>telnet
?SSH to where?