Friday, April 24, 2015
Monday, April 13, 2015
most recent files in a directory
find $1 -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr |
cut -d: -f2- | head
cut -d: -f2- | head
Sunday, April 12, 2015
Sunday, April 5, 2015
Beautiful Soup
You didn't write that awful page. You're just trying to get some data
out of it. Beautiful Soup is here to help. Since 2004, it's been
saving programmers hours or days of work on quick-turnaround screen
scraping projects.
http://www.crummy.com/software/BeautifulSoup/
out of it. Beautiful Soup is here to help. Since 2004, it's been
saving programmers hours or days of work on quick-turnaround screen
scraping projects.
http://www.crummy.com/software/BeautifulSoup/
Saturday, April 4, 2015
Installing PostGIS on centos 6.5
sudo rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm
yum install postgresql94 postgresql94-server postgresql94-libs
postgresql94-contrib postgresql94-devel
sudo yum install postgis2_94
yum install pgrouting_94
yum install php-pgsql
service postgresql-9.4 initdb
----------------------------------------------------------------
connecting :
su postgres
psql -p 5432
SELECT setting FROM pg_settings WHERE name = 'config_file';
postgres=# create database shops_new;
CREATE DATABASE db1;
\l - show databases
\d <table>; describe table
\connect db1; connect to db1
\dt show tables
postgres=# \connect db_new;
You are now connected to database "db_new" as user "postgres".
db_new=# create extension postgis;
CREATE EXTENSION
db_new=#
ALTER TABLE your_table ADD COLUMN idBIGSERIAL PRIMARY KEY;
db_new=# ALTER TABLE table1 ADD COLUMN name character varying(128) NOT
NULL DEFAULT '';
db_new=# ALTER TABLE table1 ADD COLUMN address character varying(1024)
NOT NULL DEFAULT '';
ALTER TABLE table1 ADD COLUMN male int;
SELECT AddGeometryColumn ('','shops','location',4326,'POINT',2);
INSERT INTO shops(name,address,location,male,female,free,rating)
VALUES("name1","address1",ST_GeomFromText('POINT(-71.060316
48.432044)', 4326), 1,1,1,1);
http://www.cyberciti.biz/faq/psql-fatal-ident-authentication-failed-for-user/
yum install postgresql94 postgresql94-server postgresql94-libs
postgresql94-contrib postgresql94-devel
sudo yum install postgis2_94
yum install pgrouting_94
yum install php-pgsql
service postgresql-9.4 initdb
----------------------------------------------------------------
connecting :
su postgres
psql -p 5432
SELECT setting FROM pg_settings WHERE name = 'config_file';
postgres=# create database shops_new;
CREATE DATABASE db1;
\l - show databases
\d <table>; describe table
\connect db1; connect to db1
\dt show tables
postgres=# \connect db_new;
You are now connected to database "db_new" as user "postgres".
db_new=# create extension postgis;
CREATE EXTENSION
db_new=#
ALTER TABLE your_table ADD COLUMN idBIGSERIAL PRIMARY KEY;
db_new=# ALTER TABLE table1 ADD COLUMN name character varying(128) NOT
NULL DEFAULT '';
db_new=# ALTER TABLE table1 ADD COLUMN address character varying(1024)
NOT NULL DEFAULT '';
ALTER TABLE table1 ADD COLUMN male int;
SELECT AddGeometryColumn ('','shops','location',4326,'POINT',2);
INSERT INTO shops(name,address,location,male,female,free,rating)
VALUES("name1","address1",ST_GeomFromText('POINT(-71.060316
48.432044)', 4326), 1,1,1,1);
http://www.cyberciti.biz/faq/psql-fatal-ident-authentication-failed-for-user/
Subscribe to:
Posts (Atom)