Skip to content

Instantly share code, notes, and snippets.

@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active July 24, 2024 09:32
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@alexarje
alexarje / mxf-folder2mp4.sh
Last active May 3, 2023 15:35
Convert a folder of MXF files to one MP4 file with FFmpeg
#!/bin/bash
# Script for converting a folder of MXF video files to different to a single MP4 file.
# Alexander Refsum Jensenius, RITMO, University of Oslo
# v0.1 2019-11-03
# Find and move all MXF files to the "root" (where the script is run from)
find . -name "*.MXF" -exec mv {} . ";"
# Create list of files to be used for concatenation
@brianleroux
brianleroux / BeforeExitListener.js
Created September 12, 2019 22:04
Lambda NodeJS 10.x Default Runtime JavaScript
/** Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
"use strict";
/**
* The runtime has a single beforeExit function which is stored in the global
* object with a symbol key.
* The symbol is not exported.
* The process.beforeExit listener is setup in index.js along with all other
* top-level process event listeners.
*/
@TimothyJones
TimothyJones / getDecryptedEnv.js
Last active September 4, 2022 04:38
A javascript module that demonstrates decrypting some KMS-encrypted environment variables
const AWS = require('aws-sdk');
const encryptedEnvironmentVariableNames = ['SOME_VARIABLE', 'SOME_OTHER_VARIABLE'];
// This module exports a function that returns a promise for obtaining
// a decrypted copy of the environnment.
//
// Configure it by putting the name of each environment variable you would like to
// decrypt above.
//
@TimothyJones
TimothyJones / getSsmConfig.js
Created August 28, 2019 04:44
Example showing a promisified SSM config reader for SecureString parameters
const AWS = require('aws-sdk');
const ssm = new AWS.SSM();
const configFeatures = {
'/path/to/your/config/option': 'someOption',
'/path/to/your/config/something_else': 'somethingElse'
};
const getConfig = () =>
@pahud
pahud / create-job.sh
Last active September 8, 2021 18:27
AWS CLI sample for Elemental MediaConvert create-job actions
#!/bin/bash
#
# Usage: bash create-job.sh S3_INPUT_VIDEO_FILE_PATH
# e.g. bash create-job.sh s3://your-s3-bucket/your-input-video.mov
input=$1
basename=$(basename $input)
newbasename="${basename%%.*}-H264-AAC.mp4"
output="$(dirname $input)/$newbasename"
@lodestone
lodestone / HOWTO-Dissassociate-Xcode-From-All-File-Types.md
Created February 15, 2019 20:06
HOWTO: Dissassociate/Unassociate Xcode from ALL file types in one fell swoop!

HOWTO: Disassociate/Unassociate File Types From a Mac App

I got super tired of Xcode opening everything: .rb, .sh, etc etc etc....

Here is how to stop Xcode from opening everything!

NOTE: It may be helpful to know that I found the lsregister command right here:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister
@thommyhh
thommyhh / composer.sh
Last active March 24, 2022 16:00
A script to easily run composer through docker to provide a defined environment
#!/bin/sh
# This script is meant to be user with docker images from https://hub.docker.com/r/webcoastdk/composer/tags
#
# It mounts the current working directory into /build in the container and calls the given command.
# Additionally the current users `.ssh` and `.composer` directory are also mounted to give access to composer cache
# and SSH known hosts
#
# On hosts with MacOS the SSH agent is started inside the container, as it is currently not possible to mount the SSH
# authentication agent socket into the container.
# On other hosts (mainly Linux) the current `$SSH_AUTH_SOCK` is mounted to `/ssh-agent` and the environment variable
@duckythescientist
duckythescientist / lololps1.bash
Last active October 11, 2023 04:13
Rainbow colored bash prompt PS1 string
# https://stackoverflow.com/a/52465819
function readline_ANSI_escape() {
if [[ $# -ge 1 ]]; then
echo "$*"
else
cat # Read string from STDIN
fi | \
perl -pe 's/(?:(?<!\x1)|(?<!\\\[))(\x1b\[[0-9;]*[mG])(?!\x2|\\\])/\x1\1\x2/g'
}
@catalinbostan
catalinbostan / clear-net-ports.sh
Created September 8, 2017 11:10
Clears out port collisions for VMWare guests in Vagrant env.
#!/bin/bash
##
# Show the user what we're looking to remove from the network configs.
##
printf "\nWe've located the following entries matching the associated port argument. \n"
grep "add_nat_portfwd" /Library/Preferences/VMware\ Fusion/networking | grep $1
grep $1 /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf
##