Skip to content

Instantly share code, notes, and snippets.

View adamancini's full-sized avatar

ada mancini adamancini

View GitHub Profile
@adamancini
adamancini / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/sh
#
set -ex
TEMP_DIR="$(mktemp -d -t XXXX)"
# cleanup
trap 'RESULT=$?; rm -rf "$TEMP_DIR" ; exit $RESULT' INT TERM EXIT QUIT
OLD_PWD="$PWD"
cd "$TEMP_DIR"
@adamancini
adamancini / cron_helper.sh
Created October 17, 2015 08:34 — forked from liquidgecka/cron_helper.sh
Cron helper
#!/bin/bash
usage() {
cat << EOF
Usage: $0 [OPTION]... COMMAND
Execute the given command in a way that works safely with cron. This should
typically be used inside of a cron job definition like so:
* * * * * $(which "$0") [OPTION]... COMMAND
Arguments:
@adamancini
adamancini / Vagrantfile-puppet-ubuntu-multi
Created November 14, 2015 03:47 — forked from frozenfoxx/Vagrantfile-puppet-ubuntu-multi
A simple Vagrantfile for spinning up a master-agent pair.
Vagrant.require_version ">= 1.5.0"
require 'vagrant-hosts'
require 'vagrant-auto_network'
Vagrant.configure('2') do |config|
config.vm.define :puppetmaster do |node|
# An index of pre-built boxes can be found at:
#
# https://vagrantcloud.com/puppetlabs
class phr_test (
$vertex_dir = '/usr/vertex',
)
{
}
class phr_unidata (
$vertex2_dir = $phr_test::vertex_dir,
)
{
}
RUN apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A \
&& sed -i '/repo.percona.com/d' /etc/apt/sources.list \
&& sh -c 'echo "deb http://repo.percona.com/apt precise main" >> /etc/apt/sources.list' \
&& sh -c 'echo "deb-src http://repo.percona.com/apt precise main" >> /etc/apt/sources.list' \
&& apt-get -q -y update
&& apt-get -o Dpkg::Options::='--force-confnew' -qqy install \
nano \
wget \
psmisc \
libdbi-perl \
version: '2'
services:
wekandb:
image: mongo:3.2.16
container_name: wekan-db
restart: always
command: mongod --smallfiles --oplogSize 128
networks:
@adamancini
adamancini / readme.md
Created November 9, 2017 01:07 — forked from anonymous/readme.md
extract images from DTR with oss registry

Sometimes it may be necessary to extract the images from a DTR volume backup. In the absence of a functioning DTR cluster, it's possible to extract these images using the open-source registry image.

First, identify the registry volume that needs to be extracted:

root@dtr-node1:~# docker volume ls --filter=name=dtr
DRIVER              VOLUME NAME
local               dtr-ca-a2382528a00b
local               dtr-postgres-a2382528a00b
local dtr-registry-a2382528a00b
#!/bin/bash
#run anywhere with curl and jq installed.
# 11/17 - [email protected]
set -e
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
password=Pa22word
@adamancini
adamancini / Arch Linux, Fedora
Created April 26, 2018 18:34 — forked from elvetemedve/Arch Linux, Fedora
Allow Vagrant usage without providing sudo password
sudo tee /etc/sudoers.d/vagrant > /dev/null << EOL
#
# Arch Linux, Fedora sudoers entries
#
# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /usr/bin/sed -i -e /*/ d /etc/hosts
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE