Skip to content

Instantly share code, notes, and snippets.

View RobbieClarken's full-sized avatar
🦀

Robbie Clarken RobbieClarken

🦀
View GitHub Profile

Method 1

  1. If you don't have xpdf already:
brew install xpdf
  1. Convert the PDF to a postscript file:
@RobbieClarken
RobbieClarken / youtube-dl-best.py
Last active November 27, 2024 11:27
Download the best quality video and audio from YouTube and merge with ffmpeg.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
import subprocess
import os
import glob
from itertools import chain
import platform
@RobbieClarken
RobbieClarken / coinjarorders.py
Last active December 29, 2015 19:29
Fetch CoinJar orders and present statistics
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from dateutil.parser import parse as parse_date
from collections import namedtuple
import re
import argparse
import getpass
@RobbieClarken
RobbieClarken / SettingUpDebian.md
Last active December 30, 2015 08:19
Setting up a new Debian box
  • Add your user to the sudoers:

    su -c 'EDITOR=vi visudo'
  • Install git, vim and a few other utilities and set vim as the default editor

sudo apt-get install git vim-nox gdebi xclip python-gpgme

@RobbieClarken
RobbieClarken / offsetsrt.awk
Last active November 11, 2022 09:52
Awk program to correct the timing of a srt subtitle file by applying an offset.
function string_to_time(time_string) {
split(time_string, s, ",")
split(s[1], t, ":")
return 3600*t[1] + 60*t[2] + t[3] + s[2]/1000
}
function correct_time(time_string) {
offset = -16.0
start_time = string_to_time("00:00:00,000")
@RobbieClarken
RobbieClarken / EPICS over Flask WebSockets.md
Last active September 23, 2023 20:19
EPICS over WebSockets with Flask

Installation:

pip install Flask Flask-Sockets gunicorn pyepics

Deployment:

gunicorn -k flask_sockets.worker index:app
@RobbieClarken
RobbieClarken / addingtobuild.md
Last active August 29, 2015 14:01
Steps to making a local build and adding an EPICS app to an IOC

Set up environment variables

export EPICS_BASE=/epics/base
export EPICS_HOST_ARCH=linux-x86_64
export P4USER=clarkenr #your perforce username
export P4PASSWD=secret #your perforce password
export P4CLIENT=clarkenr_SR00IOC99 #the perforce workspace you will be editing
export BUILD_CLIENT=/home/clarkenr/perforce #path to the root of the perforce workspace that you will build against
export BUILD_BASE=/home/clarkenr #path where the IOC build will be put
@RobbieClarken
RobbieClarken / SettingUpFedora.md
Last active September 16, 2017 14:36
Set up a new Fedora installation

Server

Install Fedora with Minimal Install option.

MY_HOSTNAME='???'
MY_WIFI='???'
MY_WIFI_PASSWORD='???'
sudo hostnamectl set-hostname --static "$MY_HOSTNAME"
sudo dnf update
  • Use paste and bc to add up a column of numbers:

    du -s *.pdf | cut -f 1 | paste -sd+ - | bc
  • Pretty diff: diff -y -W $(tput cols) file1 file2 | colordiff | less -R

  • Find non-ascii characters in vim: /[^\x00-\x7F]