Skip to content

Instantly share code, notes, and snippets.

View davydany's full-sized avatar
💭
Check out my app: The Civic Press! https://www.thecivicpress.com/

David Daniel davydany

💭
Check out my app: The Civic Press! https://www.thecivicpress.com/
View GitHub Profile
@davydany
davydany / soupkitchen.sh
Last active February 23, 2017 19:42
Soup Kitchen - Runs vagrant commands for kitchen vms. Get it? Soup Kitchens serve Vagrants?
# soupkitchen
# -----------
# Runs vagrant commands for kitchen vms
function soupkitchen {
BROWN_ORANGE="\033[0;33m"
RED="\033[0;31m"
NC="\033[0m" # No Color
command=$1;
@davydany
davydany / config.ru
Created February 17, 2017 23:45
Serving Static Sites in Heroku
# thanks to https://github.com/stevenhaddox
# Set Our Root Path
::ROOT = File.dirname( File.expand_path( __FILE__ ) )
ENV['RACK_ENV'] ||= 'development'
require 'rubygems'
# Serve our index file by default
use Rack::Static ,
@davydany
davydany / IPTABLES-CHEATSHEET.md
Last active May 27, 2024 14:55
IP Tables (iptables) Cheat Sheet

IP Tables (iptables) Cheat Sheet

IPTables is the Firewall service that is available in a lot of different Linux Distributions. While modifiying it might seem daunting at first, this Cheat Sheet should be able to show you just how easy it is to use and how quickly you can be on your way mucking around with your firewall.

Resources

The following list is a great set of documentation for iptables. I used them to compile this documentation.

@davydany
davydany / kill-all-vms.sh
Created May 23, 2017 20:09
Destroy all running VirtualBox VMs
# Runs perfectly on CentOS 7
# Read all pids for "VBoxHeadless" process, and kill (-9) them.
while read -r pid; do
echo "Killing VirtualBox Process '${pid}'..."
kill -9 ${pid}
echo " OK Done."
done < <(pgrep VBoxHeadless)
# Read all VirtualBox VMs, and unregister, then delete them
@davydany
davydany / postgresql-cheatsheet.md
Last active August 15, 2022 12:38
PostgreSQL Cheat Sheet

PostgreSQL Cheat Sheet

My personal Cheatsheet for PostgreSQL

Quick Commands

Creating a DB and Setting its Ownership

To create a database, you need to first ensure that the database's role exists first. Role and User are synonymous in PostgreSQL. Once you create the ROLE, you can create the Database and set the OWNER as the ROLE.

@davydany
davydany / sultan.py
Created June 5, 2017 16:55
Sultan - Using 'env' for environment variables
from sultan.api import Sultan
with Sultan.load(env={ 'HOME': '/tmp' }) as s:
print s.echo("${HOME}").run()
@davydany
davydany / how-to-tmux-background-process.md
Last active May 15, 2024 16:54
Using TMUX for running processes after you log off

How to Run a Process in the Background with TMUX

There are times when you need to log off your Linux Desktop, and you want a process to run in the background. TMUX manages this very well.

For this example, let's suppose you're running a long running task like running rspecs on your project and it is 5pm, and you need to go home.

Run Your Process

@davydany
davydany / README.md
Created June 24, 2017 01:14
Uploading to PyPi

How to Upload to PyPi

Source: http://peterdowns.com/posts/first-time-with-pypi.html

I am writing this because the site is down and I'm only able to get it from Google Cache.

Create Your PyPiRC file

Create a new file in ~/.pypirc, and populate it with the following details:

@davydany
davydany / pip-wheels.md
Created August 25, 2017 22:23
PIP Wheel ALL THE THINGS!

Using pip wheels

Installation Instructions

Before using pip Wheels, you need to install the wheels library.

pip install wheel
@davydany
davydany / network-monitoring.md
Last active September 7, 2017 17:17
Linux Tools

Tools for Network Monitoring

The purpose of this document is to show utilities that are available in the Linux world to monitor network traffic (so we're not reinventing the wheel).

Here are some good resources to read, but this file contains my favorite utilities: