Skip to content

Instantly share code, notes, and snippets.

View wenzhixin's full-sized avatar

文翼 wenzhixin

View GitHub Profile
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active January 16, 2024 21:15
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@wenzhixin
wenzhixin / install-openldap-gosa-ubuntu14.04
Last active July 10, 2020 05:36
Install guide for OpenLDAP and GOsa on Ubuntu 14.04
sudo apt-get install slapd ldap-utils
sudo dpkg-reconfigure slapd
sudo apt-get install gosa gosa-schema
sudo vi /etc/ldap/convert.conf << EOT
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/nis.schema
include /etc/ldap/schema/inetorgperson.schema
@wenzhixin
wenzhixin / waitForKeyElements.js
Last active May 25, 2019 14:08 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@wenzhixin
wenzhixin / mongoexport.js
Created June 12, 2013 14:50
mongoexport.js
var fs = require('fs'),
MongoClient = require('mongodb').MongoClient,
Server = require('mongodb').Server,
options = null;
mongoClient = null;
if (process.argv.length <= 2 || process.argv.indexOf('--help') !== -1) {
showHelp();
return;
@wenzhixin
wenzhixin / redmine-3.0.2-on-ubuntu-14.04
Last active November 15, 2017 09:30
redmine 3.0.2 installer on ubuntu 14.04(new installtion) with nginx, mysql and puma
# set cache proxy
sudo vi /etc/apt/apt.conf << EOT
Acquire::http::Proxy "http://192.168.88.10:3142";
Acquire::HTTP::Proxy::192.168.88.10 "DIRECT";
EOT
sudo apt-get update
sudo apt-get upgrade
@wenzhixin
wenzhixin / jquery_plugin_template.js
Last active September 18, 2017 07:20
jQuery 插件模板
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* @version 0.0.1
* @github https://github.com/wenzhixin/
* @blog http://wenzhixin.net.cn
*/
(function($) {
'use strict';
@wenzhixin
wenzhixin / jquery.base64.js
Created October 29, 2014 02:28
Base64 plugin support unicode characters.
jQuery.base64 = (function($) {
// private property
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// private method for UTF-8 encoding
function utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
@wenzhixin
wenzhixin / mac_install_nginx_php_fpm.md
Last active June 6, 2016 18:38
MAC install nginx + php-fpm

nginx

brew install nginx

config

vi /usr/local/etc/nginx/
@wenzhixin
wenzhixin / size.js
Created July 23, 2013 02:37
单位转换
function getSize(value) {
var b1 = Math.pow(2, 10), //KB
b2 = Math.pow(2, 20), //MB
b3 = Math.pow(2, 30), //GB
b4 = Math.pow(2, 40), //TB
value = value.toLowerCase(),
size = parseFloat(value);
if (!size) {
return 0;
function parse(search) {
var query = {},
params = search.substring(1).split('&');
for (var i = 0, l = params.length; i < l; i++) {
var p = params[i].split('=');
query[p[0]] = p[1] || '';
}
return query;
}