linux / putty ssh tunnel setting

擷取_my_putty_ssh_tunnel

在 HOST A 下

#
# ssh -D 8000 -C -N -f [email protected]
#

-D bind 一個 “dynamic” 的port ,
-C 壓縮 ,
-N 不執行任何 command ,
-f 背景執行,

在 HOST A 下 netstat -an | grep LIST 可以看到

tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN

若本機為 linux , dynanic 的連法:

ssh -NfD 8000 -p 2200 [email protected]

— 在本機建立一個 port 8000 的 listen 透過 ssh 連到 safe.server.tw 的 ssh port 2200 去.

 

// ——

screen :

http://digitalpbk.blogspot.com/2009/05/ssh-proxy-windows-linux-orkut-bypass.html

Install Oracle 10.2.0.4 using vmware image

image 從這邊抓的

http://thepiratebay.org/torrent/4206241/

裝好後的啟動 command:

Listener:
 $ lsnrctl start

Database:
 $ sqlplus /nolog
 SQL> conn / as sysdba
 SQL> startup;

DB Console:
 $ emctl start dbconsole
 then open browser and go to https://localhost:5500/em
 You can login as sys/oracle using the SYSDBA role.

sqlplus /nolog

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Oct 1 18:50:04 2008

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

SQL> conn scott/password@db1

3.2 G , 解開後, 好像有個目錄是給 Mac OS 用的 vmware image , monster 用那個看起來比較正常的 , 馬上用 vmware converter 把它轉到 Vmware ESXi server 去 , 作者建議memory不要低於 768MB , 轉好後就啟動啦.

照它的說明把 Oracle startup 很順利….. 馬上就有一個 oracle 可以用.

把那個 OS 啟動後, 依照我的環境我還改了 : keyboard , network ip address setting : 參考: /archives/1063

The torrent
=========

This is a VMWare image of CENT OS Linux 5, with Oracle 10.2.0.4 Enterprise Edition installed.

DISCLAIMER: This if for educational porpose only. CENT OS is a free software, Oracle can be download free (registration needed) from http://otn.oracle.com so I recommend you get this working on your own.

Quick Start
=========

Download, uncompress, run with VMWare Player/workstation. You'll need 12.5GB for the uncompressed files.

OS Users and passwords:
  root/root
  oracle/oracle

Oracle users and password:
  sys, system, sysman, dbsnmp all with "oracle" password

DB: ORACLE_SID DB1 is already created. Start as usual.

Read ahead for detailed instructions.

HOW TO
=======

Start the virtual machine. You can use VMWare player which is a free download. Double click on sles.vmx (don't be distracted by the name, this is not a suse linux, it's a Cent OS, but I base the configuration on a suse vm).

NOTE: Virtual machine is setup to use 768Mb of memory. I don't recommend downsizing this value, specially if using the DBConsole. Database uses less than that, so you can change it safetly to 512Mb, but the DBConsole won't probably start.

After starting the VM you should get to a graphical login.

Login as oracle and open a console. You have two ORACLE_HOMEs installed (run .bash_profile to choose one of them at any time from the oracle shell).

First home (server on /u01/app/oracle/product/10.2/db_1) is where the database is software is installed and DB1 instance was created. All oracle users (sys, system, sysman, dbsnmp) were created with the "oracle" password.

Start all with: 

Listener:
 $ lsnrctl start

Database:
 $ sqlplus /nolog
 SQL> conn / as sysdba
 SQL> startup;

DB Console:
 $ emctl start dbconsole
 then open browser and go to https://localhost:5500/em
 You can login as sys/oracle using the SYSDBA role.

Second home (client on /u01/app/oracle/product/10.2/client) has the Java Enterprise Manager console installed. This is a client/server tool to admin the database (works for previous releases too). From 11g this tool is no longer provided, but since it's very popular as of today, I'm installing it here. Start it with $ oemapp dbconsole (just type oemapp to see all products available).

Listener only listen on localhost (127.0.0.1). To access the database from your network you'll have to make sure that VMWare networking is working properly. By default it's configured as "Bridged networking" (see vmware docs for details) and inside you see the network card as eth0, configure with DHCP. Once you can ping the box you can modify the listener.ora file and add the new IP to listen to, and restart it. DBConsole configuration to listen on that IP can be a bit tricky (try setting the iP on the ORACLE_HOSTNAME env var and then reconfigure with emca -reconfig dbconsole db). You can also access it with SSH port fowarding if you know how to do it.

Changelog
=========

Version 0.2
  * Upgraded soft to 10.2.0.4 (db too)
  * DB Console working.
  * Linking of soft now works becouse of install of libstdc++.so.5
  * Better "documentation" with torrent.

Version 0.1 

  * First release: Vmware image with CentOS 5, xfce4, and oracle 10.2.0.3 (server and client). DB1 already created.
  * Known bug: dbconsole not working properly.
  * Posted on http://thepiratebay.org/tor/4039509/Oracle_10.2_in_vmware_image

Help
====

You can post questions on the comments, althought I don't see them so often, but maybe somebody else can help you.
If you need oracle support, you can search the web for help or you can have professional support from us by an email on the comments (good prices, senior dbas).

install oracle instant client basic on gentoo linux step by step

emerge -av dev-db/oracle-instantclient-basic dev-db/oracle-instantclient-sqlplus

!!! dev-db/oracle-instantclient-basic-11.1.0.7.0 has fetch restriction turned on.
!!! This probably means that this ebuild's files must be downloaded
!!! manually.  See the comments in the ebuild for more information.

 * Please go to:
 *   http://www.oracle.com/technology/tech/oci/instantclient/index.html
 * select your platform and download the
 * Basic client package with SDK, which are:
 *   instantclient-basic-linux32-11.1.0.7.zip
 *   instantclient-sdk-linux32-11.1.0.7.zip
 * Then after downloading put them in:
 *   /usr/portage/distfiles



http://www.oracle.com/technology/tech/oci/instantclient/index.html

factory ~ # cd /usr/portage/distfiles
factory distfiles # ls -l *zip
-rw-rw-r-- 1 apache portage 34556803 Aug  6 17:17 instantclient-basic-linux32-10.2.0.3-20061115.zip
-rw-rw-r-- 1 apache portage   602897 Aug  6 17:17 instantclient-sdk-linux32-10.2.0.3-20061115.zip

emerge -av dev-db/oracle-instantclient-basic
#

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

最簡單的最好 – 用 pre 的 CSS style

CSS 是這樣的

pre {
  background: #F0F0F0 url(images/blogger-code.gif) repeat-y scroll left top;
  border: 1px solid #CCCCCC;
  color: #333333;
  display: block;
  font-family: Courier New;
  font-size: 8pt;
  line-height: 120%;
  margin: 5px 0 0 20px;
  max-height: 200px;
  overflow: auto;
  padding: 10px 10px 10px 21px;
  width: 90%;
}

完全不用 javascript , 直接寫到 wordpress 的 style.css 裡 , 要用時就直接用 html pre tag 就好, 比上次找的
SyntaxHighlighter Plus 還方便, 雖然沒有 syntax highlight , 不過就是簡單, 再說 blog 上面也不適合放一大串的程式碼不是嗎?

// sample code :

for ( $i=0; $i<10; $i++ ) {
  // do something
}

遇見MV 孫燕姿

[youtube]http://tw.youtube.com/watch?v=3XpdMM8-490[/youtube]

DELL optiplex 330 桌機安裝 VMware ESXi 3.5 server

我的桌機是 DELL Optiplex 330 , 網路晶片是 Intel 的, 聽說 intel 的比較沒相容問題
用他的 ISO 來裝, 裝好就用另一台 PC 裝 VMware infraustrue client 連 remote console
我的 Monster LAMP Pack 剛好可以拿來用看看, 於是拿 VMware converter 選 Other 把 VMware WorkStation 的 image 倒進去 , 再 Power on , 就看到 MLP 在 ESXi server 愉快的啟動啦.

聽說 ESCi server 比 workstation 來得有效率, 希望公司可以給我大點的 HD , 讓我可以多跑幾個 vm 來看看.

對了, 鄒 同學說 , 我可以用 VMware 的另一個 tool 來快速的 clone 多個 vm 出來.

Read more

opensolaris / Optimized Open Source Software Stack (Cool Stack)

看到一個有用的套件

for the Sun Solaris Operating System(TM)

http://cooltools.sunsource.net/coolstack/

Cool Stack includes several packages in the SVR4 package format, so you can install just the ones you need. Some of the applications in Cool Stack already ship with Solaris, but these are either older versions and/or not built with full optimization. Further, Cool Stack has been pre-configured to have the most popular applications (Apache, PHP, MySQL) to work seamlessly out of the box.
Deploying PHP From Cool Stack in Sun Java System Web Server

Configuring Cool Stack PHP With Web Server

Next, do the following:

1. Go to the Cool Stack PHP 5 installation location. Type:

cd /opt/coolstack/php5

In that directory is a script called setup-ws7-php.sh.

2. Run setup-ws7-php.sh. Type:

./setup-ws7-php.sh

This message is displayed:

Usage:
This script will configure Coolstack PHP with Sun Java System Web Server
7. Here, you will need to provide the top level location of your Web Server
7 installation and your Web Server 7 instance_name name to which this
script should configure to run PHP scripts.

Enter your Web Server installation location(/sun/webserver7):

3. Type the full path for your Web Server installation.

The script then prompts you to type a Web Server instance name. That name is the path to a directory in your installation location—one that contains all the configuration files for running your Web site. If you are using Web Server in Sun Java Enterprise System 5, your instances are under /var/opt/SUNWwbsvr7.

For the example in this article, cite the instance https-coolstack that you created previously. To enable a different instance for PHP, type that instance name. Your instance is then ready for PHP, which you can deploy with Cool Stack 1.2 PHP on Web Server.

Finally, do the following:

1. Start Web Server. Type:

/sun/webserver7/https-coolstack/bin/startserv

2. Create sample PHP files under /sun/webserver7/https-coolstack/docs.

Holux m-241 logger 的 KML data 匯出 , 用 excel 編輯後再轉回 KML

今天早上都在玩這個…
把 kml 檔案用 simplexml 讀出來 , 簡單分析了一下就知道座標跟高度等資料在那裡了,
接著用以下的程式把它轉出 csv 檔
[code language=’php’]
$string=file_get_contents(“0816.kml”);

$xml = simplexml_load_string($string);

printf(“Name,Latitude,Longitude,Altitude,Dist,Description ,Icon,IconScale,IconAltitude,IconHeading, IconColor, LineStringColor,HideNameUntilMouseOver\n”);

$icon=”196″;
$iconscale=”0.2″;
$iconaltitude=10;
$iconheading=”line-180″;
$iconcolor=”yellow”;
$linestringcolor=”aqua”;
$HideNameUntilMouseOver=”true”;

$cnt=0;
$t1=0;
$last_point=array();
$dist=0;
$total_dist=0;
$ignore_time=120; // 120 seconds
$ignore_dist=10; // 10 meters

foreach ($xml->Document->Folder->Placemark as $k=>$v) {
$point=explode(“,”,trim($v->Point->coordinates));
if ( $last_point[0] ) {
$dist=sqrt( pow(abs($point[0]-$last_point[0])*110.766417,2) + pow(abs($point[1]-$last_point[1])*110.766417,2) );
$dist*=1000;
} else {
$dist=0;
}
$total_dist+=$dist;
$last_point=$point;
if ( $point[2]name);
$timestamp=strtotime($str_time);
if ( ($timestamp-$t1)<$ignore_time &amp;&amp; $dist<$ignore_dist ) continue; $t1=$timestamp; printf("%s , ",date("H:i:s",$timestamp)); printf("%s , ",$point[1]); printf("%s , ",$point[0]); printf("%s , ",$point[2]); printf("%s , ",$total_dist); printf("NO.%d
%s
Altitude : %s M , “,$cnt++,$str_time,$point[2]);
printf(“%s , “,$icon);
printf(“%s , “,$iconscale);
printf(“%s , “,$iconaltitude);
printf(“%s , “,$iconheading);
printf(“%s , “,$iconcolor);
printf(“%s , “,$linestringcolor);
printf(“%s , “,$HideNameUntilMouseOver);
printf(“\n”);
}[/code]

用 excel 把 csv 讀進來編輯, 一方面用 google earth 來對原來資料 , 看那邊停留久的 data
減少一些 , 再用這個 service 把 csv 轉回 KML 檔

Excel To KML – Display Excel files on Google Earth

今天(8/19)聽了 aska 的建議, 增加 “忽略” 時間跟距離的片段進去

今天(8/21)終於把這段程式改成可以給大家用的 service 了:
https://www.monster.com.tw/kml2csv