Skip to content

Instantly share code, notes, and snippets.

@tiagoengel
tiagoengel / noise-cancellation.sh
Last active May 12, 2023 20:41
Hiss / White / Static noise cancellation on Linux using Pulseaudio and Sox
#!/bin/bash
# You'll need to have sox, pavucontrol and alsa-utils installed, and the snd_aloop kernel module loaded.
# You can configure your system to load it on startup or load it manually with "sudo modprobe snd_aloop"
# Once this is script is running, you need to start recording audio in the application of your
# preference, open pavucontrol, go to the recording tab and change the recording source of that application
# to "Monitor of Loopback ..."
time=5
#!/bin/bash
# Logout current GitHub credentials and remove global user.name, user.email
echo -e "host=github.com\nprotocol=https\n" | git credential-osxkeychain erase
git config --unset-all --global user.name
git config --unset-all --global user.email
@drewkerrigan
drewkerrigan / README.md
Last active June 6, 2021 05:41
Setting open files limit in OSX 10.11.3

Download this gist, and then run:

chmod 755 open_files_limit_mac.sh
./open_files_limit_mac.sh

Restart the system, and then run:

@kostecky
kostecky / capistrano_haproxy_rolling_deploy.rb
Last active March 26, 2018 20:10
Capistrano rolling deploy with haproxy
# Create a map of the deploy server to the haproxy label
server 'A.A.A.A', proxy_label: 'server-01'
server 'B.B.B.B', proxy_label: 'server-02'
# Define our puppet proxy server(s) and role
server 'C.C.C.C', no_release: true, roles: [:proxy]
# We need to override deploy:symlink:linked_dirs
# No way around it - override deploy:symlink:release and rewrite it for rolling deploys
Rake::Task["deploy:symlink:release"].clear_actions
@djonsson
djonsson / install_elasticsearch_osx.md
Last active November 11, 2022 21:10
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@ryancdotorg
ryancdotorg / frag32.py
Created August 20, 2015 16:27
A FAT32 fragmenter, because I am a horrible person.
#!/usr/bin/env python
import random
import struct
import sys
# Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833
def ppNum(num):
return "%s (%s)" % (hex(num), num)
@ysinc88
ysinc88 / controllers.rb
Last active August 29, 2015 14:27
Create json nested attributes
class UsersController < ApplicationController
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
format.html { redirect_to @user, notice: 'User was successfully created.' }
format.json { render :show, status: :created, location: @user }
else
format.html { render :new }
@fuzzyalej
fuzzyalej / functional_javascript.js
Last active August 29, 2015 14:16
Functional JS Workshop
function cell(value) {
return {
value: value,
next: null //null is cool
};
}
function cons(value, list) {
var tmp = cell(value);
tmp.next = list || null;
@denji
denji / golang-tls.md
Last active March 29, 2024 03:03 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@chris-roerig
chris-roerig / gist:79777c111374f6356348
Last active October 19, 2020 23:17
How to install NameCheap EssentialSSL wildcard certificate in nginx on Ubuntu 14.04

First generate a new CSR openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

DO NOT DELETE THE server.key FILE

Follow the rest of this guide after activating the csr and recieving the certs from Namechep.

unzip the package from COMODO

unzip STAR_<yourfqdn_here>_com.zip