Skip to content

Instantly share code, notes, and snippets.

View cemmurphy's full-sized avatar

Chris Murphy cemmurphy

View GitHub Profile
@thebluesnevrdie
thebluesnevrdie / gen-ssh-keys.py
Created September 20, 2023 01:11
Generate ed25515 OpenSSH keys with Python3 cryptography library
#! /usr/bin/env python3
from cryptography.hazmat.primitives.asymmetric import rsa, ed25519
from cryptography.hazmat.primitives import serialization, hashes
private_key = ed25519.Ed25519PrivateKey.generate()
public_key = private_key.public_key()
our_private = private_key.private_bytes(
encoding=serialization.Encoding.PEM,
@cemmurphy
cemmurphy / oracle-java.sls
Created May 28, 2014 06:25
Install Oracle Java 7 with Salt Stack on Debian or Ubuntu
# -*- coding: utf-8; mode:yaml; tab-width:2; indent-tabs-mode:nil; -*-
# vim: syntax=yaml ts=2 sw=2 sts=2 et si ai
#
# Install Oracle Java 7 with Salt Stack on Debian or Ubuntu
#
# References:
# https://gist.github.com/renoirb/6722890
# https://gist.github.com/pwistrand/8918193
# https://groups.google.com/forum/#!topic/salt-users/ynKNND9qxiI
@pwistrand
pwistrand / init.sls
Created February 10, 2014 15:45
Salt state for unassisted install of Java 7 that works with Debian
#
# How to install automatically Oracle Java 7 under Salt Stack for Debian
#
# References:
# https://gist.github.com/renoirb/6722890
# https://groups.google.com/forum/#!topic/salt-users/ynKNND9qxiI
# http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
#
python-apt:
pkg.latest
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@renoirb
renoirb / init.yml
Last active March 30, 2023 03:15
How to install Oracle Java from ppa webupd8team/java using Salt stack, in ONE state file
#
# How to install automatically Oracle Java 7 under Salt Stack
#
# Thanks Oracle for complicating things :(
#
# 1. Create a java/ folder in your salt master
# 2. Paste this file in init.sls
# 3. salt '*' state.sls java
#
# Source:
@willurd
willurd / web-servers.md
Last active April 26, 2024 18:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite