Skip to content

Instantly share code, notes, and snippets.

View relaxdiego's full-sized avatar
🤓

Mark Maglana relaxdiego

🤓
  • The Linux Foundation
  • Earth, Solar System, Milky Way, Laniakea
View GitHub Profile
#
# Installation:
# mkdir -p ~/.byobu
# wget -O ~/.byobu/keybindings.tmux byobu.relaxdiego.com
# tmux source-file ~/.byobu/keybindings.tmux
#
# Rebind Ctrl-a as the prefix
unbind-key -n C-a
set -g prefix ^A
@relaxdiego
relaxdiego / README.md
Created March 23, 2017 17:58 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@relaxdiego
relaxdiego / upload-github-release-asset.sh
Created July 4, 2017 18:22 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
# * repo
@relaxdiego
relaxdiego / graphite.md
Last active January 5, 2022 09:07 — forked from surjikal/graphite.md
Installing Graphite in OS X Mavericks

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

@relaxdiego
relaxdiego / install-tmux
Last active December 7, 2021 16:09 — forked from rothgar/install-tmux
Install tmux 2.2 on CentOS 7.1
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
make
sudo make install
#!/usr/bin/env bash
#
# Usage: ./yaml-to-json.sh | jq .
#
file=$1
if ! pip show pyyaml >/dev/null; then
echo "PyYAML needs to be installed"
@relaxdiego
relaxdiego / secure-ssh-to-aws-instance.sh
Last active December 2, 2020 06:27
If you can't be bothered to implement cert-based SSH...
#!/usr/bin/env bash
ip_address=$(
aws ec2 describe-instances --instance-id $instance_id | \
jq -r ".Reservations[] | .Instances[] | select(.InstanceId==\"$instance_id\") | .PublicIpAddress"
)
if ! grep $ip_address ~/.ssh/known_hosts >/dev/null; then
# Print the SSH fingerprints for jumpbox
echo "Valid server key fingerprints:"
aws ec2 get-console-output --instance-id $instance_id | \
cd /tmp
curl -O -L http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz && tar xvzf sshpass-1.06.tar.gz
cd sshpass-1.06
./configure
sudo make install
@relaxdiego
relaxdiego / sshpass.rb
Created September 3, 2020 09:35 — forked from lalyos/sshpass.rb
brew install sshpass
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c3f78752a68a0c3f62efb3332cceea0c8a1f04f7cf6b46e00ec0c3000bc8483e'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
#!/bin/bash -e
bundle_name=${1:-'charmed-kubernetes'}
channel=${2:-'stable'}
architecture=${3:-'amd64'}
mkdir -p /tmp/${bundle_name}
cd /tmp/${bundle_name}
echo "Downloading ${bundle_name} metadata..."
curl "https://api.jujucharms.com/charmstore/v5/meta/bundle-metadata?id=${bundle_name}&channel=${channel}" > ${bundle_name}.json