Skip to content

Instantly share code, notes, and snippets.

@WaYdotNET
WaYdotNET / setup.md
Created November 11, 2017 15:24 — forked from shashankmehta/setup.md
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@WaYdotNET
WaYdotNET / getFirafonts.sh
Created August 8, 2017 07:51 — forked from muammar/getFirafonts.sh
Download and install Fira fonts in Linux or Mac OS X
#!/bin/bash
## cf from http://programster.blogspot.com/2014/05/ubuntu-14-desktop-install-fira-sans-and.html
cd /tmp
# install unzip just in case the user doesn't already have it.
if [[ `uname` = Linux ]]; then
sudo apt-get install unzip -y
wget "http://www.carrois.com/downloads/fira_4_1/FiraFonts4106.zip"
@WaYdotNET
WaYdotNET / hello_multiprocessing.py
Created May 15, 2017 10:55 — forked from baojie/hello_multiprocessing.py
Python multiprocessing hello world. Split a list and process sublists in different jobs
import multiprocessing
# split a list into evenly sized chunks
def chunks(l, n):
return [l[i:i+n] for i in range(0, len(l), n)]
def do_job(job_id, data_slice):
for item in data_slice:
print "job", job_id, item
@WaYdotNET
WaYdotNET / django_log_settings.py
Created March 28, 2017 13:33 — forked from st4lk/django_log_settings.py
Django logging settings
# Logging settings for django projects, works with django 1.5+
# If DEBUG=True, all logs (including django logs) will be
# written to console and to debug_file.
# If DEBUG=False, logs with level INFO or higher will be
# saved to production_file.
# Logging usage:
# import logging
# logger = logging.getLogger(__name__)
# logger.info("Log this message")
# sudo su and run the following
sudo aptitude update
# install all dependencies
sudo aptitude -y install \
python-pip \
python2.7-dev \
libssl-dev \
libcurl4-openssl-dev \
@WaYdotNET
WaYdotNET / __readme.md
Created January 17, 2017 13:26 — forked from maxivak/__readme.md
Building Docker image with Packer and provisioning with Ansible

Building Docker image with Packer and provisioning with Ansible

Overview

Packer

  • Packer is used to build image from a base image, perform provisions and store (commit) the final image.

  • We use provisioners and Packer templates to do the actual work to create the final image.

  • We use Ansible for provisioning.

@WaYdotNET
WaYdotNET / supervisord-example.conf
Created November 29, 2016 17:27 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@WaYdotNET
WaYdotNET / gencert.py
Created November 4, 2016 16:42 — forked from toolness/gencert.py
Python script to create server SSL certs and sign them with a custom CA.
#! /usr/bin/python
"""
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
in http://www.tc.umn.edu/~brams006/selfsign.html.
Before using this script, you'll need to create a private
@WaYdotNET
WaYdotNET / nginx.conf
Created May 29, 2016 15:43 — forked from minostro/gist:11387989
Configuring Nginx on Webfaction

1.- Get into the src folder, download & extract nginx source

  • cd ~/src
  • curl -O http://nginx.org/download/nginx-1.7.0.tar.gz
  • tar -xzvf nginx-1.7.0.tar.gz
  • cd nginx-1.7.0

2.- Configuring the source

./configure --prefix=$HOME/local/nginx \

@WaYdotNET
WaYdotNET / swap.yml
Created February 25, 2016 13:46 — forked from manuelmeurer/swap.yml
Ansible role for creating a Swap file
- name: set swap_file variable
set_fact:
swap_file: /mnt/{{ swap_space }}.swap
- name: check if swap file exists
stat:
path: "{{ swap_file }}"
register: swap_file_check
- name: create swap file