Skip to content

Instantly share code, notes, and snippets.

drmikecrowe

Block or report user

Report or block drmikecrowe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@drmikecrowe
drmikecrowe / template.sh
Last active Jan 15, 2019
Bash Template
View template.sh
#!/usr/bin/env bash
function mainScript() {
debug "Arguments: $args"
}
# Options and Usage
# -----------------------------------
function usage() {
@drmikecrowe
drmikecrowe / embed.js
Last active Jan 1, 2019
Embedding factualsearch.news in your website
View embed.js
<script>
(function() {
var cx = '011275290256739755566:cwfn9qhuqkk';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
View key-installs.sh
set -e
set -x
sudo apt-get update
sudo apt install git python2.7 build-essential python-virtualenv python-pip python-dev libcurl4-gnutls-dev libgnutls28-dev mysql-client awscli phantomjs
# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=stable
# Update the apt package index.
@drmikecrowe
drmikecrowe / bootstrap.sh
Last active Aug 14, 2019
Bash Bootstrap
View bootstrap.sh
#!/usr/bin/env bash
APT_PKGS=""
function install {
FILE="$2"
URL="$1/$FILE"
wget $URL -O $FILE
sudo gdebi $FILE
rm $FILE
View make.log
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.2b1
loading pickled environment... done
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 4 changed, 0 removed
reading sources... [ 25%] leo.core
reading sources... [ 50%] leo.external
reading sources... [ 75%] leo.external.concurrent.futures
reading sources... [100%] leo.plugins
Can not import path from plugin leo.plugins.at_view
@drmikecrowe
drmikecrowe / info.md
Created Jan 24, 2018
Linux Mint 18.3 Cinnamon desktop debug info
View info.md

$ cat /etc/lsb-release

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=sylvia
DISTRIB_DESCRIPTION="Linux Mint 18.3 Sylvia"

$ ps faux | grep cinnamon

mcrowe    1811  0.0  0.0 438712 22488 ?        Ssl  05:55   0:01      \_ cinnamon-session --session cinnamon
@drmikecrowe
drmikecrowe / search-aws-amis.sh
Created Oct 13, 2017
Search for the latest releases for a given search string. Assumes that vendors release in bulk, so it looks for over 2 images released in a day and shows those matches
View search-aws-amis.sh
#!/bin/bash
LINES=6
if [ $# -ne 1 ];then
echo "Usage:"
echo " $0 keyword"
exit 1
fi
@drmikecrowe
drmikecrowe / find_latest_ubuntu_amis.sh
Last active Oct 13, 2017 — forked from antimius/find_latest_ami.sh
Script to find and print the latest stable, Ubuntu version
View find_latest_ubuntu_amis.sh
#!/bin/bash
# prints latest, stable, HVM, EBS GP2 backed AMIs for major OSs
UBUNTU=099720109477
REGIONS="us-east-1 us-east-2 us-west-1 us-west-2"
for REGION in $REGIONS; do
echo -n "$REGION: "
aws ec2 describe-images --region=$REGION --owners $UBUNTU --filters 'Name=name,Values=*hvm-ssd*16.04*' --query 'Images[*].[ImageId,CreationDate,Name]' --output text | sort -k2 -r | head -n 1
View cron_helper.sh
#!/bin/bash
usage() {
cat << EOF
Usage: $0 [OPTION]... COMMAND
Execute the given command in a way that works safely with cron. This should
typically be used inside of a cron job definition like so:
* * * * * $(which "$0") [OPTION]... COMMAND
Arguments:
@drmikecrowe
drmikecrowe / Dockerfile
Created Jan 14, 2017
Working PHP Docker Compose System with PhantimJS testing
View Dockerfile
# Build using docker build -t php-drmikecrowe
FROM php:5.6-apache
MAINTAINER Emilien Kenler <hello@emilienkenler.com>
RUN apt-get update && apt-get install -y git libpq-dev libmcrypt-dev zlib1g-dev libicu-dev g++ graphviz && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install pdo_pgsql pdo_mysql mbstring mcrypt zip sockets intl bcmath mysqli
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar && \
You can’t perform that action at this time.