Skip to content

Instantly share code, notes, and snippets.

@billsinc
billsinc / gist:1157544
Created August 19, 2011 18:10
Remove Firebird DB from MacOS
#!/bin/sh
echo "Clean Services"
echo "Clean User"
dscl localhost -delete /Local/Default/Users/firebird
echo "Clean Group"
dscl localhost -delete /Local/Default/Groups/firebird
if [ -f "/Library/StartupItems/Firebird" ]; then
echo "Remove SuperServer StartupItem"
rm -fr /Library/StartupItems/Firebird
fi
<?php
/**
* Assumes https://github.com/Spomky-Labs/jose library is installed and autoloading is set up
* Decode and verify token guide: https://github.com/Spomky-Labs/jose/blob/master/doc/operation/Verify.md
*/
use Jose\Factory\JWKFactory;
use Jose\Loader;
// We load the key set from a URL
// JSON Key URL (JKU) - https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json.
@billsinc
billsinc / gist:4665346
Last active December 4, 2019 15:06
Find Largest Files/Directories on Linux System
# 10 Largest Files
find . -type f -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}
MIME-Version: 1.0
Received: by 10.220.191.194 with HTTP; Wed, 11 May 2011 12:27:12 -0700 (PDT)
Date: Wed, 11 May 2011 13:27:12 -0600
Delivered-To: jncjkq@gmail.com
Message-ID: <BANLkTi=JCQO1h3ET-pT_PLEHejhSSYxTZw@mail.jncjkq.com>
Subject: Test
From: Bill Jncjkq <jncjkq@gmail.com>
To: bookmarks@jncjkq.net
Content-Type: multipart/mixed; boundary=bcaec54eecc63acce904a3050f79
@billsinc
billsinc / catcher.php
Created May 11, 2011 22:48
Parse emails with attachments
#!/usr/bin/php
<?php
//debug
#ini_set ("display_errors", "1");
#error_reporting(E_ALL);
//include email parser
require_once('/var/www/rfc822_addresses.php');
require_once('/var/www/mime_parser.php');
@billsinc
billsinc / docker-compose.yml
Last active August 9, 2017 21:12 — forked from amir-rahnama/docker-compose.yml
OSRM Docker-Compose file for a Stack with OSRM and Nominatim (Data container included)
osrm:
command: './start.sh Colorado http://download.geofabrik.de/north-america/us/colorado-latest.osm.pbf'
image: 'irony/osrm5:latest'
ports:
- '5000:5000'
volumes_from:
- osrm-data
osrm-data:
image: 'irony/osrm5:latest'
volumes:
@billsinc
billsinc / AWS_Single_LetsEncrypt.yaml
Created June 29, 2017 21:38 — forked from tony-gutierrez/AWS_Single_LetsEncrypt.yaml
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@billsinc
billsinc / 0_reuse_code.js
Created November 2, 2016 18:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@billsinc
billsinc / gist:7979188
Created December 15, 2013 22:28
Ruby format US phone number with area code
validates :phone_number, format: { with: /\d{3}-\d{3}-\d{4}/, message: "bad format" }
@billsinc
billsinc / .gitignore
Created October 14, 2011 01:55 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your