Skip to content

Instantly share code, notes, and snippets.

View bborysenko's full-sized avatar

Borys Borysenko bborysenko

View GitHub Profile
# The Roots theme by default does not check production assets into Git, so
# they are not deployed by Capistrano when using the Bedrock stack. The
# following will compile and deploy those assets. Copy this to the bottom of
# your config/deploy.rb file.
# Based on information from this thread:
# http://discourse.roots.io/t/capistrano-run-grunt-locally-and-upload-files/2062/7
# and specifically this gist from christhesoul:
# https://gist.github.com/christhesoul/3c38053971a7b786eff2

How to install cGit on Nginx (Ubuntu server)

Step-by-step installtion of cGit on nginx without funky rewrite rules.

Pre-requisites

This is for

@bborysenko
bborysenko / human_log.py
Last active August 29, 2015 14:27 — forked from steinim/human_log.py
To get rid of `AttributeError: 'list' object has no attribute 'encode'` error need to check type before
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
if isinstance(res[field], unicode):
encoded_field = res[field].encode('utf-8')
else:
@bborysenko
bborysenko / playbook.yml
Last active August 29, 2015 14:27 — forked from dirn/playbook.yml
- hosts: localhost
remote_user: dirn
vars:
ansible: ~/.ansible
dotfiles: "{{ ansible }}/dotfiles"
rc_file: ~/.extra
pyenv: /Users/{{ ansible_ssh_user }}/.pyenv
python_version: 3.4.3
python_versions: [2.6.9, 2.7.9, 3.3.6, 3.4.3, pypy-2.5.0, pypy3-2.4.0]
@bborysenko
bborysenko / Vagrantfile
Last active August 29, 2015 14:27 — forked from tknerr/Vagrantfile
Sample Vagrantfile that works with all providers (virtualbox, aws, managed) and in combination with the vagrant-omnibus plugin
#
# Vagrantfile for testing
#
Vagrant::configure("2") do |config|
# the Chef version to use
config.omnibus.chef_version = "11.4.4"
def configure_vbox_provider(config, name, ip, memory = 384)
config.vm.provider :virtualbox do |vbox, override|
@bborysenko
bborysenko / gist:8bf73f0eb1d9a562e000
Last active September 5, 2015 11:21 — forked from dedy-purwanto/gist:11312110
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@bborysenko
bborysenko / headless.md
Last active September 24, 2016 07:05 — forked from addyosmani/headless.md
So, you want to run Chrome headless.

#If you're on Ubuntu or working with a Linux VM...

Step 1: Install the Ubuntu dependencies needed:

SSH into your server as a root or do sudo -i.

Then install necessary software:

apt-get update
@bborysenko
bborysenko / gist:a1386822aa23d870e1dd
Last active September 21, 2015 22:11 — forked from seansawyer/gist:88a16373a3d2c2a939b1
Vagrant + Ansible crash course

Install Virtualbox, Vagrant and Ansible.

Create a new directory for your first Vagrant VM. In that directory, create a Vagrantfile using vagrant init, and enable the Ansible provisioner by adding the following.

config.vm.provision "ansible" do |ansible|
  ansible.playbook = "playbook.yml"
end

Now you can create an Ansible playbook named playbook.yml file in the same directory as your Vagrantfile, and vagrant provision will run it. Here's an easy one to start with that will update NSS and add the EPEL and IUS repositories.

@bborysenko
bborysenko / index.md
Created September 23, 2015 11:17 — forked from johan/index.md
osx + java 7 = painfully easy

Step 1

Does your osx terminal speak java 7? Start Terminal.app and try: java -version:

> java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
@bborysenko
bborysenko / scl_sudo
Created September 25, 2015 19:47 — forked from kpiwko/scl_sudo
Red Hat SCL Sudo wrapper
#! /bin/sh
# TODO: parse & pass-through sudo options from $@
sudo_options="-E"
scls=$X_SCLS
#available_scls="`scl --list | tr '\n' ' ' | sed 's/ $//'`"
for arg in "$@"
do
case "$arg" in
*\'*)