Skip to content

Instantly share code, notes, and snippets.

wvengen wvengen

  • Amsterdam, NL
Block or report user

Report or block wvengen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wvengen
wvengen / extend.sh
Last active Aug 26, 2019
Extend non-HiDPI external display above HiDPI internal display
View extend.sh
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
@wvengen
wvengen / install_scrapyd.sh
Last active May 31, 2019
Installation script for scrapyd
View install_scrapyd.sh
#
# Installation script for scrapyd on Debian/Ubuntu
# http://scrapyd.readthedocs.org/
#
# - Latest scrapyd from Scrapy package repository
# - Password protection with http basic auth
# - HTTPS with self-signed certificate
# - Works on Amazon EC2
#
FQDN=scrapy.example.com
@wvengen
wvengen / README.md
Last active May 21, 2019
Ruby memory analysis over time
View README.md

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@wvengen
wvengen / NOTES.md
Last active May 18, 2019
Freedrum on Linux
View NOTES.md

Freedrum on Linux

The recently released Freedrum has no official Linux support. But, fortunately, it uses standard Bluetooth LE MIDI. It doesn't seem to work out of the box, yet (on Ubuntu 17.04, most probably Ubuntu 18.04 will support it directly).

Bluez 5.46

One really needs bluez 5.46 or higher. On Ubuntu, these are packaged in artful proposed (amd64). Unfortunately, MIDI support is not enabled in this build (Ubuntu bug #1713017).

So you'll need to download the sources, install dependencies plus libasound2-dev, build and install resulting debs. You may need to add --enable-midi to debian/rules. Like this:

@wvengen
wvengen / update-freevpn.sh
Last active Apr 28, 2019
Update on-demand PPTP configuration for free VPNs
View update-freevpn.sh
#!/bin/sh
#
# Update freevpn.se pptp configuration
#
# Since the password changes now and then, it's useful to update it automatically.
# Make sure you've installed lynx. Tested on Debian.
#
URL=https://www.freevpn.se/accounts/
PEERNAME=freevpn.se
@wvengen
wvengen / gen_wpa_sup.py
Created Nov 25, 2016
wifi export for network-manager
View gen_wpa_sup.py
#!/usr/bin/env python
#
# Export network-manager WiFi connection details to a wpa-supplicant
# file. This can be saved to an Android device, so you have all your
# laptop's WiFi connections on your phone right away (root required).
#
# python gen_wpa_sup.py >foo
# adb push foo /sdcard/foo
# adb shell
# su -c 'cat /sdcard/foo >>/data/misc/wifi/wpa_supplicant.conf'
@wvengen
wvengen / README.md
Last active Feb 8, 2019
Basic redux-api example
View README.md
@wvengen
wvengen / README.md
Last active Nov 15, 2018
d3.chart.sankey (product demo)
View README.md

d3.chart.sankey: Reusable D3 Sankey diagram using d3.Chart.

This diagram shows how the ingredients may contribute to the total sustainability of a chocolate bar through different issues.

@wvengen
wvengen / README.md
Last active Nov 10, 2018
d3.chart.sankey (interactive demo)
View README.md
@wvengen
wvengen / get-publitas.sh
Created Oct 11, 2018
Generate PDF from Publitas folder URL
View get-publitas.sh
#!/bin/sh
#
# Generates PDF from Publitas images (online folder service)
# Stores generated PDF and JSON (which may contains links).
#
# Requirements:
# - wget https://www.gnu.org/software/wget/
# - jq https://stedolan.github.io/jq/
# - imagemagick https://www.imagemagick.org/
#
You can’t perform that action at this time.