Skip to content

Instantly share code, notes, and snippets.

View romanr's full-sized avatar
😶

Roman Roan romanr

😶
View GitHub Profile
@romanr
romanr / zshenv
Last active March 27, 2024 12:38 — forked from Linerre/Setting $PATH for zsh on macOS.md
Properly setting $PATH for zsh on macOS (fighting with path_helper)
# zshenv path_helper issue script.
# Source: https://gist.github.com/romanr/2c5ee2eafc284a2530cdb6b8d64d929c
# Based on https://gist.github.com/Linerre/f11ad4a6a934dcf01ee8415c9457e7b2
#
# if [ -f "/etc/zprofile" ] && grep -q "path_helper" "/etc/zprofile"; then
# echo "WARNING: 'path_helper' in '/etc/zprofile', please remove it." >&2
# echo "Path helper 'path_helper' will execute after the one in this '~/.zshenv' file and" >&2
# echo "potentially reorder paths." >&2
# fi
unsetopt GLOBAL_RCS
@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

@moodysalem
moodysalem / swapfile.config
Last active March 21, 2017 13:32
ebextensions swapfile creation script ec2 swap
commands:
000_dd:
test: test ! -e /swapfile
command: dd if=/dev/zero of=/swapfile bs=1M count=2048 && chmod 600 /swapfile
001_mkswap:
command: mkswap /swapfile
ignoreErrors: true
002_swapon:
command: swapon /swapfile
ignoreErrors: true
@jrmehle
jrmehle / db_backup.sh
Last active September 20, 2017 23:23 — forked from bendavis78/db_backup.sh
A simple database backup / rotation / prune script
#!/bin/bash
# for use with cron, eg:
# 0 3 * * * postgres /var/db/db_backup.sh foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
exit 1
fi
@vsviridov
vsviridov / 01_add_cors.config.yaml
Created September 5, 2015 05:45
Add CORS to Nginx on AWS Elastic Beanstalk
container_commands:
01_fix_static_cors:
command: "/tmp/fix_static_cors.sh"
files:
"/tmp/fix_static_cors.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
@kamermans
kamermans / docker_ephemeral_create.sh
Last active September 13, 2024 07:15
AWS EC2 script to mount Instance Store 0 and 1 as Docker temp and volume storage
#!/bin/sh -e
# This script will DESTROY /dev/xvdb and /dev/xvdc and remount them
# for Docker temp and volume storage.
# It is intended for EC2 instances with 2 ephemeral SSD instance stores
# like the c3.xlarge instance type.
service docker stop || true
# Setup Instance Store 0 for Docker Temp
# (set in /etc/default/docker)
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@gschora
gschora / configure_apcupsd
Last active November 3, 2024 14:10
configuring apcupsd to suspend all running VM and then shutdown the esxi 5.5 u1 host
###############################################################################################################
# these are instructions for automating the suspend and shutdown of esxi vm's and host in case of a
# power failure.
# works with apc smartups 750xl and esxi 5.5u1
###############################################################################################################
0# make a new VM and install Ubuntu-Server on it
1# install apcupsd
apt-get install apcupsd
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active December 20, 2024 19:57
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k