Skip to content

Instantly share code, notes, and snippets.

View jae-jae's full-sized avatar
🏠
Working from home

Jaeger jae-jae

🏠
Working from home
  • China
View GitHub Profile
@jae-jae
jae-jae / iframe-sandbox.js
Last active August 27, 2017 08:19
create iframe and append page HTML to iframe 动态创建iframe沙箱
/**
* Create Iframe
*
* Author: Jaeger <JaegerCode@gmail.com>
*
* */
(function(global){
global.iframe = {
create:function (dom,content){
var tpl = '<iframe src="about:blank" style="width:100%;height:100%;border:0px;display: block!important;"></iframe>';
@jae-jae
jae-jae / apache-vhost-manage.sh
Last active June 16, 2017 03:42
apache的host管理
#!/bin/bash
#
# apache虚拟host管理
#
# @Author: Jaeger <JaegerCode@gmail.com>
# @Version: 0.3
function Option()
{
echo "选择操作:"
#!/bin/bash
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
#php -r "if (hash_file('SHA384', 'composer-setup.php') === 'aa96f26c2b67226a324c27919f1eb05f21c248b987e6195cad9690d5c1ff713d53020a02ac8c217dbf90a7eacc9d141d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
cp composer.phar /usr/local/bin/composer
@jae-jae
jae-jae / README.md
Last active May 16, 2017 17:48
kvm服务器系统盘与数据盘合并脚本

执行

1.合并系统盘与数据盘

wget https://gist.githubusercontent.com/jae-jae/6010e2ab7e5cd857e22a9c90817f6343/raw/3733ba54077bf7dcb522d21b105a4d82e58581d1/merge-hrad-disk.sh
bash merge-hrad-disk.sh

2.扩展swap分区,合并系统盘与数据盘

wget https://gist.githubusercontent.com/jae-jae/6010e2ab7e5cd857e22a9c90817f6343/raw/1c8da2ab055179902f57c74a2f5006a8467a3563/merge-hrad-disk-and-swap.sh
@jae-jae
jae-jae / autojump
Last active February 21, 2017 04:01
安装ZSH
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py
最后把以下代码加入.zshrc:
[[-s ~/.autojump/etc/profile.d/autojump.sh ]]&&.~/.autojump/etc/profile.d/autojump.sh
@jae-jae
jae-jae / install-grive.sh
Last active December 16, 2016 04:09
安装Grive,在Linux VPS上同步文件到Google Drive
#!/bin/bash
# apt-get install software-properties-common -y
add-apt-repository ppa:nilarimogard/webupd8
apt-get update
apt-get install grive -y
mkdir ~/google_drive
cd ~/google_drive
@jae-jae
jae-jae / cron
Last active December 12, 2016 13:39
mysql备份shell脚本
50 0 * * * rsync -avzP root@xxx.com:/home/mysql_data_backup /home/my_site_backup/
@jae-jae
jae-jae / M.js
Last active November 24, 2016 07:13
M.js对NodeJS的数据库操作的简单封装
/**
* M.js
*
* 对NodeJS的数据库操作的简单封装
*
* @author Jaeger <JaegerCode@gmail.com>
* @link https://gist.github.com/jae-jae/bfe0961253e7441242bb724906b26133
* @version 1.1
*
**/
@jae-jae
jae-jae / Sniffing-download.user.js
Created September 24, 2016 05:50
下载一键通,利用搜狗浏览器“下载一键通”功能的API,自动帮您找到页面中资源的最佳下载地址,让下载更简单!
// ==UserScript==
// @name 下载一键通
// @author greasepig
// @namespace https://greasyfork.org/users/2620-greasepig
// @description 利用搜狗浏览器“下载一键通”功能的API,自动帮您找到页面中资源的最佳下载地址,让下载更简单!
// @version 1.0.2
// @include http://*
// @run-at document-end
// @grant GM_xmlhttpRequest
// ==/UserScript==
@jae-jae
jae-jae / authcode.php
Created September 2, 2016 15:26 — forked from BelinChung/authcode.php
Discuz! 中的加解密函数
<?php
/**
* @param string $string 原文或者密文
* @param string $operation 操作(ENCODE | DECODE), 默认为 DECODE
* @param string $key 密钥
* @param int $expiry 密文有效期, 加密时候有效, 单位 秒,0 为永久有效
* @return string 处理后的 原文或者 经过 base64_encode 处理后的密文
*
**/
function authcode($string, $operation = 'DECODE', $key = '', $expiry = 3600)