Skip to content

Instantly share code, notes, and snippets.

View SyntaxColoring's full-sized avatar
🥟

Max Marrone SyntaxColoring

🥟
View GitHub Profile
# Install python and some binary-dependencies from source in the user directory
# useful for Django webapps on shared hosts like Dreamhost
# BerkelyDB v 4.8 is supported by python 2.7 but not 5.3
# In addition, the bsddb module was deprecated in Python 2.6 and will be removed in 3.0
# So all this BDB stuff isn't useful, but does no harm
# linuxfromscratch.com has patch that can make python 2.7 work with BerkelyDB, if you need it
BDBVER=5.3.21
BDBVE=5.3
export LDFLAGS="-L$HOME/local/lib -L$HOME/local/BerkeleyDB.$BDBVE/lib"
# install pip & virtualenv
# create a virtual environment for your webapp
# install django in the new virtualenv
cd ~/tmp
PYVE=2.7
PYVER=2.7.3
STVER=0.6c11
# go directly to the source to get the latest and greatest
wget http://pypi.python.org/packages/$PYVE/s/setuptools/setuptools-$STVER-py$PYVE.egg#md5=fe1f997bc722265116870bc7919059ea
@nooodl
nooodl / futoshiki.lhs
Last active August 29, 2015 14:05
Literate Futoshiki solver
Introduction
============
Futoshiki (不等式, meaning “inequality”) is a Japanese logic puzzle similar to
Sudoku and the like. Numbers from 1 to n must be placed on an n-by-n grid
(which usually already contains some values) such that each row and each column
is a permutation of `[1..n]`. Additionally, less-than or greater-than signs are
placed between cells, constraining their mutual ordering.
An example puzzle looks like this:
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active July 18, 2024 07:33
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@moreati
moreati / .ssh_config
Last active April 16, 2023 01:40
Playing Guess Who with Ansible
Host rpi1
HostName raspberrypi1.local
User pi
Host rpi2
HostName raspberrypi2.local
User pi

Both things have been introduced recently, and let you access even private ec2 instances

  1. Without VPN
  2. No open SSH port
  3. Authentication / Authorization is fully delegated to IAM
# Assumes valid AWS Credentials in ENV
@betafcc
betafcc / mypy_operators.py
Created October 14, 2022 18:52
Mypy type-level operators
from __future__ import annotations
from typing import (
Any,
Awaitable,
Callable,
Iterable,
Literal,
Mapping,
ParamSpec,