Skip to content

Instantly share code, notes, and snippets.

View skyer9's full-sized avatar
🎯
Focusing

skyer9

🎯
Focusing
View GitHub Profile
@skyer9
skyer9 / node_debian_init.sh
Created December 17, 2015 08:45 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
@skyer9
skyer9 / hello_sequence.py
Last active March 28, 2017 01:13 — forked from pannous/hello_sequence.py
Simple "Hello World" for tensorflow seq2seq model
# -*- coding: utf-8 -*-
"""Sequence-to-sequence model with an attention mechanism."""
# original code
# https://gist.github.com/pannous/b3f8ab944a85b33e694de21c6ded029e
# see https://www.tensorflow.org/versions/r0.10/tutorials/seq2seq/index.html
# compare https://github.com/tflearn/tflearn/blob/master/examples/nlp/seq2seq_example.py
from __future__ import print_function
import numpy as np
@skyer9
skyer9 / klab-10-2-mnist_nn.py
Created April 22, 2017 11:02
neural network with cnn
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout
batch_size = 128
num_classes = 10
x_train = [1., 2., 3., 4.]
y_train = [1.1, 2.1, 3.1, 4.1]
W, b = 123, 45
learning_rate = 0.05
for epoch in range(0, 200):
for j in range(0, len(x_train)):
cal_y = W * x_train[j] + b
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import SGD
import numpy as np
x_data = [[0, 0, 0],
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
[1, 1, 0],
# https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
# https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
@skyer9
skyer9 / MyHttpsURLConnection.java
Last active February 11, 2018 08:03
Using Self-Certification File in Androiod App
package kr.co.episode.muglangguide.data.remote;
import android.content.Context;
import org.apache.http.conn.ssl.SSLSocketFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.security.KeyManagementException;
@skyer9
skyer9 / sftp on ec2 with vscode.txt
Last active April 29, 2018 12:07
sftp on ec2 with vscode
1. λ§ˆμΌ“ ν”Œλ ˆμ΄μŠ€μ—μ„œ SFTP λ‹€μš΄λ°›κΈ°
2. ctrl+shift+p λ₯Ό λˆ„λ₯Έ ν›„, sftp: config λ₯Ό μž…λ ₯ν•œλ‹€.
3. 섀정을 μ•„λž˜μ™€ 같이 μˆ˜μ •ν•œλ‹€.
{
"context": "./sftp/searver_a",
"protocol": "sftp",
"host": "13.XXX.42.109",