Skip to content

Instantly share code, notes, and snippets.

View ericstone57's full-sized avatar

ericstone57 ericstone57

  • Kantar
  • Shanghai
View GitHub Profile
@petemcw
petemcw / gist:2719758
Created May 17, 2012 15:53
Commands to clean a Ubuntu install for smaller Vagrant packages
# Remove items used for building, since they aren't needed anymore
apt-get clean
apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove
# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
# Removing leftover leases and persistent rules
@ihor-sviziev
ihor-sviziev / Combine.php
Last active November 3, 2015 13:13
Mage_SalesRule_Model_Rule_Condition_Product_Combine 1.9.1 fix
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@yuyalush
yuyalush / install_ab.sh
Created September 18, 2011 15:08
Install ApacheBench to CentOS5.6
yum -y install apr apr-util yum-utils
mkdir ~/httpd
cd ~/httpd
yumdownloader httpd
rpm2cpio httpd-2.2.3-53.el5.centos.1.x86_64.rpm | cpio -idmv
mv usr/bin/ab /usr/bin/ab
cd ~
rm -rf ~/httpd
ab http://google.ru/
@gagarine
gagarine / install_php_ngninx.sh
Created February 17, 2012 14:18
Drupal on php-fpm + nginx + apc
brew update
brew install gmp
#install Nginx
brew install nginx
# copy launch script
cp /usr/local/Cellar/nginx/1.0.12/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
#try to launch Nginx
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
#!/bin/bash
# Add Vagrant's NFS setup commands to sudoers, for `vagrant up` without a password
# Updated to work with Vagrant 1.3.x
# Stage updated sudoers in a temporary file for syntax checking
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
@stephanetimmermans
stephanetimmermans / ubuntu-compass-ruby
Last active July 4, 2019 12:48
Install Compass+Ruby on Ubuntu 14.04
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@zellux
zellux / zhihu.recipe
Last active August 9, 2019 16:50
知乎日报 Kindle 版生成工具,可用于 Calibre
#!/usr/bin/env python
__copyright__ = 'Yuanxuan Wang <zellux at gmail dot com>'
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import Tag, NavigableString
from collections import OrderedDict
from contextlib import nested, closing
import json
@EvgenyOrekhov
EvgenyOrekhov / A POSIX shell script for running command-line tools in containers.md
Last active May 17, 2020 09:06
docker-run - a POSIX shell script for running command-line tools in containers

A POSIX shell script for running command-line tools in containers

Install

  1. Clone this repo

    git clone https://gist.github.com/82a78debf7dea8ab1dd4da9c034aee14.git docker-run
    
  2. Create a link to docker-run in your /usr/local/bin/

@srs81
srs81 / hbase_export_csv.py
Last active July 14, 2020 13:19
Export all data from HBase database to CSV in this format: row-key, column-key, value
import happybase, sys, os, string
# VARIABLES
# Output directory for CSV files
outputDir = "/mnt"
# HBase Thrift server to connect to. Leave blank for localhost
server = ""
# Connect to server
c = happybase.Connection(server)
@appastair
appastair / jsonp.js
Last active August 23, 2020 17:52
Cross-domain JSONP Example (jQuery/PHP)
jQuery(function($){
$.ajax({
type: 'GET',
url: '//remote.org/jsonp.php',
data: {
field: 'value'
},
dataType: 'jsonp'
crossDomain: true,
}).done(function(response){