Skip to content

Instantly share code, notes, and snippets.

View jgillmanjr's full-sized avatar

Jason Gillman Jr. jgillmanjr

View GitHub Profile
package com.collidermodular.core;
public interface Host {
public double getSampleRate();
public double getSamplesPerMs();
public double getMsPerSample();
public double getTempo();
}
public interface ValueSource {
@attacus
attacus / riot-matrix-workshop.md
Last active March 13, 2024 00:16
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@dmitrykustov
dmitrykustov / upgrade-postgres-9.4-to-9.6.md
Last active August 8, 2022 17:52 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.4 to 9.6 on Debian Jessie

To use the most modern version of Postgres software we need to add postgresql repository. Edit /etc/apt/sources.list or create /etc/apt/sources.list.d/pgdg.list and add there a line: deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main Then import the repository signing key, and update the package lists:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

Install a new version of PostgreSQL server.

Once the Debian upgrade finished, I used dpkg-query -l postgresql* to check which versions of postgres I have installed.

@Komzpa
Komzpa / upgrade-postgres-9.4-to-9.5-to-9.6-to-10.md
Last active January 15, 2021 18:04 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.4 to 9.5 to 9.6 to 10 when upgrading Ubuntu 14.10 to 16.04

TL;DR

9.4 -> 9.5:

sudo pg_dropcluster 9.5 main --stop
sudo service postgresql stop
sudo pg_upgradecluster -m upgrade -k 9.4 main
sudo su postgres -c "/usr/lib/postgresql/9.5/bin/vacuumdb --all --analyze-in-stages"
sudo pg_dropcluster 9.4 main
@Chandler
Chandler / slack_history.py
Last active March 26, 2024 14:35
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@floehopper
floehopper / install.md
Last active March 26, 2024 14:10
Install rtl-sdr on Raspian on Raspberry Pi
jamesmead@floehopper.local:~$ sudo dd bs=1m if=/Users/jamesmead/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk2
pi@raspberrypi ~ $ sudo raspi-config
# Choose option 1 to "Expand Filesystem" - Ensures that all of the SD card storage is available to the OS
# Choose Finish & reboot

pi@raspberrypi ~ $ sudo apt-get update
@uranusjr
uranusjr / install_ensurepip.py
Created August 22, 2014 02:44
Script to install ensurepip to Python. “Fix” the Ubuntu 14.04 / Debian Sid bug. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732703
import os
import sys
import io
import tarfile
import urllib.request
ARCHIVE_URL = 'http://d.pr/f/YqS5+'
@dpapathanasiou
dpapathanasiou / dst.py
Created August 16, 2014 15:42
How to tell if Daylight Savings Time is in effect using Python
from datetime import datetime
import pytz
def is_dst ():
"""Determine whether or not Daylight Savings Time (DST)
is currently in effect"""
x = datetime(datetime.now().year, 1, 1, 0, 0, 0, tzinfo=pytz.timezone('US/Eastern')) # Jan 1 of this year
y = datetime.now(pytz.timezone('US/Eastern'))
@kissgyorgy
kissgyorgy / get_models_from_app.py
Created September 18, 2013 19:56
Django: Get list of models from app
# http://stackoverflow.com/questions/8702772/django-get-list-of-models-in-application
from django.db.models import get_app, get_models
app = get_app('my_application_name')
for model in get_models(app):
new_object = model() # Create an instance of that model
model.objects.filter(...) # Query the objects of that model
model._meta.db_table # Get the name of the model in the database
model._meta.verbose_name # Get a verbose name of the model