Skip to content

Instantly share code, notes, and snippets.

@rektide
rektide / basic
Last active Jan 5, 2018
Trying to launch xlogo in xpra via the system service
View basic
$ xpra start --start=xlogo --start-via-proxy=yes
2018-01-04 22:39:09,965 server failure: disconnected before the session could be established
2018-01-04 22:39:09,966 server requested disconnect: server error (error accepting new connection)
2018-01-04 22:39:09,971 Error: printing disabled:
2018-01-04 22:39:09,971 No module named cups
xpra initialization error:
failed to start-via-proxy: unknown general failure
$ sudo journalctl -xef -u xpra
Jan 04 22:39:09 nanomachine xpra[17604]: New unix-domain connection received on /run/xpra/system
@rektide
rektide / terminal.log
Created Nov 27, 2017
xpra start error
View terminal.log
$ xpra start :99
Warning: invalid option: 'shadow-fullscreen'
Warning: cannot use the system proxy for 'start' subcommand,
failed to connect to '/run/xpra/system':
[Errno 111] Connection refused
Warning: invalid option: 'shadow-fullscreen'
InitException: cannot open log file '${HOME}/.xpra/:99.log': [Errno 2] No such file or directory: '${HOME}/.xpra/:99.log'
xpra initialization error:
cannot open log file '${HOME}/.xpra/:99.log': [Errno 2] No such file or directory: '${HOME}/.xpra/:99.log'
@rektide
rektide / hipchat-apt-key-add.log
Last active Aug 2, 2017
hipchat install on Debian/stretch
View hipchat-apt-key-add.log
wget -O - https://atlassian.artifactoryonline.com/atlassian/api/gpg/key/public | sudo apt-key add -
--2017-08-02 16:01:43-- https://atlassian.artifactoryonline.com/atlassian/api/gpg/key/public
Resolving atlassian.artifactoryonline.com (atlassian.artifactoryonline.com)... 34.225.205.210, 52.44.119.99
Connecting to atlassian.artifactoryonline.com (atlassian.artifactoryonline.com)|34.225.205.210|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1641 (1.6K) [text/plain]
Saving to: 'STDOUT'
- 100%[================================================>] 1.60K --.-KB/s in 0s
@rektide
rektide / promiseOriginMonkeypatch.js
Last active Jun 28, 2017
monkeypatch tracking origins onto Promise
View promiseOriginMonkeypatch.js
var promiseSource = new WeakMap()
(function(){
const promiseConstructor = Promise.constructor
Promise.constructor = function(fn){
console.log("monkeypatch successful")
promiseConstructor.call(this, fn)
promiseSource.set(this, new Error().stack)
}
}())
var sample = new Promise(x => x(42)) // expecting: "monkeypatch successful"
@rektide
rektide / pain.md
Last active May 2, 2017
Post Ansible 2.1 Pain
View pain.md

In the releases after Ansible 2.1, a vast amount of the expressivitiy in Ansible went away or broke.

I was in pain and hurting. I started trying to to upstream things I needed to continue on, but the templating situation post 2.1 was really bad with no signs of recovery to the once pristine state.

I somewhat dramatically opined, about what felt like a world I had built upon shattering,

Damnit Ansible could you have done any more to ruin it all.

Your fall has cast a horrible pall over all good things in this world. The birds no longer chirp. The grass is dead.

@rektide
rektide / cloudformation.user.js
Last active Feb 8, 2017
Userscript to add a "term" parameter in the url to allow filtering of CloudFormation listings
View cloudformation.user.js
// ==UserScript==
// @name CloudFormation Filter
// @namespace http://tampermonkey.net/
// @version 0.99a
// @description add filterability to the CloudFormation URL template via a "term" query parameter in the hash
// @author rektide
// @match https://console.aws.amazon.com/cloudformation/home*
// @grant none
// ==/UserScript==
@rektide
rektide / ansible-dict-iter.yaml
Last active Mar 9, 2021
Ansible dictionary iteration
View ansible-dict-iter.yaml
---
- hosts: all
vars:
places:
alpha: /home
epsilon: /nopenopenope
tasks:
- name: "changed_when depending on result, in with_items"
shell: "[[ '{{item}}' != 'alpha' ]]"
@rektide
rektide / gmusicapi-ifl-random.py
Last active Jan 9, 2017
GMusicAPI playing IFL
View gmusicapi-ifl-random.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import * # noqa
from getpass import getpass
from gmusicapi import Mobileclient
@rektide
rektide / mssculpt.xinput
Created Dec 30, 2016
Microsoft Sculpt Comfort Mouse properties
View mssculpt.xinput
$ xinput --list-props 17
Device 'ThinkPad Compact Bluetooth Keyboard with TrackPoint':
Device Enabled (139): 1
Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (300): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (301): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Accel Speed (283): 0.000000
libinput Accel Speed Default (284): 0.000000
libinput Accel Profiles Available (596): 1, 1
libinput Accel Profile Enabled (597): 1, 0
@rektide
rektide / README.md
Created Nov 10, 2016
ruby rescue cost
View README.md

What/Why

I as concerned about whether the presence of rescue in Ruby had significant performance impact.

In JavaScript for example try/catch historically has had significant impact itself, even when no exceptions were being thrown.

Based on these benchmarks though, I can see Ruby doesn't seem to have significant cost for defining exception handlers.

Results