Wednesday, April 17, 2013

Ubuntu , Debian Vim with text highlight


1. cp /etc/vim/vimrc ~/.vimrc
1. vi ~/.vimrc
remove ” before syntax on

Better For Shell Script: textmate.vim

VIM color scheme:
http://blog.lyhdev.com/2013/01/ubuntu-vim.html

Add below if using pure vim:
set t_Co=256
http://chimerhapsody.blogspot.tw/2012/12/vim-color-scheme.html

Tuesday, March 05, 2013

The Way in Change Wordpress Site URL


→ Ref. http://codex.wordpress.org/Changing_The_Site_URL
→ From URL: www.aaa.com
→ TO   URL: www.bbb.com


********************************************
* Notice  Step 0  -->  Change URL (www.aaa.com)  *
********************************************
※ To Change Jetpack STAT.
1. Before backup : Settings > General > Change URL > Save
OR
2. (Optional) :
   (1)After The following procesure
   (2)Prepare "temp.bbb.com"
   (3)"Settings > General > Change URL to "temp.bbb.com" > Save"
   (4)"Settings > General > Change URL to "www.bbb.com" > Save"
Or
3. (Optional) :After The following procesure, discconnect jetpack and recooncet but you will "lose all your stat data".



********************************************
*                       Backup (www.aaa.com)               *
********************************************
1. backup mysql db
2. backup php files

********************************************
*                                    Setup                              *
********************************************
3. dns setup
4. VPS setup(vhost,db) - bluehost or MediaTemple, etc..

********************************************
*                                     Files                              *
********************************************
5. upload php files to target server(verify the .htaccess setting)

********************************************
*                         DB (www.bbb.com)                   *
********************************************
6. Modify wp-config.php(DB Conection)
7. import db to target db
8. Modify DB Records for New URL(SQL command): Just Update the following-- Otherwise it could be harm to your DB integrity!!
-----------------------------------------------
UPDATE `wrd_options` SET `option_value` = REPLACE( `option_value` , 'www.aaa.com', 'www.bbb.com' ) WHERE `option_name`='siteurl' or `option_name`='home';
UPDATE `wrd_posts` SET `post_content` = REPLACE( `post_content` , 'www.aaa.com', 'www.bbb.com' );
-----------------------------------------------
********************************************
*                       Finalizing (www.bbb.com)            *
********************************************
9. Administration Panels go to Settings > General > Check URL > Save
10. Manually Tune Theme(Check if Old URL Exists)!
-----------------------------------------------
● To fix widgets that contain outdated URL's, you may edit them in Dashboard > Appearance > Widgets.
● Check Template Files:sidebar.php and footer.php
-----------------------------------------------
11. Redirect : www.aaa.com redirect → www.bbb.com (via .htaccess)
12. Check Wordpress.com Stat after view hours and days (Jetpack) <-- See Step 0
13. Re-gen Sitemap

===================Note======================
1. Fix the Incoming Links URL. (Dashboard screen, at Incoming Links. Hover over the area to the right of "Incoming Links" to reveal the "Configure" link. Edit the URL to reflect the new site address.)
2. Do a FULL database(adminer.php) search for any items left.
-----------------------------------------------
● This is optional because 99.9999% done with previous step), but don't change any other field especially meta data such as 'a:4:{s:5:"child";a:1:{s:0:"";a:1:{s:3"rsxxxx'
● Recommend Tool --> adminer.php to search ; phpmyadmin to manipulate
-----------------------------------------------
3. Verify that the reference in your WordPress URL contains the new address.
4. Verify that the reference in your "Blog URL" contains the new address.
===================Note======================

MediaTemple 1-click install wordpress

This summary is not available. Please click here to view the post.

MediaTemple Configuration

* php.ini

~/../../etc/php.ini
--------------------------------------------
; Rename this file to php.ini and uncomment or add directives.
; For a complete list of valid directives, visit:
;  http://us2.php.net/manual/en/ini.php

[PHP]
; We highly recommend that you leave this options enabled
cgi.fix_pathinfo=1

; Increase maximum post size
post_max_size = 20M

; Increase execution time
max_execution_time = 300

; pull in EGPCS [Environment, GET, POST, Cookie, Server] variables as globals
;register_globals = true

; For performance reasons, (mt) does not load all of the modules that are available
; into PHP. You may uncomment any one of the following "extension" lines to enable
; the desired module

; Salblotron XSLT
;extension=xslt.so

; save in local tmp
session.save_path=/home/163036/data/tmp

;My Custom
output_buffering = 4096
memory_limit = 128M
upload_max_filesize = 20M
--------------------------------------------

* mysql config <--- no permission to tune
--------------------------------------------
'max_allowed_packet' default 1M
--------------------------------------------

Friday, February 01, 2013

Linux Network Traffic Statistics - IPTRAF

Ref. http://i-yow.blogspot.tw/2008/10/iptraf.html



1.安裝IPTraf
yum install iptraf

2.安裝IPTraf

iptraf

執行後出現主畫面


可依想看的資訊分類,可分網卡、分協定、分封包大小.....等,還可自訂規則過濾。

Sunday, January 13, 2013

Proxy Authentication - Squid

※ Ref. http://blog.faq-book.com/?p=5334
Ref. http://www.babyface2.com/NetAdmin/27200804squid/

1
2
3
4
5
6
7
[root@localhost ~]# rpm -ql squid | grep ncsa
/usr/lib64/squid/ncsa_auth
/usr/share/man/man8/ncsa_auth.8.gz
 
[root@localhost ~]# rpm -ql httpd | grep htpasswd
/usr/bin/htpasswd
/usr/share/man/man1/htpasswd.1.gz


1
[root@localhost ~]# yum install httpd squid


1
2
3
4
5
6
7
[root@localhost ~]# vim /etc/squid/squid.conf
#修改前
#acl password proxy_auth REQUIRED
 
#修改後
acl password proxy_auth REQUIRED
http_access allow password


auth_param basic children 5   
同時接受認證的連線數
auth_param basic realm Squid proxy-caching web server 
使用者在輸入帳密的地方所顯示的說明文字
auth_param basic credentialsttl 2 hours
使用者連線時的連續時間
auth_param basic casesensitive off
使用特殊權限的帳號登入時會直接取消不給登入

1.4 建立帳密
在使用htpasswd建立帳密時第一次要記得加參數-c,之後就不用加了。「derek」和「faq」為要新增的帳號。

Linux Timezone


1 .[root@li420-243 ~]# tzselect


The following information has been given:

        Taiwan

Therefore TZ='Asia/Taipei' will be used.
Local time is now:      Mon Jan 14 08:13:48 CST 2013.
Universal Time is now:  Mon Jan 14 00:13:48 UTC 2013.
Is the above information OK?
1) Yes
2) No
#? 1

You can make this change permanent for yourself by appending the line
        TZ='Asia/Taipei'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Taipei

1. [root@li420-243 ~]# vim /etc/sysconfig/clock

ZONE="Asia/Taipei"
#ZONE="Etc/UTC"


3. [root@li420-243 ~]# tzdata-update
[root@li420-243 ~]# date
Mon Jan 14 08:16:27 CST 2013