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" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"time" | |
) | |
type Content struct { |
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
def escape_to_xml(val): | |
"""Escape string to xml style | |
In addition, escape ", ' | |
""" | |
entities = {'"': '"', '\'': '''} | |
val = escape(val, entities) | |
return val |
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
# Install for jekyll | |
sudo apt-get update | |
sudo apt install -y ruby | |
sudo apt install -y python-minimal | |
sudo apt install -y nodejs | |
sudo apt install -y gcc | |
# initialize | |
cd laeshiny.github.io |
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
[Unit] | |
Description=Jupyter Notebook | |
Requires=local-fs.target | |
After=local-fs.target | |
[Service] | |
ExecStart=/usr/local/bin/jupyter-notebook --ip 0.0.0.0 --notebook-dir /home/%i/apps/jupyter-notebook/ | |
User=%i | |
[Install] |
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
[Unit] | |
Description=Jupyter Notebook | |
Requires=local-fs.target | |
After=local-fs.target | |
[Service] | |
ExecStart=/usr/local/bin/jupyter-notebook --ip 0.0.0.0 --notebook-dir /home/%i/apps/jupyter-notebook/ | |
User=%i | |
[Install] |
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
# Install Elasticsearch | |
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
sudo apt-get update && sudo apt-get install elasticsearch | |
# Set host | |
# /etc/elasticsearch/elasticsearch.yml | |
# network.host: 0.0.0.0 |