Skip to content

Instantly share code, notes, and snippets.

View burdandrei's full-sized avatar
👻

Andrei Burd burdandrei

👻
View GitHub Profile
@burdandrei
burdandrei / starprint.sh
Last active August 29, 2015 14:22
Do you love to to read scripts outputs as I do? Print these messages with stars around!
#!/usr/bin/env bash
#
# Just echo everything with Stars Around
starprint(){
local INPUT=$*
local LENGTH=$(echo "$INPUT" | awk '{print length+4}')
line() { for i in $(eval echo "{1..$LENGTH}"); do echo -n '*'; done; echo; }
line
echo -n "* "; echo -n $INPUT;echo -n " *";echo
@burdandrei
burdandrei / gemcheck.sh
Created April 15, 2015 11:46
Check that you got all the gems needed to trigger the ruby script
#!/bin/bash -e
#
# Wrapper to check all the needed gems are installed
GL=$(gem list)
for gem in $(cat Gemfile | grep -w gem | cut -f2 -d ' '| tr -d "'"); do
if ! $(echo $GL | grep -wq $gem); then
gem install bundler
bundle install
break
@burdandrei
burdandrei / bitnami_backup
Created March 10, 2015 14:49
Simple script to back up your bitnami app to s3
#!/bin/bash
#
# Script for backing up bitnami app and upload tarballs to S3
set -e
usage(){
echo "Usage: BITNAMI_APP=<> BITNAMI_DB_PASSWORD=<> S3_BUCKET=<> $0"
exit 1
}