Skip to content

Instantly share code, notes, and snippets.

@akatch
akatch / xboxdrv.service
Created October 24, 2014 01:54
systemd script for xboxdrv
# Systemd unit to enable xboxdrv driver for Xbox 360 controller
# Usage:
# save to /lib/systemd/system/xboxdrv.service
# to start: sudo service xboxdrv start
# to enable on boot: sudo systemctl enable xboxdrv
[Unit]
Description=Xbox controller driver daemon
[Service]
@mustafaturan
mustafaturan / ruby.2.6.3-setup.sh
Last active February 2, 2023 10:08
ruby 2.6.3 setup for centos 6.x
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@ysaotome
ysaotome / install_pyenv.sh
Last active August 7, 2021 13:27
pyenv install for CentOS 6.5 x86_64
#!/bin/zsh
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
@sloria
sloria / bobp-python.md
Last active May 12, 2024 06:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@perrygeo
perrygeo / django_model_graph.sh
Created April 13, 2013 21:44
Generate UML diagram of django app models
apt-get install python-pygraphviz
pip install django-extensions
# add 'django_extensions' to INSTALLED_APPS in settings.py
python manage.py graph_models trees -o test.png
@gialloporpora
gialloporpora / gist:4572776
Created January 19, 2013 13:49
This batch file saves the list of installed programs in a tXT file for printing.
@echo off
REM Reference: http://www.techrepublic.com/forum/questions/101-215911/dos-command-to-list-all-installed-programs
echo ================= >>software_list.txt
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall temp1.txt
find "DisplayName" temp1.txt| find /V "ParentDisplayName" > temp2.txt
for /f "tokens=2,3 delims==" %%a in (temp2.txt) do (echo %%a >> software_list.txt)
del temp1.txt
del temp2.txt
REM type software_list.txt | more
echo.
@nhoffman
nhoffman / pyscript.py
Last active May 8, 2024 14:26
Python script template
#!/usr/bin/env python3
"""A simple python script template.
"""
import os
import sys
import argparse
@marianoguerra
marianoguerra / table2rst.py
Created August 10, 2011 16:14
csv table 2 rst
'''read a csv file representing a table and write a restructured text simple
table'''
import sys
import csv
def get_out(out=None):
'''
return a file like object from different kinds of values
None: returns stdout
string: returns open(path)