2008年1月28日 星期一

How to Install Pure-FTP Daemon on Ubuntu 7.10 Gusty Gibbon

installing ftp server on linux

install pure-ftpd
# sudo apt-get install pure-ftpd-common pure-ftpd pureadmin

to access go to applications-> system tools-> pureadmin
to create a user then

http://user@localhost

2008年1月25日 星期五

如何在Ubuntu底下架網站?使用Hinet的ADSL的不固定IP位址?

How To Setup a Webserver in Ubuntu 7.10 Using Hinet's Dynamic IP Address
如何在Ubuntu底下架網站?使用Hinet的ADSL的不固定IP位址?

http://ubuntulinuxhowto.blogspot.com/2006/06/dynamic-dns-no-ip.html
Dynamic DNS No-IP
If you have a dynamic IP from your internet service provider it gets annoying when they change your IP and you do not know it, therefore you are not able to connect to your computer remotely anymore. Well Dynamic DNS services fix that problem by assigning a domain to your IP address whenever it changes. This howto will cover getting No-IP, a Dynamic DNS client working.

First if you do not have a No-IP account, create one by going to no-ip.com and registering.

It will send an email to you so you can verify that you want to create account. Click the verification link in your email and it will send you back to the No-IP site.

Log in to the site with the account you just made and click Add under Hosts / Redirects.

Write whatever you want for the subdomain and choose a domain for it to be under. I chose howtonoip for my subdomain and chose to put it under their no-ip.org domain. Scroll down to the bottom and click Create Host.

Now you will need to install the client. Open up your terminal and run "sudo apt-get install no-ip".

Once installed run "sudo no-ip -C" and select your Internet interface from the list. Then enter your login information. If you added only one host to your no-ip account it will automatically use that. If not it will ask which one(s) to use. Next enter the update interval (in minutes). It will ask you if you want to run something at a successful update. I did not so I selected no.

Your configuration file was just created. Now whenever your IP changes this client software will automatically update the No-IP servers with your new IP. No longer will your ip change and you be locked out of your computer!

如何在安裝Postgres 8.2到Ubuntu 7.10 Gusty Gibbon

如何在ubuntu 7.10 安裝postgres 8.2
How To Installing Postgres 8.2 on Ubuntu 7.10

$ sudo apt-get install postgresql postgresql-client postgresql-contrib

$ sudo apt-get install pgadmin3

postgres default password is unknown so after your first installation you will need to change it
postgres使用者密碼安裝後的密碼是不可考的 所以安裝後要直接用query改掉

$ sudo su postgres -c psql template1
template1=# ALTER USER postgres WITH PASSWORD 'password';
template1=# \q

$ sudo passwd -d postgres
$ sudo su postgres -c passwd

http://hocuspokus.net/2007/11/05/install-postgresql-on-ubuntu-710/

如何在Ubuntu 7.10上安裝KDE4

如何在ubuntu 7.10上安裝kde4
http://www.cyberciti.biz/tips/install-kde-4.html

$ sudo gedit /etc/apt/sources.list

deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu gutsy main

$ sudo apt-get update

$ sudo apt-get install kde4-core

如何利用Python處理檔案

如何利用python讀取檔案的第四條line
檔案不用整個load到記憶體上

how-to get a specific line(4) in a bunch of files without it going loading into memory

import glob
for files in glob.glob('/home/joec/Desktop/gpr_files/*gpr'):
x = open(files)
x.readline()
x.readline()
x.readline()
y = x.readline()
z = y[10:20]
date = z.replace('/', '-')
print date
x.close()

http://groups.google.com/group/comp.lang.python/browse_thread/thread/7f3f745dd4e09f5e/f2934e1a17ee66a3

如何備份以及還原Postgres資料庫

How to Backup and Restore Postgrest 8.2 Database in Ubuntu Linux
如何備份以及還原postgres資料庫

* restore postgres

psql -U joec database1 -f - <> database1.sql.gz

如何在Shell底下找你要的使用者手冊及指令

how-to find the command you need in linux
如何在shell底下找你要的使用者手冊及指令
$ apropos

如何幫linux改電腦名稱

How To Change Computer Host Name in Ubuntu Linux
如何幫linux改電腦名稱
$ gksudo gedit /etc/hostname

如何在Postgres底下設定PL/SQL 陣列資料型態的功能

How To PL/SQL in Postgres With Array Data Type

如何在postgres底下設定PL/SQL 陣列資料型態的功能
* postgres pl install and array avg function setup

http://frakkle.com/archives/archive_2006-m04.php

幫postgre開啟PL/SQL的功能
joec@celica:~$ createlang plpgsql arraydata1

在postgres底下設定PL/SQL 陣列資料型態
arraydata1=#

CREATE OR REPLACE FUNCTION array_to_set(ar_in numeric[])
RETURNS SETOF numeric AS
$BODY$
declare
rtn numeric;
ar_pointer int4 = 1;
BEGIN
--ar_upper := array_upper( ar_in );
WHILE ( ar_in[ar_pointer] IS NOT NULL ) LOOP
return next ar_in[ar_pointer];
ar_pointer := ar_pointer + 1;
END LOOP;
END
$BODY$
LANGUAGE 'plpgsql' STRICT IMMUTABLE;

postgres底下設定PL/SQL 陣列資料型態的平均,總合,計算次數,標準偏差數的功能

* create sum, count, avg, standard deviation functions
arraydata1=#
CREATE OR REPLACE FUNCTION sum(numeric[])
RETURNS numeric AS
$BODY$
SELECT sum( array_to_set )
FROM array_to_set( $1 )
$BODY$
LANGUAGE 'sql' STRICT IMMUTABLE;

CREATE FUNCTION count_array(numeric[])
RETURNS bigint AS
$BODY$
SELECT count( array_to_set )
FROM array_to_set( $1 )
$BODY$
LANGUAGE 'sql' STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION avg(numeric[])
RETURNS numeric AS
$BODY$
SELECT avg( array_to_set )
FROM array_to_set( $1 )
$BODY$
LANGUAGE 'sql' STRICT IMMUTABLE;

CREATE OR REPLACE FUNCTION stddev(numeric[])
RETURNS numeric AS
$BODY$
SELECT stddev( array_to_set )
FROM array_to_set( $1 )
$BODY$
LANGUAGE 'sql' STRICT IMMUTABLE;

arraydata1=# select avg(array_num[32:34]) from data;

如何在Linux, Ubuntu, Debian下安裝 LAMP Apache 2.2, MySQL 5, PHP 4, SSH

How To install LAMP Apacle MySQL PHP SSH On Ubuntu 7.10 Gusty Gibbon
如何在linux, ubuntu, debian下安裝 apache, mysql, php, ssh


ubuntu apache2 + php5 + mysql5
1. ssh server for remote access
sudo apt-get install ssh

2. database server
sudo apt-get install mysql-server

3. apache http server
sudo apt-get install apache2

4. php for apache http server
sudo apt-get install php5

5. mysql for apache http server
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql

remember! reboot your computer afterward!

如何啟動,停止,重新啟動 Mysql, Apache
start, restart, stop apache
sudo /etc/init.d/apache2 restart

start, restart, stop mysql
sudo /etc/init.d/mysql restart

How To Use Python To Import SQL Query

如何利用python的postgres模組來寫query

import pgsql (sudo apt-get install pgsql)
cursur
..
...
..

2008年1月9日 星期三

blog about me

everyday life.... just keep things on track