Skip to content

Instantly share code, notes, and snippets.

View jamost's full-sized avatar

James Osterhout jamost

  • Gainesville, FL
View GitHub Profile
@lennardv2
lennardv2 / 1. Building PHP-MAMP on Apple Silicon M1.md
Last active February 25, 2025 15:28
Native PHP development / MAMP stack on Apple silicon M1

Building the MAMP stack (php, apache & mysql) on Apple Silicon ARM (native)

Update! This tutorial is outdated. Nowadays brew installes m1 binaries just fine. Also use valet: https://laravel.com/docs/9.x/valet. It's 10x easier.

In this tutorial, we'll build the the nescessary packages for ARM via homebrew. After that we'll configure apache2 for using virtual hosts. The native php is ofcourse way faster, see the results of this benchmark below.

TEST NAME SECONDS OP/SEC
@dobesv
dobesv / dev_signed_cert.sh
Last active November 9, 2025 02:36
Script to create (1) a local certificate authority, (2) a host certificate signed by that authority for the hostname of your choice
#!/usr/bin/env bash
#
# Usage: dev_signed_cert.sh HOSTNAME
#
# Creates a CA cert and then generates an SSL certificate signed by that CA for the
# given hostname.
#
# After running this, add the generated dev_cert_ca.cert.pem to the trusted root
# authorities in your browser / client system.
#
@ethicka
ethicka / localhost-ssl-certificate.md
Last active December 4, 2025 07:14
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@friartuck6000
friartuck6000 / getwp
Last active August 29, 2015 13:58
Install any version of WordPress with a single command
#!/bin/bash
# USAGE:
# getwp [-v version] dest
# Help screen
function usage()
{
echo
echo "getwp -- Made with <3 by @friartuck6000"
@sl-digital
sl-digital / Amazon-Linux-AMI PHP55
Last active May 24, 2021 11:03
Install Apache, MySQL and PHP 5.5 on Amazon Linux AMI
:: UPDATE YUM ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum update -y
:: INSTALL WEBSERVER :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum install httpd24
sudo service httpd start
sudo chkconfig httpd on
chkconfig --list httpd
#!/bin/bash
# Red Bull for Hard Drives
# ------------------------------------------------------------------------
# Run this script once to keep your mounted Time Machine or other external
# hard drive(s) from falling asleep and making your system hang every time
# the drive wakes up.
#
# Usage:
# 1. Be sure to chmod +x this file before trying to execute it.
@friartuck6000
friartuck6000 / theme.js
Created October 10, 2013 16:23
jQuery wrappers for WordPress friendliness
(function($) {
// Write plugins
})(jQuery);
jQuery(document).ready(function($) {
// Call plugins and do other stuff
});
@friartuck6000
friartuck6000 / fluidAffix.js
Last active December 19, 2015 15:39
Make sidebars using Bootstrap's affix play nicely with responsive designs
$.fn.fluidAffix = function(opts){
return this.each(function(){
var $this = $(this);
var $parent = $this.parent();
// Match width of parent container
$this.css('width', $parent.width()+'px');
@kbl
kbl / import.py
Last active September 24, 2023 21:10
importing tasks/lists from wunderlist into todoist
# -*- coding: utf8 -*-
import json
import urllib2
import urllib
import sys
import os
from argparse import ArgumentParser
from collections import defaultdict