Finally decided to migrate this blog to http://paragasu.github.io
Finally decided to migrate this blog to http://paragasu.github.io
Edit the commit author and email name in github
edit /etc/sysctl.conf and add config
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
#sysctl -p
The callback function for onRowDoubleClick for Fixed data table.
rowClicked: function(event, rowIndex, rowData){
//code here
}
..
On nfs server
#aptitude install nfs-kernel-server
Edit /etc/exports configuration file
/home/me/public 192.168.1.2(rw,no_root_squash,subtree_check)
Restart nfs
#exportfs -a
#/etc/init.d/nfs-kernel-server start
On nfs client
#aptitude install nfs-common
#/etc/init.d/nfs-common start
To list available nfs
#showmount -e 192.168.1.2
To mount nfs
#mount -t nfs /home/me/public /mnt/public
more info
Ctrl+b "
– split pane horizontally.Ctrl+b %
– split pane vertically.Ctrl+b arrow key
– switch pane.Ctrl+b
, don’t release it and hold one of the arrow keys – resize pane.Ctrl+b c
– (c)reate a new window.Ctrl+b n
– move to the (n)ext window.Ctrl+b p
– move to the (p)revious window.\Come across nice function by Merlin Moncure posted on grokbase
CREATE OR REPLACE FUNCTION calculate_distance(lat1 float8, lon1 float8, lat2 float8, lon2 float8)
RETURNS float8 AS
$$
SELECT ACOS(SIN(RADIANS($1)) * SIN(RADIANS($3)) + COS(RADIANS($1)) * COS(RADIANS($3)) * COS(RADIANS($4) - RADIANS($2))) * 6371;
$$ LANGUAGE 'sql' IMMUTABLE;
More details
http://grokbase.com/t/postgresql/pgsql-general/1069rn3ca0/calculating-distance-between-longitude-and-latitude
http://www.movable-type.co.uk/scripts/latlong.html
Encounter some issue along the way
1.MySQL DATE_SUB & DATE_ADD
(DATE_ADD(NOW(), INTERVAL 30 MINUTES)
(DATE_SUB(NOW(), INTERVAL 30 MINUTES)
(NOW() – INTERVAL ’30’ MINUTE)
(NOW() – INTERVAL ’30’ MINUTE) or
(NOW() – INTERVAL ’30 MINUTES’) or
(NOW() – ’30 MINUTES’::INTERVAL)
2. MySQL RADIANS
Need to cast to real
SELECT RADIANS(lat::real);
3. DISTINCT on json field (v9.4.5)
SELECT DISTINCT id, json_field FROM driver;
Throw could not identify an equality operator for type json error.
Converting the json field to jsonb solve the problem
The replication performance leap from MySQL 5.5 to MySQL 5.6 is more than 4x.
https://blogs.oracle.com/MySQL/entry/mysql_5_6_replication_performance
#wget http://dev.mysql.com/get/mysql-apt-config_0.3.5-1debian8_all.deb
#dpkg -i mysql-apt-config_0.3.5-1debian7_all.deb
#apt-get update
#apt-get install mysql-community-server