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 / getting-started-postgres.md
Last active May 30, 2023 17:11
Getting Started with PostgreSQL

Getting Started with Postgres

I swap between databases all the time for various projects, and end up Googling and how to do the initial setup all the time, so the purpose of this document is to list a set of commands that anyone would end up using in getting started.

Creating a User

The simplest way to do this, without calling the psql utility and calling the CREATE ROLE and a bunch of other SQL Statements is to use the createuser utility.

@davydany
davydany / disks.md
Last active October 5, 2018 21:23
All Things Disks

All Things Disks

This is my personal documentation for dealing with Disks on a Linux Systems. This assumes that we're on CentOS (6.8).

NOTE: This tutorial does not talk about how to attach a disk to your Linux Box, or removing a disk. This is because in a physical machine, you will literally put the disk in or pull it out. On a VM, you will

NOTE: All the commands you run are to be run as root, and so, it will require superuser permissions when running sudo ....

@davydany
davydany / background.js
Created August 28, 2018 22:35
Snippet showing Firebase working with Electron Background Process
// This is main process of Electron, started as first thing when your
// app starts. It runs through entire life of your application.
// It doesn't have any windows which you can see on screen, but we can open
// window from here.
import path from "path";
import url from "url";
import { app, Menu, protocol } from "electron";
import { devMenuTemplate } from "./menu/dev_menu_template";
import { editMenuTemplate } from "./menu/edit_menu_template";
@davydany
davydany / README.md
Last active November 10, 2017 21:00
For those times you need to edit a jar file which has only 1 XML file with the same name as the jar file (minus the extension), and you just don't want to extract the damn file to access 1 file. Use 'vijar' to simplify your life.

jarjar

Usage

jarjar <executable> <path-to-jar-file>
@davydany
davydany / README.md
Last active October 25, 2017 20:21
Python Thread Pool

Python Thread Pool

Usage

import requests
from threadpool import ThreadPool

def task(url):
 response = requests.get(url)
@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:

@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 / 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 / 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 / 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()