Skip to content

Instantly share code, notes, and snippets.

View bborysenko's full-sized avatar

Borys Borysenko bborysenko

View GitHub Profile
@bborysenko
bborysenko / README.rst
Created October 10, 2015 12:38 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@bborysenko
bborysenko / gist:a39fde3250068848b9b8
Created September 29, 2015 21:31 — forked from clintel/gist:1155906
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
@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
*\'*)
@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 / 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 / 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: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 / 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 / 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 / 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: