Skip to content

Instantly share code, notes, and snippets.

View dmitrybelyakov's full-sized avatar

Dmitry Belyakov dmitrybelyakov

View GitHub Profile
@cedricpim
cedricpim / gist:5986a839ff40e6bded86
Last active March 15, 2017 21:33 — forked from zbal/gist:7800423
VirtualBox Guest Additions
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
@staltz
staltz / introrx.md
Last active May 18, 2024 05:17
The introduction to Reactive Programming you've been missing
@wernight
wernight / inotifyexec.py
Last active June 27, 2023 22:47
inotifywait helper that executes a command on file change (for Linux, put it in ~/bin/)
#!/usr/bin/env python
"""Use inotify to watch a directory and execute a command on file change.
Watch for any file change below current directory (using inotify via pyinotify)
and execute the given command on file change.
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done`
has many issues which are fixed by this tools:
* If your editor creates a backup before writing the file, it'll trigger multiple times.
* If your directory structure is deep, it'll have to reinitialize inotify after each change.
@romeg
romeg / gist:9968338
Created April 4, 2014 04:45
Maxifier kibana config
{
"title": "Maxifier Logs",
"services": {
"query": {
"idQueue": [],
"list": {
"0": {
"query": "level:\"ERROR\"",
"alias": "",
"color": "#890F02",
@markmevans
markmevans / sdist_hack.py
Created February 11, 2014 00:13
A hack for PyBuilder build.py files so `pyb publish` will work in a filesystem that does not support hardlinks (like VirtualBox shared filesystems.)
#
# Hack the distutils_plugin's SETUP_TEMPLATE to disable hardlinks.
#
import string
from pybuilder.core import init
from pybuilder.plugins.python import distutils_plugin
SDIST_MONKEY_PATCH = """
# sdist_hack: Remove reference to os.link to disable using hardlinks when
@codemoran
codemoran / graphdat-install-conntrack-tools.sh
Created January 8, 2014 00:06
Install conntrack-tools on CentOS
#!/bin/bash
# Make sure we have the dev tools
yum groupinstall "Development Tools"
# Just in case you started installing dependencies from yum
yum -y remove libnfnetlink
# lets put the source code here
mkdir -p ~/.src
@r10r
r10r / enable_dnsmasq_on_osx.sh
Last active October 11, 2019 04:27
Installs and configures dnsmasq on osx (for local resolution of development machines e.g virtualbox). Cudos to Alan Ivey http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/vbox'
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@stantonk
stantonk / doit
Created November 15, 2012 22:46
Install python 2.7.3 on CentOS 5.8
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
yum groupinstall "Development tools"
yum install zlib-devel
yum install bzip2-devel openssl-devel ncurses-devel
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar xf Python-2.7.3.tar.bz2
cd Python-2.7.3