Skip to content

Instantly share code, notes, and snippets.

View schie's full-sized avatar
:octocat:
doing stuff

Dustin Schie schie

:octocat:
doing stuff
View GitHub Profile
@sjlu
sjlu / Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js.md
Last active September 12, 2023 08:56
Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js

This file is a log of everything I've encountered when trying to migrate a Node.js, Elastic Beanstalk application from the Amazon Linux platform to the Amazon Liunx 2 platform. Here's why you should migrate:

  1. LTS support up to 2023 source
  2. The Amazon Linux AMI's end-of-life is December, 2020 source
  3. Amazon Linux 2 has some big package upgrades (GCC, Glibc, etc.)
  4. Elastic Beanstalk also has some upgrades on top of Amazon Linux 2 (e.g. faster deploys)

Challenges

Disabling NPM install

@kstolte
kstolte / AzureAlert2SlackWebTask.js
Created January 29, 2018 19:06
Webtask to have an Azure Alert be sent to a Slack Channel
var request = require('request');
module.exports = function (context, done) {
var recBody = context.body;
var rContext = recBody.context;
var rCondition = rContext.condition;
var icon = recBody.status === 'Activated' ? ':open_mouth:': ':party_parrot:';
var outText = `${rContext.resourceName} - ${rContext.name} - ${recBody.status} <${rContext.portalLink}|Click Here>
Condition: ${rCondition.metricName} ${rCondition.operator} ${rCondition.threshold} (${rCondition.metricUnit}) in the last ${rCondition.windowSize} minutes
@mattantonelli
mattantonelli / good_commit_messages.md
Last active May 31, 2024 14:20
A Guide to Good Commit Messages

Good Commit Messages

A good commit message helps both you and your collaborators better understand your code. A series of good messages will create a well-documented history as your code evolves. This also makes it easier for someone to pick up where you left off.

Jump to:

  1. Summary
  2. Description
  3. Full message
  4. Branch
@mattantonelli
mattantonelli / ng-resource-boolean-response.js
Last active May 19, 2016 15:27
Transform ng-resource response that just returns a boolean
.factory('ForgotUsername', function($resource, API_BASE) {
return $resource(API_BASE + 'forgetUserID', {}, {
get: {
method: 'GET',
transformResponse: function(data, headers) {
return { Result: data === true };
}
}
});
})
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mattantonelli
mattantonelli / breakdown_repos.rb
Created March 4, 2016 19:16
Identifies the owners of all of a Github organization's private repos based on initial commits.
#!/usr/bin/env ruby
# encoding: utf-8
#
# Usage: ruby breakdown_repos.rb > repos.csv
#
require 'github_api'
BASIC_AUTH = 'username:personalaccesstoken'
ORG = 'myOrg'
@mattantonelli
mattantonelli / copy_backups.sh
Last active November 30, 2021 13:58
Copies backups from automysqlbackup to a remote host. Retains 1 weekly and 7 daily backups per database.
#!/usr/bin/env bash
#
# Purpose:
# Maintains 7 daily and 1 weekly database backups on a remote server.
#
# Configuration:
# Subdirectories must be created on the remote server for each database.
# (This includes status & fullschema directories if applicable.)
#
# Examples:
@shark0der
shark0der / ubuntu14.04-command-line-install-android-sdk
Last active March 7, 2021 15:09 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk (platform & platform-tools only, no emulator)
# install java
apt-get install -y software-properties-common
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# download latest android sdk
# http://developer.android.com/sdk/index.html#Other
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
@mattantonelli
mattantonelli / numeric_regex.rb
Last active May 31, 2024 14:16
Regular expressions for numeric strings. #regex
# ALL THESE REQUIRE THE WHOLE STRING TO BE A NUMBER
#### NUMBERS AND DECIMALS ONLY ####
# No commas allowed
# Pass: (1000.0), (001), (.001)
# Fail: (1,000.0)
^\d*\.?\d+$
# No commas allowed
# Can't start with "."
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active July 4, 2024 05:29
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages