This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# devpi install for a dedicated ubuntu server with upstart | |
# based on http://tim.freunds.net/blog/devpi.html | |
# execute as root (sudo) | |
set -ex # exit on error, print executed commands | |
DEVPI_VENV=/opt/devpi | |
DEVPI_USER=devpi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
sort-to-buckets '/dest/files-{}.lst' 'bucket-selector-python-regexp' | |
-> | |
files: | |
/dest/files-1st-bucket.lst | |
... | |
/dest/files-last-bucket.lst | |
''' | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.. include:: <s5defs.txt> | |
.. |br| raw:: html | |
<br /> | |
======================== | |
Names for code fragments | |
======================== | |
(based on reusability) | |
---------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requires sponge from Debian(?) package moreutils | |
set -x | |
project=$(basename $(pwd)) | |
date=$(date +%Y%m%d) | |
zipfile=${project}-${USER}-data-${date}.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PYPI_USER=pypi | |
PYPI_HOME=/home/$PYPI_USER | |
PYPI_VENV=/home/pypi/env | |
PYPI_REPO=/data/pypi/repo | |
PYPI_PASSWORD=/data/pypi/repo.htaccess | |
adduser pypi --disabled-password --gecos PYPI --home $PYPI_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# reimplementation of moreutil's sponge | |
# moreutil conflicts with GNU parallel on both Ubuntu and Fedora | |
# http://manned.org/sponge/c673547d | |
PATH=/bin:/usr/bin | |
outputfile="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
root=/ramdisk/pypiserver | |
package_dir=${root}/packages | |
mkdir -p ${package_dir} | |
htpasswd=${root}/htpasswd | |
htpasswd -bc ${htpasswd} testuser testpass | |
. ~/.virtualenvs/pypiserver/bin/activate | |
echo ============================ | |
echo user-pass: testuser-testpass | |
echo ============================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# wagnerfischer.py: Dynamic programming Levensthein distance function | |
# Kyle Gorman <gormanky@ohsu.edu> | |
# | |
# Based on: | |
# | |
# Robert A. Wagner and Michael J. Fischer (1974). The string-to-string | |
# correction problem. Journal of the ACM 21(1):168-173. | |
# | |
# The thresholding function was inspired by BSD-licensed code from |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PEX | |
( VE="$(mktemp -d)"; virtualenv "$VE"; . "$VE/bin/activate"; pip install pex; pex -r pex -e pex.bin.pex:main -o ~/bin/pex; rm -rf "$VE"; ) | |
# Python | |
pex -r autopep8 -e autopep8:main -o ~/bin/autopep8 | |
pex -r pip-init -e pip_init:main -o ~/bin/pip-init | |
pex -r pyrene -e pyrene.main:main -o ~/bin/pyrene | |
# pex -r yolk -e yolk.cli:main -o ~/bin/yolk | |
pex -r ptpython -e ptpython.entry_points.run_ptpython:run -o ~/bin/ptpython | |
pex -r ptpython -r ipython -e ptpython.entry_points.run_ptipython:run -o ~/bin/ptipython |
OlderNewer