Skip to content

Instantly share code, notes, and snippets.

View chengdh's full-sized avatar

chengdh

  • 中国郑州
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script src="https://npmcdn.com/parse/dist/parse.js"></script>
<title>JS Bin</title>
</head>
<body>
@chengdh
chengdh / gist:07a30b75af658208550cdefc58906bb1
Created May 25, 2017 09:08 — forked from jcataluna/gist:1dc2f31694a1c301ab34dac9ccb385ea
Script to save all images from a docker-compose.yml file
#!/bin/bash
mkdir -p out
for img in `grep image $1| sed -e 's/^.*image\: //g'`;
do
cleanname=${img/\//-}
tag=`docker images | grep $img | awk '{print $2}'`
echo "Exporting image: $img, tag:$tag ($cleanname)..."
docker save $img -o out/$cleanname.tar
@chengdh
chengdh / percona-xtrabackup.sh
Created August 28, 2016 00:49 — forked from jaygooby/percona-xtrabackup.sh
Call via crontab on whatever schedule suits you; keep n full mysql Percona xtrabackups of your mysql database, with binary logs applied. Also does a full mysqldump that can then have the binary logs applied to restore to a point-in-time backup via the binlogs. Copy all of this (backup, mysqldump, binlogs) to S3.
#!/bin/bash
#
# Carries out a full mysqldump, calls percona-xtrabackup and then
# copies the sql dump, the percona backup and your mysql bin logs
# to S3 using s3cmd http://s3tools.org/s3cmd
#
# TODO: extract out the S3 backup stuff to make it optional, and so
# other s3 programs can replace the s3cmd call.
# TODO: the if [ $? == 0 ] alert blocks should be a function
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test
@chengdh
chengdh / master.vim
Created March 3, 2014 15:01 — forked from gmccreight/master.vim
vim练习脚本
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
#!/bin/sh
#
# gunicorn_sr Startup script for gunicorn for sr
#
# chkconfig: - 86 14
# processname: gunicorn
# pidfile:
# description: Python application server in ubuntu
#
### BEGIN INIT INFO
@chengdh
chengdh / patch.sh
Created November 3, 2013 14:08 — forked from dlo/patch.sh
修正PIL的错误问题
#!/bin/sh
# Ref: http://ubuntuforums.org/showthread.php?t=1751455
# Uninstall PIL
# sudo pip uninstall PIL -q
# Install required libs
yes | apt-get install build-essential python-dev zlib1g-dev liblcms1-dev libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev
# Link to correct location
@chengdh
chengdh / FAQ.md
Last active December 25, 2015 03:49
淘宝二维通FAQ

FAQ

1. 淘宝二维通有何用途?

这个小工具的目的是将淘宝卖家的店铺网址、出售的商品网址自动转换为二维码,并提供方便易用的分享工具,将二维码分享到各个流行的社交网络平台上,提升店铺或商品的流量,达到提升销量的目的。

2. 淘宝二维通可以生成哪些二维码?

  • 店铺网址二维码
  • 店铺名片vcard格式二维码
  • 在售商品网址二维码

3. 生成的二维码如何使用?

@chengdh
chengdh / centos_rails3.md
Last active December 16, 2015 02:09
在centos 上安装部署rails3环境

1. 在centos server上建立用户,并设置用户组

  1. 添加lmis用户
    以root用户登录,建立lmis用户
    adduser lmis
    修改lmis用户密码
    passwd lmis
  2. 将新建立的用户加到sudoer组中去
    修改/etc/sudoers文件,将lmis用户添加到文件中去,可参考add user to sudoers
  3. 将cenetos上的selinux disable
    参考how to:disable selinux on centos
@chengdh
chengdh / gist:4084763
Created November 16, 2012 06:21
燕赵语音系统安装步骤

安装语音卡驱动,使用DJDBDK V3.3.1

-- 安装完毕后,设备管理器中的PCI设备仍然带有黄色感叹号,但是设备是正常的

进入开始菜单 DJDBDK--DJD161A--Auto Check

点击PCI BORAD CARD检测当前安装的语音卡

点击 save & exit 保存语音卡配置

配置文件如下

@chengdh
chengdh / gist:3760809
Created September 21, 2012 10:29
openerp CI服务器jenkins的安装配置

配置openerp的版本控制环境

安装配置jenkins及其插件

配置git