Skip to content

Instantly share code, notes, and snippets.

@lhammond
lhammond / x11_docker_mac.md
Created July 14, 2023 20:50 — forked from cschiewek/x11_docker_mac.md
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@lhammond
lhammond / .asoundrc
Created April 12, 2021 23:56 — forked from italic-r/.asoundrc
ALSA - Signalink USB
# Use this file for a user-configurable ALSA soundcard setup.
# Place in the user's home folder (/home/ham/.asoundrc).
# This file is built for a Tigertronics Signalink USB, a USB
# soundcard designed to interface a computer with an amateur
# radio transceiver for digital mode operation. This
# configuration allows multiple programs to access the same
# sound device simultaneously without blocking the device.
# This configuration is built on a custom modprobe
# configuration file (/etc/modprobe.d/alsa-base.conf) to
@lhammond
lhammond / .dockerignore
Created April 20, 2020 16:20 — forked from ksmithut/.dockerignore
Node Docker Compose nodemon
node_modules
@lhammond
lhammond / rails-jsonb-queries
Created February 28, 2018 22:39 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@lhammond
lhammond / mapserver_nginx
Last active August 5, 2021 14:24 — forked from yodeski/mapserver_nginx
Install Mapserver to run as FastCGI over Nginx
sudo apt-get install libgd2-xpm-dev
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal20 libgeos-c1v5 libmapserver2 cgi-mapserver mapserver-bin
sudo apt-get install spawn-fcgi
create /etc/init.d/mapserv
add the following
@lhammond
lhammond / launch_instance.rb
Created January 4, 2017 19:46 — forked from matthutchinson/launch_instance.rb
Launching EC2 instance with aws-sdk gem
#!/usr/bin/ruby
# README
# gem install aws-sdk
# add this to bashrc
# export HT_DEV_AWS_ACCESS_KEY_ID=????
# export HT_DEV_AWS_SECRET_ACCESS_KEY=????
# put your pem file in ~/.ssh and chmod 0400
# for more info see; https://rubygems.org/gems/aws-sdk
@lhammond
lhammond / GeoJsonMapLayer.js
Created September 27, 2016 16:45 — forked from fab1an/GeoJsonMapLayer.js
React / Leaflet combination
export default class GeoJsonMapLayer extends React.Component {
render() {
return (
<div>
</div>
);
}
componentWillUnmount() {
if (this.layer) {
var path = require('path');
var paths = require('./ionic.config').paths;
module.exports = {
entry: [
path.normalize('es6-shim/es6-shim.min'),
'reflect-metadata',
path.normalize('zone.js/dist/zone'),
path.resolve('app/app')
var gulp = require('gulp'),
gulpWatch = require('gulp-watch'),
del = require('del'),
runSequence = require('run-sequence'),
argv = process.argv;
/**
* Ionic hooks
* Add ':before' or ':after' to any Ionic project command name to run the specified