$ crontab -e
0,15,30,45 * * * * rdate -ncav ptbtime1.ptb.de > /dev/null
May 30, 2013
Postgres
Config pg_hba:
local all postgres peer
local all postgres md5
local all all md5
Cac chu de hay ve Postgres:
http://momjian.us/main/blogs/pgblog_categories.html
Unicode:
local all postgres peer
local all postgres md5
local all all md5
Cac chu de hay ve Postgres:
http://momjian.us/main/blogs/pgblog_categories.html
- One of the nicest feature of Postgresql is index on expression:http://www.postgresql.org/docs/9.0/interactive/indexes-expressional.html
http://www.ienablemuch.com/2010/12/postgresql-speeding-up-slow-coalesce.html - CTE, also supports recursion http://www.ienablemuch.com/2010/04/simple-hierarchical-query-display.html
- generate_series http://www.ienablemuch.com/2010/12/date-functions.html
- Windowing functions: http://www.ienablemuch.com/2011/01/postgresql-lag-windowing-function.html
- Superb date functions http://www.ienablemuch.com/2010/12/finding-previous-day-of-week.html
- Richer data types http://www.ienablemuch.com/2010/05/varchar-ip-address-sorting.html
- Functional dependency on primary keys when grouping on it (on next version, 9.1)http://www.ienablemuch.com/2010/08/postgresql-recognizing-functional.html
- User-defined operator: Adding sum of current_timestamp and days column in Postgres
-
And don't forget the DDL, it's also transaction safe:
BEGIN; ALTER TABLE foo DROP COLUMN bar; ALTER TABLE foo ADD COLUMN baz INET; COMMIT;
Great for maintenance work, you will always have a consistent database, even when you lose the database connection or the server goes down.
Unicode:
update pg_database set datallowconn = TRUE where datname = 'template0'; \c template0 update pg_database set datistemplate = FALSE where datname = 'template1'; drop database template1; create database template1 with template = template0 encoding = 'UTF8' LC_CTYPE = 'en_US.utf8' LC_COLLATE = 'en_US.utf8'; update pg_database set datistemplate = TRUE where datname = 'template1'; \c template1 update pg_database set datallowconn = FALSE where datname = 'template0';
May 29, 2013
Setup dev box
apt-get install
postgresql mysql-server php5-cli php5-cgi php5-xdebug php5-curl php5-gd php5-mysql php5-pgsql php5-mcrypt php5-memcached memcached git mc
apache2
a2enmod actions
a2enmod php5_cgi
Edit module conf file.
postgresql mysql-server php5-cli php5-cgi php5-xdebug php5-curl php5-gd php5-mysql php5-pgsql php5-mcrypt php5-memcached memcached git mc
apache2
a2enmod actions
a2enmod php5_cgi
Edit module conf file.
sudo apt-get install libsqlite3-dev
Các vấn đề về dữ liệu bản đồ
Tổng quan các dự án liên quan:
http://www.osgeo.org/
Cơ sở dữ liệu :
PostGIS và PostgreSQL
Render:
http://mapnik.org/
Sử dung trên để bàn:
Sử dung trên web (tương tác được)
OpenLayers http://openlayers.org/
http://www.osgeo.org/
Cơ sở dữ liệu :
PostGIS và PostgreSQL
Render:
http://mapnik.org/
Sử dung trên để bàn:
Sử dung trên web (tương tác được)
OpenLayers http://openlayers.org/
May 27, 2013
Công cụ quản lý DB
Cả MySQL, Postgres, SQLite, cài trên web
Một file php duy nhất + css theme tùy ý :D đẹp
Và nó ở đây
http://www.adminer.org/
Một file php duy nhất + css theme tùy ý :D đẹp
Và nó ở đây
http://www.adminer.org/
May 23, 2013
DBGp
The debug progress
will use DBGp protocol.
This can be applied
to Notepad++ or Sublime Text.
In local machine:
Set the break points somewhere
Add to URL ?XDEBUG_SESSION_START=notepad
Or use some kind of extension to SET the cookie XDEBUG_SESSION_START=notepad
Uncheck Bypass (we really need this map)
Remote path: file:///var/www
Local path: C:\Dev\www
idekey: notepad
Remote server IP: obiviously
The local machine must listen to port 9000, Notepad++ will
listen using this. The remote server should be able to connect to local machine
using port 9000 (by NAT, tunnel, etc…)
In remote server:
apt-get install php5-xdebug
Edit php.ini
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
; xdebug.remote_host=10.0.0.2
; This specify the local machine IP (exposed, not local
address)
; This is important: to use any IP it detects – less pain to
setup
xdebug.remote_connect_back
= 1
xdebug.remote_mode=req
xdebug.remote_log="/var/log/xdebug.log"
xdebug.idekey="notepad"
xdebug.remote_port=9000
Subscribe to:
Posts (Atom)