Skip to content

Instantly share code, notes, and snippets.

View bborysenko's full-sized avatar

Borys Borysenko bborysenko

View GitHub Profile
@bborysenko
bborysenko / learn_python.md
Last active February 6, 2016 13:09 — forked from patleeman/learn_python.md
List of Python and related resources.

Resources for learning Python.

Resources for learning Python. From beginner to intermediate.

This resource is meant for those learning Python as a first language. It's a small collection of resources which start at beginner and moves to more intermediate concepts.

Articles

@bborysenko
bborysenko / python_env_mac.md
Created February 6, 2016 13:07 — forked from boundsj/python_env_mac.md
Setting up a Python environment: Mac

Creating an Agile Python Environment: Mac

This gist assumes you are on a Mac. It also assumes that you already have Python and pip installed and that you are most likely using Python version 2.7.x. If your environment differs you may have to work a little harder to get things sorted but hopefully the gist of the gist (agile Python) will still be useful for you. If you are on a windows machine, this is probably not the gist you are looking for.

We will take the minimum amount of steps nessessary to set up a complete set of tools that are fully controllable from the command line. Use your text editor or IDE of choice for creating the spec and implementation files. Note that some IDEs (i.e. PyCharm) make some of what we cover below a lot easier (i.e. debugging) but it is probably still useful to understand what is going on behind the scenes.

We will create a simple application that pulls down Guido van Rossum's twitter feed and prints out some of his latest perls of wisdo

@bborysenko
bborysenko / python-reference.md
Created February 6, 2016 13:06
Python 2.7 Quick Reference
# Single line comments start with a number symbol.

""" Multiline strings can be written
    using three "s, and are often used
    as comments
"""

####################################################
@bborysenko
bborysenko / LogSounds.sh
Created February 5, 2016 14:52 — forked from FriendlyTester/LogSounds.sh
Shell Script To Play Sounds On Word Match
tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done
#log.txt this is the log file you want to tail. Full path if not in that directory
#'ERROR' is the stirng you are looking to match
#beep-01a.wav is the sound to play when string matched. Full path if not in that directory
#Maik later responded saying his logfile was on a remote server, he discovered the following worked to tail a remote file
ssh <user@remoteserver> tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done
@bborysenko
bborysenko / vimdiff_cheet.md
Created January 20, 2016 23:40 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheet sheets.

Vimdiff cheet sheets.

##Git mergetool.

$ git config --global merge.tool=vimdiff

##vimdiff key mappings.

@bborysenko
bborysenko / nginx.conf
Created January 19, 2016 14:16 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@bborysenko
bborysenko / README.md
Created December 28, 2015 12:04 — forked from alekstorm/README.md
Ansible callback plugin that posts events to your Datadog event stream as you deploy

Installation

To install, place datadog.py in your callback plugins directory. If you don't yet have one, run:

mkdir -p plugins/callback

Then place the following in your ansible.cfg file:

[defaults]

callback_plugins = ./plugins/callback

@bborysenko
bborysenko / Ansible-Vault how-to.md
Created December 22, 2015 00:47 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@bborysenko
bborysenko / xvfb-init
Created December 2, 2015 09:57 — forked from maxivak/xvfb-init
Xvfb init script
#!/bin/bash
# xvfb - this script starts and stops Xvfb
#
# chkconfig: 345 95 50
# description: Starts xvfb on display 99
# processname: Xvfb
# pidfile: /var/log/xvfb/xvfb.pid
# Source function library.
@bborysenko
bborysenko / grunt-hugo-lunrjs.md
Created October 11, 2015 12:47 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search