Skip to content

Instantly share code, notes, and snippets.

@liudanking
liudanking / kera_retrain_model.py
Created June 9, 2018 11:05
Retrain model with keras based on resnet
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequential, Model
from keras.layers import Dropout, Flatten, Dense, GlobalAveragePooling2D
from keras import backend as k
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TensorBoard, EarlyStopping
img_width, img_height = 256, 256
train_data_dir = "tf_files/codoon_photos"
@liudanking
liudanking / gist:14c81e194a924cc268c8
Created November 13, 2015 04:12
Build Nginx from source on Ubuntu 14.04
apt-get update
apt-get install build-essential automake autoconf libtool -y
apt-get install libpcre3 libpcre3-dev -y
apt-get install zlib1g-dev libssl-dev -y
./configure
make
make install
wget -O nginx_signing.key http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" >> /etc/apt/sources.list
apt-get update
apt-get install nginx
//
// main.c
// c_review
//
// Created by liudanking on 4/25/14.
// Copyright (c) 2014 liudanking. All rights reserved.
//
#include <stdio.h>
#include <string.h>
# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details.
"""UDP/SSL server"""
import sys
import errno
import traceback
from gevent import socket
from gevent import core
from gevent.baseserver import BaseServer