Skip to content

Instantly share code, notes, and snippets.

View rjohnsondev's full-sized avatar

Richard Johnson rjohnsondev

  • Brisbane -> London -> Melbourne
View GitHub Profile
@rjohnsondev
rjohnsondev / lpass_search.py
Last active October 1, 2022 03:42
lastpass cli wrapper for quick and dirty lookup of entries
#!/usr/bin/env python
import sys
import subprocess
import re
import base64
import os
if __name__ == "__main__":
words = sys.argv[1:]
@rjohnsondev
rjohnsondev / ari_crash.py
Last active April 30, 2022 01:38
demonstration of Asterisk crash due to ARI Bridge race condition
from multiprocessing.pool import Pool
from requests.auth import HTTPBasicAuth
from websocket import create_connection
import functools
import json
import random
import requests
import time
import urllib.parse
import threading
@rjohnsondev
rjohnsondev / hls_with_stack_fix.md
Last active December 22, 2021 01:32
error running haskell-language-server ghcup stack

When running haskell-language-server-wrapper directly from the command line within a stack project, we get an error like:

Hidden: no Range: 1:1-2:1 Source: cradle Severity: DsError Message: ghcide compiled by GHC 8.10 failed to load packages: : cannot satisfy -package-id aeson-1.5.6.0-DkwLMaMFAoKEbTeMR8x6ex (use -v for more information).

@rjohnsondev
rjohnsondev / compton_setup.sh
Last active October 20, 2019 07:13
Building compton compositing window manager on ubuntu 19.10
sudo apt install libx11-dev libxcomposite-dev libxdamage-dev libxfixes-dev libxext-dev libxrender-dev libxrandr-dev pkg-config make x11proto-dev x11-utils libpcre3-dev libconfig-dev libdrm-dev libgl-dev libdbus-1-dev asciidoc
@rjohnsondev
rjohnsondev / linphone_setup.sh
Created September 13, 2019 08:32
Building linphone-desktop on ubuntu 19.04
sudo apt list python-pip python3-pip qtbase5-dev yasm libV4l\* libturbo\* libglew-dev qtdeclarative5-dev qml-module-qtquick-controls libqt5svg5-dev qttools5-dev qtquickcontrols\* qml-module-\*
sudo pip install pystache
export Qt5_DIR="/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/cmake"
export PATH='/usr/lib/x86_64-linux-gnu/qt5/bin':$PATH
./prepare.py -DENABLE_DOC=OFF -DENABLE_AMRWB=ON -DENABLE_AMRNB=ON -DENABLE_NON_FREE_CODECS=ON -DENABLE_G729=ON -f
@rjohnsondev
rjohnsondev / pulp.vim
Created September 3, 2017 08:33
Basic PureScript linter for https://github.com/w0rp/ale (put in ale_linters/purescript)
" Author: rjohnsondev <github@rjohnson.id.au>
" Description:
function! s:error(str)
if exists('syntastic#log#error')
let logger = function('syntastic#log#error')
elseif exists('neomake#utils#ErrorMessage')
let logger = function('neomake#utils#ErrorMessage')
endif
echom a:str
@rjohnsondev
rjohnsondev / lsyncd.conf
Created August 23, 2017 12:33 — forked from oscarsmx/lsyncd.conf
Multiple Server, Host Lsync Config 2016
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd-status.log",
statusInterval = 10
}
-- Slaves
targetList = {
"127.0.0.1",
@rjohnsondev
rjohnsondev / lsyncd.conf
Created August 23, 2017 12:33 — forked from oscarsmx/lsyncd.conf
Multiple Server, Host Lsync Config 2016
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd-status.log",
statusInterval = 10
}
-- Slaves
targetList = {
"127.0.0.1",
@rjohnsondev
rjohnsondev / config.lua
Created August 8, 2017 12:21
lsyncd example config which creates a copy of file with timestamp when moved / renamed
local src = "/test_lsyncd/src"
local dest = "/test_lsyncd/dest"
timestampFiles = {
delay = 0,
maxProcesses = 99,
action = function(inlet)
local event, dstEvent = inlet.getEvent()
parser.add_argument(
'--mode',
default="test",
choices=["test", "launch", "populate", "worker"],
help='''What operation to run:
"test": Run in testing mode (single process, all local).
"launch": Launch and run everything.
"populate": Populate the central redis queue.
"worker": Run as a worker against the redis server.'''
)