Skip to content

Instantly share code, notes, and snippets.

@kevyin
kevyin / gist:5b00a17bf10bfee5da778b6acfa40545
Created October 4, 2016 01:14
Download and install nbr2mp4
wget http://support.webex.com/supportutilities/nbr2mp4.tar
tar -xvf nbr2mp4.tar ./
bash ./nbr2mp4.sh
cd nbr2_mp4/
# find missing libraries
ldd nbr_play | grep not
# install 32bit versions
sudo apt-get install libpangox-1.0-0:i386 libpangoxft-1.0-0:i386
@welshstew
welshstew / groovy-zip.groovy
Created March 5, 2015 04:41
groovy script to zip and unzip text/String content
// Simple groovy script to compress / decompress Strings
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
def zip(String s){
def targetStream = new ByteArrayOutputStream()
def zipStream = new GZIPOutputStream(targetStream)
zipStream.write(s.getBytes('UTF-8'))
zipStream.close()
def zippedBytes = targetStream.toByteArray()
@GianlucaGuarini
GianlucaGuarini / post-merge
Last active February 13, 2025 13:38 — forked from sindresorhus/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
@amitsaha
amitsaha / ipython-notebook.service
Last active December 23, 2015 15:59
Run IPython notebook under systemd
# README:
# Copy this file to /usr/lib/systemd/system/
# sudo systemctl daemon-reload
# systemctl enable ipython-notebook
# systemctl start ipython-notebook
# The WorkingDirectory and ipython-dir must exist
# If you don't want anything fancy, go to http://127.0.0.1:8888 to see your notebook
# wheneber you want it
[Unit]
@lluang
lluang / WilkinsonStatisticsQuiz.ipynb
Last active December 20, 2015 08:39
This is an implementation of the Wilkinson Statistics Quiz of the Python data analysis libraries applied to the **NASTY** dataset. Currently based on Pandas. Todo: (1) Finish implementation and confirm that these are correct (2) Apply to other libraries (3) Write up bug submissions as appropriate.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rossant
rossant / raytracing.py
Last active February 19, 2025 01:38
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@charlesflynn
charlesflynn / gist:5576114
Last active March 2, 2018 16:02
Resuming an existing Devstack installation on Ubuntu after reboot (assuming you have NOT run unstack.sh). IP addresses are the defaults used by stack.sh. In this example I'm using postgres as the database backend rather than the default mysql.
sudo ip addr flush dev br-ex
sudo sysctl -w net.ipv4.ip_forward=1
sudo ip addr add 172.24.4.225/28 dev br-ex
sudo ip link set br-ex up
sudo route add -net 10.0.0.0/24 gw 172.24.4.226
sudo service rabbitmq-server start
sudo service postgresql start
sudo service apache2 start
export SERVICE_TOKEN=password
export OS_TENANT_NAME=demo
@francisbyrne
francisbyrne / chmodr.sh
Created September 16, 2012 07:54
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 26, 2025 10:50
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).