Skip to content

Instantly share code, notes, and snippets.

tarruda / .gitignore
Created May 14, 2021
Electron 10+ crash on windows 32-bit
View .gitignore
tarruda / etc-libvirt-qemu.conf
Created Dec 8, 2020
View etc-libvirt-qemu.conf
# Necessary to prevent random host freeze. For more details, see:
seccomp_sandbox = 0
tarruda / allow-url-patterns-intercept-protocol.diff
Created Oct 17, 2020
This patch modifies electron's intercept*Protocol APIs to allow passing an array of URL patterns as second argument (same format as webRequest)
View allow-url-patterns-intercept-protocol.diff
commit 6defd383ae86a65a4cdcc8ec47f4aabf7aac69a6
Author: Thiago Padilha <>
Date: Fri Oct 16 19:10:26 2020 -0300
OTA-10843: Implement URL patterns for intercept*Protocol
By passing an array of URL patterns (same syntax as webRequest), it is now
possible to filter which URLs are passed to intercept*Protocol handlers.
diff --git a/shell/browser/api/ b/shell/browser/api/
tarruda /
Created Aug 27, 2018
msgpack-rpc implementation for python asyncio
import asyncio
import collections
import mpack
class ErrorResponse(BaseException):
class MpackRpcSession(object):
def __init__(self, reader, writer, mpack_session=None):
tarruda / userns-with-vpn.xml
Last active May 18, 2018
Libvirt lxc configurations
View userns-with-vpn.xml
<domain type='lxc'>
<memory unit='GiB'>8</memory> <!-- The container can use at most 8G of memory -->
<uid start='0' target='300000' count='65536'/>
<gid start='0' target='300000' count='65536'/>
<type arch='x86_64'>exe</type>
tarruda / index.html
Created Jun 2, 2017
electron sandbox webview test
View index.html
<webview id="foo" allowpopups sandbox="true" preload="preload-webview.js" src="index.html" style="display:inline-flex; width:640px; height:480px"></webview>
<script type="text/javascript" charset="utf-8">
tarruda / pkg-gonfig.go
Created Nov 29, 2015 — forked from mattn/pkg-gonfig.go
go implementation of pkg-config
View pkg-gonfig.go
package main
import (
tarruda / lxc-autostart.tcl
Last active Dec 14, 2015
Autostart unprivileged lxc containers
View lxc-autostart.tcl
# Workaround to automatically start unprivileged containers on boot. This is
# required because unprivileged containers only seem to work when started from
# an interactive login session. Reference:
# This script can be called from the user crontab with the @reboot
# directive(runs once at startup). One way to achieve this is to save this
# script to /home/USER/lxc-autostart.tcl and add the following entry to
# `crontab -e`:
tarruda /
Last active Sep 4, 2020
Edit file in host Neovim instance from a :terminal buffer
#!/usr/bin/env python
"""Edit a file in the host nvim instance."""
import os
import sys
from neovim import attach
args = sys.argv[1:]
if not args:
print "Usage: {} <filename> ...".format(sys.argv[0])
tarruda /
Created Jan 9, 2015
Install pygtk3 in pyenv
# script for pyenv installation of pygtk3 in ubuntu 12.04
# Adapted from
system_package_installed() {
if ! dpkg -l | grep -q $1; then
sudo apt-get install $1