Skip to content

Instantly share code, notes, and snippets.

View ericwastaken's full-sized avatar

Eric Soto ericwastaken

View GitHub Profile
@ericwastaken
ericwastaken / DockerCheatSheet.md
Last active July 10, 2023 19:58
A Docker / Docker Compose Cheat Sheet

Docker / Docker Compose Cheat Sheet

Docker

Add this to Dockerfile to add aliases of your choice (works for images that have /bin/bash)

# Add alias to user profile
RUN echo "alias ll='ls -la'" >> /root/.bashrc
@ericwastaken
ericwastaken / How-to-load-an-environment-file-in-bash.md
Last active April 16, 2022 06:09
An example Bash script that reads variables from an environment file

An example Bash script that reads variables from an environment file

This will load variables into a BASH SCRIPT from an environment file.

Create an environment file with the following structure. Call it "secrets.env" but it can be called anything!

MY_SECRET="Some Secret"
@ericwastaken
ericwastaken / dump-query-template.env
Last active April 16, 2022 06:07
Shell script interface for Elasticsearch Dump
# Pass headers into Elasticsearch:
# - Authorization can be used to pass BASIC AUTH with a TOKEN. Use
# a tool of your choice to convert your username/password into
# the proper token for basic auth.
ED_HEADERS='{"Authorization": "Basic YOUR-BASIC-AUTH-TOKEN-HERE"}'
# Host must end in "/"
# Include ":port-number" if necessary (otherwise, 443 is inferred by https)
ED_HOST="https://your-host.com:port-number/"
@bubbobne
bubbobne / geometry_geojson.yaml
Last active November 2, 2023 19:08
A #swagger #geojson geometry description
#MIT License
#
#Copyright (c) 2017 Daniele Andreis
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
input {
file {
path => "/var/log/nginx/access.log"
type => "nginx-access"
sincedb_path => "/var/log/.nginxaccesssincedb"
}
}
input {
file {
path => "/var/log/nginx/error.log"
@matt-curtis
matt-curtis / NumberPadDoneBtn.h
Last active December 31, 2020 14:29
Done Button for UIKeyboard NumberPad (must be set as inputAccessoryView)
#import <UIKit/UIKit.h>
@interface NumberPadDoneBtn : UIView
@end
@interface NumberPadButton : UIButton
@end
@srikat
srikat / functions.php
Last active October 14, 2017 21:47
Force excerpts in Search results page regardless of Content Archives themes settings in Genesis
add_action( 'genesis_before_loop', 'sk_excerpts_search_page' );
function sk_excerpts_search_page() {
if ( is_search() ) {
add_filter( 'genesis_pre_get_option_content_archive', 'sk_show_excerpts' );
}
}
function sk_show_excerpts() {
return 'excerpts';
}
@clayton
clayton / ffmpeg-install.sh
Created August 9, 2013 18:55
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm