I hereby claim:
- I am crashgoboom on github.
- I am chriskindlyops (https://keybase.io/chriskindlyops) on keybase.
- I have a public key ASAdlzW_WEQVZ-2rQwqnnypvIWObjnNO3SbnQYEY_lE5kQo
To claim this, I am signing this object:
# Convert 4:3 aspect ratio files to 16:9 with black bars. For each m4v file convert and encode using crf 18. | |
for i in *.m4v; do ffmpeg -i "$i" -vf "scale=960x720,setsar=1,pad=1280:720:160:0" -crf 18 "${i%.m4v}.mp4"; done | |
# For normal conversion to mp4. | |
for i in *.m4v; do ffmpeg -i "$i" "${i%.m4v}.mp4"; done | |
# For mov to mp4 conversion with some compression. | |
for i in *.mov; do ffmpeg -i "$i" -crf 23 -vcodec libx264 -acodec aac "${i%.mov}.mp4"; done |
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer | |
# to fix this error "file_put_contents(./composer.json): failed to open stream: Permission denied" | |
# take ownership of the .composer folder. | |
sudo chown -R $USER ~/.composer | |
# next install laravel | |
composer global require "laravel/installer" |
I hereby claim:
To claim this, I am signing this object:
function get_help() { | |
cat <<help_message | |
--- script subcommand ------------------------------------------------------------- | |
Commands related to this script | |
USAGE: | |
script command shell [FLAGS] [SUBCOMMAND] |
# This will create a 5 second long mp4 file using the provided font, text and image with a fade in and out effect. | |
_dur=5 | |
_framerate=30 | |
_fontfile='/tmp/somefont.ttf' | |
_fontsize=30 | |
_fontcolor='white' | |
_text='Sample Bumper Video' | |
_background_color='black' | |
_drawtext="fontfile=${_fontfile}:fontsize=${_fontsize}" | |
_fade="fade=in:0:25,fade=out:50:60" |
# The action we want to test | |
_action="s3:GetObject" | |
# The JSON you want to convert to a string | |
_json_to_convert='{ "Version": "2012-10-17","Statement": [{"Effect": "Allow","Action": "*","Resource": "*"}]}' | |
# Your resource arn goes here | |
_resource_arn="arn:aws:s3:::${_some_s3_bucket}/${_some_prefix}/*" | |
# This command will format the json policy as a string for the cli to use | |
# echo ${_json_to_convert} | jq '[.|tostring]' | |
# But we will send it to a fifo with '<()' instead of creating a json file every time |
declare -r SOME_JSON_FILE="/path/to/json/file.json" | |
# Read a key from a file. | |
# Usage: _key_value=$(_read_json_key "key") | |
function _read_json_key() { | |
local -r _key="${1}" | |
jq --arg key "${_key}" -r '.[$key]' "${SOME_JSON_FILE}" | |
} | |
# Writes a json key into an existing file without overwriting. |
_video_file="${1}" | |
ffmpeg -i $_video_file -vf palettegen pal.png | |
ffmpeg -i $_video_file -i pal.png -lavfi paletteuse=bayer_scale=4:dither=bayer -r 18 video.gif |
#!/bin/bash | |
# Usage: ./ssm_local.sh i-xxxxxxxxxx 80 | |
_instance_id="${1}" | |
_instance_port="${2}" | |
aws ssm start-session --target "${_instance_id}" \ | |
--document-name AWS-StartPortForwardingSession \ | |
--parameters "{\"portNumber\":[\"${_instance_port}\"],\"localPortNumber\":[\"9000\"]}" |
#!/bin/bash | |
# Usage: ./get_bucket_byprefix.sh "someprefix" | |
_prefix="${1}" | |
aws s3api list-buckets --query "Buckets[?starts_with(Name,'${_prefix}')].Name |