Skip to content

Instantly share code, notes, and snippets.

View laeshiny's full-sized avatar

laeshiny laeshiny

  • Cargocall
  • Seoul, Korea
View GitHub Profile
@laeshiny
laeshiny / install_elasticsearch_kibana.sh
Created August 9, 2016 08:33
Elasticsearch & Kibana Install
# 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
@laeshiny
laeshiny / jupyter-notebook.service
Created August 4, 2016 09:34
systemd service for Jupyter Notebook
[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]
@laeshiny
laeshiny / jupyter-notebook.service
Created August 4, 2016 09:34
systemd service for Jupyter Notebook
[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]
@laeshiny
laeshiny / Initialize_jekyll.sh
Created August 2, 2016 14:23
Initialize jekyll
# 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
def escape_to_xml(val):
"""Escape string to xml style
In addition, escape ", '
"""
entities = {'"': '"', '\'': '''}
val = escape(val, entities)
return val
@laeshiny
laeshiny / mgoTestExample.go
Last active February 18, 2022 09:23
mgo test example
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type Content struct {