Skip to content

Instantly share code, notes, and snippets.

View ervinb's full-sized avatar

Ervin Barta ervinb

View GitHub Profile
@ervinb
ervinb / vim-bash-256-colors.md
Last active August 29, 2015 14:07
Vim 256 color mode in Bash

Requirements

  • Install sudo apt-get install ncurses-term

Config files


~/.vimrc

@ervinb
ervinb / debugger-fix.md
Last active August 29, 2015 14:10
Fix debugger installation for any Ruby patchlevel

Use the debugger gem with unsupported Ruby versions

  • replace the version of debugger-ruby_core_source in the path below, with the one you're using
gem install minitar
gem install debugger-ruby_core_source // or install it with bundler
cd ~/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/debugger-ruby_core_source-1.3.7 && rake add_source VERSION=2.0.0-p598 && cd -
@ervinb
ervinb / w7_usb_ubuntu.md
Last active August 29, 2015 14:13
Bootable Windows 7 USB Stick from Ubuntu

Install required packages

sudo apt-get install gparted ntfs-3g

Create the bootable USB stick

GParted

  • format the USB drive with GParted to NTFS
  • while still in GParted, right click on the newly formatted volume
@ervinb
ervinb / phantomjs2.sh
Last active August 29, 2015 14:18
phantomjs2-semaphore
if ! [ -e .semaphore-cache/phantomjs-2.0-semaphore.tar.bz2 ]; then (cd .semaphore-cache; curl -OL https://s3-us-west-2.amazonaws.com/container-libraries/phantomjs-2.0-semaphore.tar.bz2); fi
sudo tar -xjf .semaphore-cache/phantomjs-2.0-semaphore.tar.bz2 -C /usr/local/
sudo ln -fs /usr/local/phantomjs-2.0-semaphore/bin/phantomjs /usr/local/bin/phantomjs
echo ">> PhantomJS is on version `phantomjs -v`"
@ervinb
ervinb / android_semaphore.md
Last active August 29, 2015 14:18
Android Support on Semaphore

Installing the required libraries for Android SDK on Semaphore

sudo apt-get install -yqq libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5

wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz && tar xf android-sdk_r24.0.2-linux.tgz && rm -f android-sdk_r24.0.2-linux.tgz

export ANDROID_HOME="~/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
@ervinb
ervinb / es.sh
Last active August 29, 2015 14:19
Upgrade Elasticsearch
sudo service elasticsearch stop && wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.6.0.deb && echo Y | sudo dpkg -i elasticsearch-1.6.0.deb && sudo service elasticsearch start
@ervinb
ervinb / redis2.8.sh
Last active August 29, 2015 14:19
Install Redis 2.8.19
sudo service redis-server stop
echo ">>> Redis service stopped"
if ! [ -e .semaphore-cache/redis-2.8.tar.gz ]; then (cd .semaphore-cache; curl -OL https://s3-us-west-2.amazonaws.com/container-libraries/redis-2.8.tar.gz); fi
echo ">>> Different Redis version downloaded"
tar xf .semaphore-cache/redis-2.8.tar.gz -C /home/runner
/home/runner/redis-2.8.19/src/redis-server &
sleep 3
@ervinb
ervinb / create-sample-files.sh
Last active August 29, 2015 14:21
Creates N sample files of defined size
#! /bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 2 ] || die "2 arguments required -- <file count> <size>, only $# provided!"
echo $1 | grep -E -q '^[0-9]+$' || die "Numeric argument required, $1 provided!"
echo $2 | grep -E -q '^[0-9]+M|K$' || die "Define the size as <number>M|K, $2 provided!"
#!/bin/sh
# install dependencies
sudo apt-get install -yqq libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
# download and unpack Android SDK
wget http://dl.google.com/android/android-sdk_r24.3.3-linux.tgz
mkdir /home/runner/android-sdk-linux
tar xf android-sdk_r24.3.3-linux.tgz -C /home/runner/
rm android-sdk_r24.3.3-linux.tgz
# install necessarry componenets
if ENV["SEMAPHORE_CACHE_DIR"]
config.assets.configure do |env|
env.cache = ActiveSupport::Cache::FileStore.new(ENV["SEMAPHORE_CACHE_DIR"])
end
end