Skip to content

Instantly share code, notes, and snippets.

View romejiang's full-sized avatar
🤒
Out sick

romejiang romejiang

🤒
Out sick
View GitHub Profile

1.新建一个自动备份的脚本:

#!/bin/sh
NAME='sales' # 修改为待备份项目的数据库名
DATE=`date +%Y%m%d%H%M%S`
echo $DATE
# 创建备份的文件夹
DEST='/usr/backups'
if [ ! -d "$DEST" ]; then
@romejiang
romejiang / README-Template.md
Created April 9, 2017 06:15 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@romejiang
romejiang / automatic-nightly-backups-for-mongodb.md
Last active April 9, 2017 06:21 — forked from lzl/automatic-nightly-backups-for-mongodb.md
服务器每日自动备份 MongoDB 数据库的配置方法

第一步,创建一个存放备份的文件夹:

比如 mkdir /alidata/backup

第二步,新建一个自动备份的脚本:

#!/bin/sh
NAME='mxlzb' # 手动修改为待备份项目的数据库名
DATE=`date +%Y%m%d%H%M%S`
@romejiang
romejiang / grails-encoding-wrong.md
Last active March 16, 2017 12:04
Grails outputs wrong encoding

add "systemProperty "file.encoding", "utf-8" " to build.gredle file inside bootRun.

bootRun {
    jvmArgs('-Dspring.output.ansi.enabled=always')
    addResources = true
    systemProperty "file.encoding", "utf-8"
}
mongodump -h localhost -d yiqiadmin -o yiqiadmin
@romejiang
romejiang / child.js
Created February 10, 2017 07:42 — forked from kevinohara80/child.js
killing a node.js child process with infinite loop
while(true) {
console.log('blah');
}
// ====================================================
// 百度刷福程序
// 进百度图片,搜“福”,然后打开 console ,运行下面的程序,不懂问王鹤
// ====================================================
var step = 3000;
var size = 500;
var imgs = $(".main_img");
var index = imgs.length - 1;