Skip to content

Instantly share code, notes, and snippets.

@quiver
quiver / inotify.py
Created September 3, 2012 15:10
Python implementation of "IBM DeveloperWorks : Monitor Linux file system events with inotify"
import collections
import ctypes
import ctypes.util
# bit masks
IN_ISDIR = 0x40000000
IN_ALL_EVENTS = 0xfff
class inotify_event_struct(ctypes.Structure):
"""
@lucasdavila
lucasdavila / 1_ubuntu_terminal_command
Last active May 30, 2026 19:06
Installing Source Code Pro fonts in ubuntu
# to execute this gist, run the line bellow in terminal
\curl -L https://raw.github.com/gist/3875946/install_source_code_pro.sh | sh
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@ssmereka
ssmereka / plexDatabaseBackupScript.sh
Last active July 12, 2026 23:28
Plex Media Server database backup script.
#!/bin/bash
# Backup a Plex database.
# Author Scott Smereka
# Version 1.0
# Script Tested on:
# Ubuntu 12.04 on 2/2/2014 [ OK ]
# Plex Database Location. The trailing slash is
@fperez
fperez / ProgrammaticNotebook.ipynb
Last active March 20, 2025 03:57
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Chaser324
Chaser324 / GitHub-Forking.md
Last active September 15, 2026 12:48
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@eXeC64
eXeC64 / coverity_pretty_print.py
Created February 24, 2015 13:22
Pretty printer for coverity issue CSV files
#!/usr/bin/env python
import argparse, csv
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="pretty print a coverity issues csv file")
parser.add_argument("file",
type=str,
help="The csv file to parse")
parser.add_argument("-c",
dest="colors",
@apokalyptik
apokalyptik / debian-jessie-kubernetes-1.3-manual-install-guide.md
Last active November 21, 2023 12:31
Set up Kubernetes on 3 Debian Jessie virtual machines -- No magic

The Goal

Set up Kubernetes on 3 Debian Jessie virtual machines: One master. Two nodes. Additionally do this without any "magic" so that what is required to be running to make everything work is plain and obvious.

We will be using flannel for the inter-machine networking layer. Mainly because it is useful and it seems to be pretty popular.

The Setup

@danielballan
danielballan / magics.py
Last active July 28, 2017 12:10
IPython magics for user-defined bluesky CLI-like tools
# This file must be run in the global namespace, not imported as a module.
# This can be done using an IPython profile or `%run -i magics.py`.
import ast
from IPython.core.magic import register_line_magic
import bluesky.plans as bp
@register_line_magic
def mv(line):
# %mv theta 3 --> RE(mv(theta, 3))
@danielballan
danielballan / startup.py
Created September 7, 2017 21:24
standard bluesky startup
# Make ophyd listen to pyepics.
from ophyd import setup_ophyd
setup_ophyd()
# Set up a RunEngine and use metadata backed by a sqlite file.
from bluesky import RunEngine
from bluesky.utils import get_history
RE = RunEngine(get_history())
# Set up a Broker.