$ wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-1.noarch.rpm
$ sudo rpm -ihv pgdg-redhat96-9.6-1.noarch.rpm
$ sudo yum -y install postgresql96-server postgresql96-devel postgresql96-contrib
$ sudo systemctl start postgresql-9.6
$ sudo systemctl status postgresql-9.6
$ sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
$ sudo systemctl enable postgresql-9.6
$ sudo systemctl start postgresql-9.6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sed -i -e "s:^ONBOOT=no$:ONBOOT=yes:" /etc/sysconfig/network-scripts/ifcfg-eth0 | |
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep ONBOOT | |
# service network restart | |
# ip addr show eth0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "Hello World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.run('0.0.0.0', debug=True, ssl_context=( | |
'<server.keyのディレクトリ>/server.crt', | |
'<server.keyのディレクトリ>/server.key' | |
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"code": 1, | |
"ja": "北海道", | |
"en": "Hokkaido" | |
}, | |
{ | |
"code": 2, | |
"ja": "青森県", | |
"en": "Aomori" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import json | |
import redis | |
import time | |
client = redis.StrictRedis( | |
host='IPアドレス', | |
port=6379, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"encoding/json" | |
) | |
type Student struct { | |
Id int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- omission -- | |
var request = require('superagent'); | |
var React = require('react-native'); | |
-- omission -- | |
var AwesomeProject = React.createClass({ | |
render: function() { |
$ sudo su - postgres -c 'psql'
postgres=# create database <database name>;
postgres=# create user <user name> password '<password>';
postgres=# alter database <database name> owner to <user name>;
OlderNewer