Skip to content

Instantly share code, notes, and snippets.

@dawn360
dawn360 / Installing Kafka and Storm
Created September 9, 2016 18:35
Installing Kafka and Storm
Create a directory for storm and enter it
mkdir storm
cd storm
Create a data directory
mkdir -p datadir/zookeeper
Download ZooKeeper and unzip it
https://zookeeper.apache.org/releases.html(or the appropriate version)
tar -xvf zookeeper***
You should be able to download the latest python version and follow the README file. The steps should be simple enough.
./configure
make
make install
Note that you don't have to remove python-2.7.3 from your system to install an other version.
You can switch between different versions using
sudo update-alternatives --config python
Use the NodeSource PPA. For details look at the installation instructions. First, choose the Node.js version you need and add the sources for it:
# for Node.js v4
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
# OR for Node.js v5
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
# OR for Node.js v6
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
Then install the Node.js package.
# Make the Box as Small as possible
sudo apt-get clean
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
cat /dev/null > ~/.bash_history && history -c && exit
vagrant package --output mynew.box
# Add the Box into Your Vagrant Install
vagrant box add mynewbox mynew.box
@dawn360
dawn360 / gist:a7b1689c4706f0042972b913dd6bbd43
Created August 31, 2016 19:34 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@dawn360
dawn360 / Example log
Created February 12, 2016 16:09 — forked from dspezia/Example log
Assessing pending activity of a Redis server
> ~/tcp_redis_monitor.py 6379
Timestamp Nb TX bytes RX bytes TX RMA RX RMA
1333983822.943 1 0 0 0.000 0.000
1333983823.193 1 0 0 0.000 0.000
1333983824.194 1 0 0 0.000 0.000
1333983825.195 1 0 0 0.000 0.000
1333983826.196 1 0 0 0.000 0.000
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
Ubuntu 14.04
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
##Remove existing mongo
sudo service mongod stop
sudo apt-get purge mongodb-org*
## php5-dev
sudo apt-get install php5-dev
#update pecl
sudo apt-get install php-pear
#install igbinary
sudo pecl install igbinary
#Install PHP Redis extension
#Ubuntu 14.04
apt-get install python-dev libmysqlclient-dev
pip install MySQL-python