Directories ¶
Path | Synopsis |
---|---|
3.7 Bernoulli test A test throw corn N times, see how many times gets the front side.
|
3.7 Bernoulli test A test throw corn N times, see how many times gets the front side. |
Closure recursion
|
Closure recursion |
https://blog.golang.org/go-maps-in-action
|
https://blog.golang.org/go-maps-in-action |
Manuals ======= Install DB ---------- pi@host$ sudo apt-get install postgresql Create database and its account ------------------------------- Notice: user/password must match exist accounts in OS !!! pi@host$ sudo -u postgres psql -U postgres CREATE USER pi WITH PASSWORD 'xxxxxx'; CREATE DATABASE snsrobot; GRANT ALL PRIVILEGES ON DATABASE snsrobot TO pi; \q # raspbian with raspberry pi 2: pi@host$ sudo -u postgres cat <<_END >>/var/lib/postgresql/data/pg_hba.conf # ubuntu: pi@host$ #sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/pg_hba.conf host all "pi" 0.0.0.0/0 trust _END pi@host$ sudo service postgresql restart Create tables in host --------------------- pi@host$ psql snsrobot snsrobot => CREATE TABLE userinfo ( uid serial NOT NULL, username character varying(100) NOT NULL, departname character varying(500) NOT NULL, Created date, CONSTRAINT userinfo_pkey PRIMARY KEY (uid) ) WITH (OIDS=FALSE); snsrobot => \q Configure the remote access --------------------------- pi@host$ sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/postgresql.conf listen_addresses='*' _END pi@host$ sudo service postgresql restart user@client$ psql -h 192.168.1.109 -U pi -W -d snsrobot Usage Example ------------- user@client$ go build user@client$ ./testpg.exe -c pi:xxxxx@192.168.1.109/snsrobot [Demo program]: http://astaxie.gitbooks.io/build-web-application-with-golang/content/en/05.4.html [Remote access]: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html
|
Manuals ======= Install DB ---------- pi@host$ sudo apt-get install postgresql Create database and its account ------------------------------- Notice: user/password must match exist accounts in OS !!! pi@host$ sudo -u postgres psql -U postgres CREATE USER pi WITH PASSWORD 'xxxxxx'; CREATE DATABASE snsrobot; GRANT ALL PRIVILEGES ON DATABASE snsrobot TO pi; \q # raspbian with raspberry pi 2: pi@host$ sudo -u postgres cat <<_END >>/var/lib/postgresql/data/pg_hba.conf # ubuntu: pi@host$ #sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/pg_hba.conf host all "pi" 0.0.0.0/0 trust _END pi@host$ sudo service postgresql restart Create tables in host --------------------- pi@host$ psql snsrobot snsrobot => CREATE TABLE userinfo ( uid serial NOT NULL, username character varying(100) NOT NULL, departname character varying(500) NOT NULL, Created date, CONSTRAINT userinfo_pkey PRIMARY KEY (uid) ) WITH (OIDS=FALSE); snsrobot => \q Configure the remote access --------------------------- pi@host$ sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/postgresql.conf listen_addresses='*' _END pi@host$ sudo service postgresql restart user@client$ psql -h 192.168.1.109 -U pi -W -d snsrobot Usage Example ------------- user@client$ go build user@client$ ./testpg.exe -c pi:xxxxx@192.168.1.109/snsrobot [Demo program]: http://astaxie.gitbooks.io/build-web-application-with-golang/content/en/05.4.html [Remote access]: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html |
Manuals ======= Install DB ---------- pi@host$ sudo apt-get install postgresql Create database and its account ------------------------------- Notice: user/password must match exist accounts in OS !!! pi@host$ sudo -u postgres psql -U postgres CREATE USER pi WITH PASSWORD 'xxxxxx'; CREATE DATABASE snsrobot; GRANT ALL PRIVILEGES ON DATABASE snsrobot TO pi; \q # raspbian with raspberry pi 2: pi@host$ sudo -u postgres cat <<_END >>/var/lib/postgresql/data/pg_hba.conf # ubuntu: pi@host$ #sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/pg_hba.conf host all "pi" 0.0.0.0/0 trust _END pi@host$ sudo service postgresql restart Create tables in host --------------------- pi@host$ psql snsrobot snsrobot => CREATE TABLE userinfo ( uid serial NOT NULL, username character varying(100) NOT NULL, departname character varying(500) NOT NULL, Created date, CONSTRAINT userinfo_pkey PRIMARY KEY (uid) ) WITH (OIDS=FALSE); snsrobot => \q Configure the remote access --------------------------- pi@host$ sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/postgresql.conf listen_addresses='*' _END pi@host$ sudo service postgresql restart user@client$ psql -h 192.168.1.109 -U pi -W -d snsrobot Usage Example ------------- user@client$ go build user@client$ ./testpg.exe -c pi:xxxxx@192.168.1.109/snsrobot [Demo program]: http://astaxie.gitbooks.io/build-web-application-with-golang/content/en/05.4.html [Remote access]: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html
|
Manuals ======= Install DB ---------- pi@host$ sudo apt-get install postgresql Create database and its account ------------------------------- Notice: user/password must match exist accounts in OS !!! pi@host$ sudo -u postgres psql -U postgres CREATE USER pi WITH PASSWORD 'xxxxxx'; CREATE DATABASE snsrobot; GRANT ALL PRIVILEGES ON DATABASE snsrobot TO pi; \q # raspbian with raspberry pi 2: pi@host$ sudo -u postgres cat <<_END >>/var/lib/postgresql/data/pg_hba.conf # ubuntu: pi@host$ #sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/pg_hba.conf host all "pi" 0.0.0.0/0 trust _END pi@host$ sudo service postgresql restart Create tables in host --------------------- pi@host$ psql snsrobot snsrobot => CREATE TABLE userinfo ( uid serial NOT NULL, username character varying(100) NOT NULL, departname character varying(500) NOT NULL, Created date, CONSTRAINT userinfo_pkey PRIMARY KEY (uid) ) WITH (OIDS=FALSE); snsrobot => \q Configure the remote access --------------------------- pi@host$ sudo -u postgres cat <<_END >>/etc/postgresql/9.4/main/postgresql.conf listen_addresses='*' _END pi@host$ sudo service postgresql restart user@client$ psql -h 192.168.1.109 -U pi -W -d snsrobot Usage Example ------------- user@client$ go build user@client$ ./testpg.exe -c pi:xxxxx@192.168.1.109/snsrobot [Demo program]: http://astaxie.gitbooks.io/build-web-application-with-golang/content/en/05.4.html [Remote access]: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html |
Demon for manage connection pool of redis.
|
Demon for manage connection pool of redis. |
Install `runtemplate` by `go get github.com/flowonyx/runtemplate`.
|
Install `runtemplate` by `go get github.com/flowonyx/runtemplate`. |
simple does nothing except block while running the service.
|
simple does nothing except block while running the service. |
http://blog.studygolang.com/2013/01/go%E5%8A%A0%E5%AF%86%E8%A7%A3%E5%AF%86%E4%B9%8Brsa/ 密钥长度,1024觉得不够安全的话可以用2048,但是代价也相应增大 openssl genrsa -out private.pem 1024 用于生成密钥。
|
http://blog.studygolang.com/2013/01/go%E5%8A%A0%E5%AF%86%E8%A7%A3%E5%AF%86%E4%B9%8Brsa/ 密钥长度,1024觉得不够安全的话可以用2048,但是代价也相应增大 openssl genrsa -out private.pem 1024 用于生成密钥。 |
Click to show internal directories.
Click to hide internal directories.