Skip to content

Instantly share code, notes, and snippets.

@bowbowbow
bowbowbow / waveform.py
Created August 9, 2018 10:02 — forked from moeseth/waveform.py
Create Soundcloud style waveform from Audio in Python
from pydub import AudioSegment
from matplotlib import pyplot as plot
from PIL import Image, ImageDraw
import numpy as np
import os
src = "./test.mp3"
audio = AudioSegment.from_file(src)
data = np.fromstring(audio._data, np.int16)
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@bowbowbow
bowbowbow / getCAbundle.js
Created November 27, 2015 11:12 — forked from pleaseshutup/getCAbundle.js
node.js certificate issues with https.createServer and nodejitsu's http-proxy
//Thanks to:
//http://www.benjiegillam.com/2012/06/node-dot-js-ssl-certificate-chain/
//For the code to pass a CA bundle (multiple certs in one file) as an array
//which fixes certificate errors on some browsers when doing https.createServer(options
//This is how you can fix that with nodejitsu's http-proxy when using SNI
// to have a server listening and returning multiple ssl certs