Archive for the ‘Software’ Category.

programmer … 超好用的 online tools – URL Encode/URL Decode/base64 encode/base64 decode/UUencode/UUdecode

有趣的 ASCII ART

有趣的 ASCII ART : http://www.network-science.de/ascii/
Font: larry3d   Reflection: no   Adjustment: left   Stretch: no      Width: 80     Text: monster

                                   __
                                  /\ \__
  ___ ___     ___     ___     ____\ \ ,_\    __   _ __
/' __` __`\  / __`\ /' _ `\  /',__\\ \ \/  /'__`\/\`'__\
/\ \/\ \/\ \/\ \_\ \/\ \/\ \/\__, `\\ \ \_/\  __/\ \ \/
\ \_\ \_\ \_\ \____/\ \_\ \_\/\____/ \ \__\ \____\\ \_\
 \/_/\/_/\/_/\/___/  \/_/\/_/\/___/   \/__/\/____/ \/_/ 

改 gnu screen "窗" 的數量

原本沒改的話是 40 個 , 改那個  config.h 或是 config.h.in

/*
* Maximum of simultaneously allowed windows per screen session.
*/
#define MAXWIN 100

一些 memcache 的資料

Firefox plugins/add-ons : export cookies

URL : https://addons.mozilla.org/en-US/firefox/addon/8154

這工具可以匯出特定 cookies 然後在 wget 使用

wget –load-cookies=cookies.txt http://foo.com

Protected: [收藏好文] 網站背後技術與技巧

This post is password protected. To view it please enter your password below:


debian / ubuntu 裝 oracle instant client / sqlplus / oci8 / apache2 config / steps by steps

2011.0530 整理的 install step by step:
OS : uname -a
Linux ubuntu 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Oracle client : 11.2 R1

google "oracle instant client download"
到 oracle 網頁找 Instant Client for Linux x86-64 / Version 11.2.0.1.0 (PS: Version 11.2.0.2.0 這版有問題)
download 這兩個
oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm (47,811,007 bytes)
oracle-instantclient11.2-devel-11.2.0.1.0-1.x86_64.rpm (606,343 bytes)
用 alien 裝起來
  102  alien -i *basic*
  103  alien -i *devel*

新增這個檔 /etc/ld.so.conf.d/oracle.conf , 內容:
/usr/lib/oracle/11.2/client64/lib/

  104  cat /etc/ld.so.conf.d/oracle.conf
  105  ls -l /usr/lib/oracle/
  106  ls -l /usr/lib/oracle/11.2/client64/lib/

安裝 LAMP :
  108  export http_proxy="http://172.30.1.123:8080"
  109  apt-get install apache2 libapache2-mod-php5 php5 php5-gd mysql-server php5-mysql

安裝 libaio 套件
  138  apt-get install libaio1

安裝 pear 套件
  112  apt-get install php-pear

安裝 pecl 的 oci8 套件
pear config-set http_proxy http://172.30.1.123:8080/

  114  pecl update-channels
  115  pecl install oci8

  117  find /etc -name php.ini
這兩個檔要加入 oci8 的 extentsion
/etc/php5/cli/php.ini
/etc/php5/apache2/php.ini

install ok: channel://pecl.php.net/oci8-1.4.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=oci8.so" to php.ini <------ 加這行

跑看看測試code:

$conn = oci_connect('oracle_user', 'oracle_pass', 'ip_address/instant_id');

$stid = oci_parse($conn, "select to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') from dual" );
oci_execute($stid);

$row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS);
print_r( $row );

oci_close( $conn );

// ——————————–
以下是 2011.5.25 修改

   69  find / -name sqlplus -print
   70  /usr/lib/oracle/11.2/client64/bin/sqlplus
   71  cat > /etc/ld.so.conf.d/oracle.conf

   73  ls -l /usr/lib/oracle/11.2/client64/lib/

   76  vi /etc/ld.so.conf.d/oracle.conf
   77  apt-get install apache2 libapache2-mod-php5 php5 php5-gd mysql-server php5-mysql

   86  apt-get install php-pear

   91  pear config-set http_proxy http://172.30.1.123:8080/
   92  pecl update-channels

   95  pecl install oci8

2010.0630 : 今天又在 debian 裝一次 發現, 這個版本沒辦法裝 oracle-instantclient11.2.* , 所以繼續用 instantclient11.1.*

Ubuntu 安裝 RPM 要用 alien …
sudo apt-get install alien

Ref. https://help.ubuntu.com/community/HowToBuildToraWithOracle

先去 http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html

download 這幾個 files (rpm)

Instant Client Package – Basic Lite
oracle-instantclient11.1-basiclite-11.1.0.7.0-1.i386.rpm

Instant Client Package – SQL*Plus
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm

Instant Client Package – SDK
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm

下 alien 指令安裝 rpm

alien -i oracle-instantclient11.1-basiclite-11.1.0.7.0-1.i386.rpm
alien -i oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
alien -i oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm

裝好後用 sqlplus 聯看看 , 因為我得到一個 lib error

所以我要裝 apt-get install libaio1

在 /etc/ld.so.conf.d 加一個檔 cat > /etc/ld.so.conf.d/oracle.conf

內容是 oracle lib 的 path /usr/lib/oracle/11.1/client/lib

然後

apt-get install php5

apt-get install php5-dev

因為 oci8 是由 pecl 來安裝的, 所以要 apt-get install php-pear

再來裝 oci8 : pecl install oci8

在 /etc/php5/conf.d 下建一個 oci8.ini 檔 , cat > /etc/php5/conf.d/oci8.ini 內容是

extension=oci8.so

重新啟動 apache2 :

service apache2 restart

看看 phpinfo 有沒有出現 oci8 等字樣就 ok 了

53420fcc8f6596bc2b6cd3511eae7d84
cebcda336140c38e51b889ec7f9319c3

加一個 virtual host :

在 /etc/apache2/sites-enabled 增加一個 xxx.conf 檔

CodeIgniter 需要用 rewrite module :

ls -sf /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled

[ubuntu] apache server module 的 enable / disable

a2enmod module_name

a2dismod module_name

重啟 apache : service apache2 restart

/etc/apache2/mods-available 下面有可用的 modules

Protected: vim 縮排設定

This post is password protected. To view it please enter your password below:


編程最佳的字型 consolas / notepad++ 及 winscp 設定 / Best programming fonts

The Expat XML Parser – XML 分析/拆解工具 – C – 這個讚! 用 C 寫 spider 會用到

Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags). An introductory article on using Expat is available on xml.com.

Function reference : http://www.xml.com/pub/a/1999/09/expat/reference.html

OS X – iDeneb v1.5 10.5.7

相關網站
http://ihackintosh.org
http://ideneb.net
It is finally available iDeneb v1.5 10.5.7!
This Dvd has many news innovationes, here there is only a changelog, from versione v1.4 to v1.5. If you want the complete list of contents, you can see here.
For support you can ask in the forum, in the iDeneb section.
To develop and to maintain this Dvd and all our project, we use many time and money. If you like our jobs, you can help us! Make a donation on our site here.
Thanks.

In the download is include also an external packages with some Applications. You can see the complete list here.
They are also includes codes MD5 in order to control that the files are integral.
Intro:

    This new version of iDeneb, improves the possibility to excute upgrade after post install.
  • If you been for do an Upgrade system and you have an error ( when the installation ends ) : "Impossible to use the partition as parition of boot" , ignored the messeage and restart, because all the package are installed correctly;



• If you have a restart when you try to boot the dvd, you boot with flag at the F8 boot prompt: cpus=1;
安裝的時候反復重啟,倒計時按F8在BOOT後輸入: cpus=1;
• Do Not Install the iDeneb Base System over an existing Base System! This could cause the failure of the installation! To always execute a fresh install;
不要在現有iDeneb系統的基礎上安裝,這會導致安裝失敗,得進行全新安裝.
• If you been for do an upgrade system, deselect of principal system;
如果你是想升級系統,那麼就取消主系統的選定.
• You can boot the dvd also with the kernel, Qoopz 9.7.0 with flag 970, Kernel AnV 9.6.0 with the flag anv and Kernel ToH 9.2.0 with the flag mach_toh;
•您可以啟動的DVD與內核, Qoopz 9.7.0與flag970 ,內核 AnV 9.6.0與 flag anv和內核ToH 9.2.0與flag mach_toh ;
• Do Not Select more than one a drivers of the same type! For example, Do not select 2 Audio Drivers or 2 SMBIOS, this will in many cases cause the install to fail;
同一種驅動不要選擇相同的.例如不要選擇兩個音效卡驅動或者兩個SMBIOS, 這會導致安裝失敗.
• Vanilla 9.7.0 is default kernel;
默認的是Vanilla 9.7.0內核.
• Bootloader of default is Chameleon v2;
默認引導的是Chameleon v2
• If you have based on AMD and/or SSE2 you must select an alternative kernel, advised kernel Qoopz 9.7.0;
如果你是AMD或者只支持SSE2的CPU那麼你就必須要選一個內核,建議選擇Qoopz 9.7.0.
• If you use kernel Qoopz, AnV, Voodoo you don’t select the AMD Patch ;
如果選擇Qoopz, AnV, Voodoo 這些內核的話就不要選AMD Patch .
• If you use Voodoo Kernel you must select "Seatbelt Fix" under fix for resolve the problem of mount of an .dmg,.iso or .cdr;
如果選擇Voodoo內核的話就必須選擇Seatbelt Fix,用以解決掛載鏡像出錯的問題.
• If your system’s sound does not work even after installing the proper sound drivers there may be an issue with the System Preferences. Go to System Preferences Sound > Output > and make sure that "Internal Speakers" is chosen and not Headphones or something else;
如果你的系統在安裝了正確的音效卡驅動後無法正常發生那麼可能是系統偏好設置導致的.進入系統偏好設置聲音>輸出>確保” Internal Speakers”這項是被選中的而不是選中了耳機或別的什麼.
• If you have a NVidia Video Card you don’t select more than a injector. You can choice or NVinject, or NVKush, or NVdarwin;
如果你是NVidia顯卡那麼不要選擇多個injector驅動.你可以選擇NVinject或者是NVKush亦或者是NVdarwin.
• If you have a problem with ACPI_SMC_PlatformPlugin.kext you can select ACPI_SMC_Fix under Fix Menu;
如果你有一個ACPI_SMC_PlatformPlugin.kext的問題你可以選擇Fix列表下的ACPI_SMC_Fix.
• If you have a incompatible system with latest ACPI kext or you have a computer SSE2, you can select package ACPI/SSE2 Fix under Fix Menu;
如果你的系統與ACPI kext不相容或者是電腦只支援SSE2的話,你可以選擇Fix列表下的ACPI/SSE2 Fix補丁.
• If you have kernel panic and you don’t know what caused it, boot in verbose mode ( -v boot flag at the F8 boot prompt ) for visualize the error;
如果出現內核錯誤但是你又不知道是怎麼導致的話, -V 查看哪里出錯.
• If you don’t know like resolve the error you can try install only based system with essential drivers ( Ex. Chipset Drivers ) without the "extra" drivers;
如果你無法解決一些安裝問題的話你可以嘗試只安裝必要的驅動.
• In some situations for the first boot it could be necessary to start with the flag – f for load the kext correctly;
第一次啟動有些情況下需要輸入 –F 來使驅動正確的載入.
• If you haven’t select Video Drivers it could be necessary to start with flag -x;
如果你沒有選擇顯卡驅動的話有必要開機的時候輸入 –X 來進入系統.
• If you are installing iDeneb on one of the Netbook in list, not to select no other drivers or patch;
如果你用Netbook列表內的電腦安裝iDeneb的話,不要選擇任何的驅動或者補丁.
• Netbook Section is in update, for problem o for add others netbook to write on the official forum in section Netbook;
Netbook部分在更新, 問題和增加的本本將會在論壇上公佈出來.
General Information of the Dvd:
Dvd Base System: Mac OSX 10.5.6
Size: 4.34 GB
Bootloader Dvd: Chameleon 1.0.12
kernel Default Dvd: Voodoo 9.5.0 Intel/AMD SSE2/SSE3
Alternative Kernel Dvd: Qoopz 9.7.0, AnV 9.6.0, ToH 9.2.0
Languages Included: Japanese, German, French, Spanish, Italian, Dutch, Danish, Finnish, Korean, Norwegian, Russian, Swedish, Brazilian Portuguese, Simplified Chinese, Traditional Chinese, Portuguese, Polish
Itemes removed from Dvd : AdditionalSpeechVoices, XcodeTools, BootCamp
General Information of Operating System:
Installed OS: Mac OSX 10.5.7 RETAIL + iDeneb Default Patch
Updates Included:
• iTunes 8.2
• QuickTime 7.6.2
• AirPort Client Update 2009-001
• AirPort Utility 5.4.2
• FrontRow 2.1.7
• Java for Mac OS X Update 4
• Safari 4.0.2
Bootloader Default: Chameleon v2
iDeneb Default Patch:
• AppleDecrypt.kext
• AppleSMBIOSEFI.kext
• Disabler.kext
• IONetWorkingFamily.kext ( TimeMachine Fix )
• AHCI Fix
• NVidia ID
• Keyboard Fix
• SistemProfiler Fix
• About This Mac Fix
• PS2 Mouse/Keyboard Fix
Changelog from v1.4 to v.1.5:
Resolved Famous problems:
• Improved the support for upgrade system in post-instalaltion; All packages are been rebuild;
• Added the Kernel vanilla like optional, for to allow to be reinstall;
• Adddition the possibility of reinstall the bootloader;
• Addition the possibiity to choose the chameleon v2 or the Chameleon v1.0.12;
• Addition the voice for make the DSDT Patch;

Additional Components:

  • Bootloader & DSDT
    • Chameleon v2
    • Chameleon v1.0.12
    • DSDT Patcher
  • LeopardAMD
  • Fix
    • ACPI/SSE2 Fix
    • IOPCMCIAFamily
    • SD_SDHC
    • IOUSBFamilyFix
    • Mouse Lag Fix
    • BatteryManager ( VoodooBattery )
    • VoodooPower
      • VoodooPower ( Kext )
      • GenericCPUPMControl ( App )
    • VoodooUSBEHCI
  • Kernel
    • 9.7.0 Vanilla ( Intel/SSE3 )
    • 9.7.0 Qoopz ( Intel/AMD SSE2/SSE3 )
    • 9.6.0 AnV ( Intel/AMD SSE2/SSE3 )
  • Drivers
    • Audio
      • Analog Devices
        • AD1988 P5K
        • AD2000B
      • ALC Audio
        • ALC262
        • ALC268
        • ALC268 AA1
        • AL272
        • ALC880
        • ALC889A
        • ALC1200
      • AC97AC97 ALi Uli M5455
      • AC97 SiS 7012
      • SigmaTel STAC
        • STAC9200
        • STAC9205
        • STAC9223
        • STAC9227
      • VoodooHDA
    • Chipset:
      • ATIATA ( 64 Bit Support )
      • AppleNForceATA ( 64 Bit Support )
      • ICHx Fixed ( ICH10 Support )
      • JMicronATA ( 64 Bit Version )
      • VIA/SiS/Marvell/Uli ( 64 Bit Support )
    • Network:
      • Ethernet
        • AppleYukon2
        • RTL8169/RT8111
        • RTL8139
        • Tulip
        • USBAx8817x
        • USBPegasusEthernet
      • Wireless
        • Atheros AR5005
        • Netgear wg111 v3
        • Ralink
          • RT256x/RT266x
          • RT257x/RT2671
          • RT2860/2790
          • RT2870/RT2779/RT307x
    • Video
      • ATI
        • X Series
          • X1400
        • HD Series
          • HD2xxx Series
            • HD2400XT ( EFI String )
          • HD3xxx Series
            • HD3870x2
          • HD4xxx Series
            • HD4830
            • HD4850
            • HD4870
            • HD4870x2
            • FIXResolution
      • Intel
        • Intel GMA915
        • Intel GMAX3500
  • Netbook
    • Asus EEEPC
    • HP Mini 1000
    • MSI Wind U100

Protected: [摘] 垂直搜尋引擎

This post is password protected. To view it please enter your password below:


Protected: [摘] Google 的十大信條 — 有時我會忘記東西, 也怕有用的資訊不見, 所以看到就順手留下來了(不公開).

This post is password protected. To view it please enter your password below:


Graphical Database Schema Metadata Browser – SchemaSpy

gentoo emerge php options

2009.0630 Monster LAMP Pack:

取消 :
ncurses pdo readline spell

增加 :
ctype json sockets
berkdb gdbm
xmlreader xmlwriter
oci8-instant-client

USE="apache2 berkdb bzip2 calendar cjk cli crypt ctype curl gd gdbm hash iconv json mysql mysqli nls oci8-instant-client pcre reflection session simplexml sockets spl ssl tokenizer truetype unicode xml xmlreader xmlwriter zlib" emerge -av php

2009.0630 發現 wordpress code 裡面有用到 token_get_all ( tokenizer 所以不能取消)

Protected: Some Simple C Programs – 好用的 C 範例程式/片段

This post is password protected. To view it please enter your password below:


Sun 買 MySQL , Oracle 買 Sun

VMware ESXi server 連接 FreeNAS 的免費 iSCSI storage

首先這是 iSCSI 的基本知識 , From wiki : http://en.wikipedia.org/wiki/ISCSI

iSCSI uses TCP/IP (typically TCP ports 860 and 3260). In essence, iSCSI simply allows two hosts to negotiate and then exchange SCSI commands using IP networks. By doing this, iSCSI takes a popular high-performance local storage bus and emulates it over wide-area networks, creating a storage area network (SAN). Unlike some SAN protocols, iSCSI requires no dedicated cabling; it can be run over existing switching and IP infrastructure. As a result, iSCSI is often seen as a low-cost alternative to Fibre Channel, which requires dedicated infrastructure.

Although iSCSI can communicate with arbitrary types of SCSI devices, system administrators almost always use it to allow server computers (such as database servers) to access disk volumes on storage arrays. iSCSI SANs often have one of two objectives:

Storage consolidation
Organizations move disparate storage resources from servers around their network to central locations, often in data centers; this allows for more efficiency in the allocation of storage. In a SAN environment, a server can be allocated a new disk volume without any change to hardware or cabling.

Disaster recovery
Organizations mirror storage resources from one data center to a remote data center, which can serve as a hot standby in the event of a prolonged outage. In particular, iSCSI SANs allow entire disk arrays to be migrated across a WAN with minimal configuration changes, in effect making storage “routable” in the same manner as network traffic.

以下是基本的名詞解釋

Initiator

Further information: SCSI initiator

An initiator functions as an iSCSI client. An initiator typically serves the same purpose to a computer as a SCSI bus adapter would, except that instead of physically cabling SCSI devices (like hard drives and tape changers), an iSCSI initiator sends SCSI commands over an IP network. An initiator falls into two broad types:

Software initiator
A software initiator uses code to implement iSCSI. Typically, this happens in a kernel-resident device driver that uses the existing network card (NIC) and network stack to emulate SCSI devices for a computer by speaking the iSCSI protocol. Software initiators are available for most mainstream operating systems, and this type is the most common mode of deploying iSCSI on computers.
Hardware initiator
A hardware initiator uses dedicated hardware, typically in combination with software (firmware) running on that hardware, to implement iSCSI. A hardware initiator mitigates the overhead of iSCSI and TCP processing and Ethernet interrupts, and therefore may improve the performance of servers that use iSCSI.

Host Bus Adapter

An iSCSI host bus adapter (more commonly, HBA) implements a hardware initiator. A typical HBA is packaged as a combination of a Gigabit (or 10 Gigabit) Ethernet NIC, some kind of TCP/IP offload technology (TOE) and a SCSI bus adapter, which is how it appears to the operating system.

An iSCSI HBA can include PCI option ROM to allow booting from an iSCSI target.

Target

iSCSI refers to a storage resource located on an iSCSI server (more generally, one of potentially many instances of iSCSI running on that server) as a “target”. An iSCSI target usually represents hard disk storage. As with initiators, software to provide an iSCSI target is available for most mainstream operating systems.

Storage array
In a data center or enterprise environment, an iSCSI target often resides in a large storage array, such as a NetApp filer or an EMC Corporation NS-series computer appliance. A storage array usually provides distinct iSCSI targets for numerous clients.[1]
Software target
In a smaller or more specialized setting, mainstream server operating systems (like Linux, Solaris or Windows Server 2008) and some specific-purpose operating systems (like NexentaStor, StarWind iSCSI SAN, FreeNAS, iStorage Server, OpenFiler or FreeSiOS) can provide iSCSI target’s functionality.

Addressing

Special names refer to both iSCSI initiators and targets. iSCSI provides three name-formats:

iSCSI Qualified Name (IQN)
Format: iqn.yyyy-mm.{reversed domain name} (e.g. iqn.2001-04.com.acme:storage.tape.sys1.xyz) (Note: there is an optional colon with arbitrary text afterwards. This text is there to help better organize or label resources.)

以下是用 FreeNAS 的 step by step ,

我把一個 hardisk 整個當作一個 iSCSI 的 target (FreeNAS 那邊可以分成用 file 或 device 當 target , 各有好壞 , 當然 device 是效能較好)

4398dfd3b7283642ad11a403bcd7d6c5

在 VMware ESXi server 那邊要把 iSCSI 的 software adapter enable ( Initiator ):

e3fd27fb2527cfc6977a825a1868c356

在 Storage 那邊把 FreeNAS 提供的 iSCSI target 加進來 , Windows Vista 可以直接把 taget 加進去, XP 或 其他的 Windows server 要裝 Microsoft 所題供的 iSCSI software 才行.

145ed5da05493c3453d4837dcfb61d53

29aa71b4ecb5880c1ba8b9025d3c3161

不過我發現 iSCSI 的 extent 用 file 的會有 error : Error: The changes could not be applied (error code1).

19e398e657f49c463094788b4a98a6da

幫照片加上 浮水印 可批次 修圖 縮圖 FREE 軟體 – Photoscape