Skip to content

Instantly share code, notes, and snippets.

View kljensen's full-sized avatar
😵‍💫
0101010101

Kyle L. Jensen kljensen

😵‍💫
0101010101
View GitHub Profile
@dansimau
dansimau / .gitignore
Created May 20, 2012 23:52 — forked from urschrei/mkflask.sh
Bootstrap a Flask project on Ubuntu Precise, with Puppet, Vagrant and Fabric. (For latest version, see https://github.com/dansimau/flask-bootstrap)
*~
*.pyc
.vagrant
venv
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active February 26, 2025 10:52
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ndarville
ndarville / business-models.md
Last active February 27, 2025 10:00
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@urschrei
urschrei / parseml.py
Last active January 15, 2025 09:57
Extract attachments from EML files in the current dir, and write them to the output subdir
#!/usr/bin/env python
"""
2020 update:
- More iterators, fewer lists
- Python 3 compatible
- Processes files in parallel
(one thread per CPU, but that's not really how it works)
"""
@lennym
lennym / index.js
Created March 25, 2014 13:21
Programmatic/dynamic Mocha test construction
var Mocha = require('mocha'),
expect = require('chai').expect;
var mocha = new Mocha({
reporter: 'spec'
});
var dashboards = Mocha.Suite.create(mocha.suite, 'dashboards');
var subsuite = Mocha.Suite.create(dashboards, 'something');
The Yale VPN uses Cisco AnyConnect.
If Cisco's Linux client works for you, congratulations.
If, like me, the official client leaves you stranded, then you need to install
OpenConnect and (assuming you are using Network Manager) the appropriate add-on for the NM applet.
On a Debian-based system, you can type the following command:
$ sudo apt-get install openconnect network-manager-openconnect network-manager-openconnect-gnome
@williamledoux
williamledoux / gist:d79d2a2d4873d157047b
Last active February 5, 2016 00:20
How to create files in a meteor application from a meteor package

How to create files in a meteor application from a meteor package

The goal is to create or generate some files in the user's app directory, so that he can make some uses of it. For instance, provide LESS files that uses end-user's LESS variables (eg. the user's custom bootstrap theme).

This gist is just explaining the method Marco Pfeiffer has found to make its (awesome) highly configurable LESS boostrap package.

How to create some files

In order to create some file in the user's app workspace, you need to create a build plugin with the registerBuildPlugin API. Then you need to get it called at least once during build. This is done by registering a sourceHandler on some file extension. Your build plugin we get called once per file matching the extension. For now only one build plugin can register as a handler for a given extension

@JCotton1123
JCotton1123 / simplerelay.py
Last active August 8, 2024 13:34
Start of simple SMTP relay service in Python
#!/usr/bin/env python
import os
import re
import daemon
import asyncore
import smtpd
class SimpleRelayService(smtpd.PureProxy):
"""Handles processing mail for relay"""
@syedrakib
syedrakib / RSA_example.py
Last active June 21, 2024 19:48
An example of asymmetric encryption in python using a public/private keypair - utilizes RSA from PyCrypto library
# Inspired from http://coding4streetcred.com/blog/post/Asymmetric-Encryption-Revisited-(in-PyCrypto)
# PyCrypto docs available at https://www.dlitz.net/software/pycrypto/api/2.6/
from Crypto import Random
from Crypto.PublicKey import RSA
import base64
def generate_keys():
# RSA modulus length must be a multiple of 256 and >= 1024
modulus_length = 256*4 # use larger value in production
@northox
northox / iked.conf
Last active December 21, 2024 02:19
OpenBSD's OpenIKEd roadwarrior VPN config for Ipad and such
ikev2 "inet" passive ipcomp esp \
from 0.0.0.0/0 to 10.0.1.0/24 \
from 10.0.0.0/24 to 10.0.1.0/24 \
local egress peer any \
srcid egress \
psk "strong-password" \
config protected-subnet 0.0.0.0/0 \
config address 10.0.1.0/24 \
config name-server 10.0.0.1 \
tag IKED