Skip to content

Instantly share code, notes, and snippets.

@valpackett
valpackett / Alfred-Pinboard-INSTANT.md
Last active September 7, 2023 21:01
INSTANT Pinboard search from Alfred 2

INSTANT Pinboard search from Alfred 2

I've had a Python script that makes an HTML Bookmarks file for LaunchBar.
Now that I use Alfred 2, I modified it to make XML for Alfred.
This allows me to search my bookmarks with GREP SPEED!

Installation

First, add your token (from pinboard.in/settings/password) to ~/.netrc

@valpackett
valpackett / reaperdemo.c
Created March 23, 2023 05:28
FreeBSD reaper API demo
#include <sys/procctl.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sysexits.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <signal.h>
@valpackett
valpackett / global-input-unstable-v1.xml
Last active November 20, 2022 18:40
global-input wayland protocol DRAFT PREVIEW
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="global_input_v1">
<copyright>
Copyright (C) 2017 Val Packett (val@packett.cool)
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
@valpackett
valpackett / thread.log
Created November 9, 2020 21:38
Thread ID testing on FreeBSD
% cc -pthread -o /tmp/tid tids.c && truss /tmp/tid
[…]
__sysctl("vm.overcommit",2,0x7fffffffa314,0x7fffffffa308,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34374418432 (0x800e00000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 34410536960 (0x803072000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34422652928 (0x803c00000)
__sysctl("kern.usrstack",2,0x800ac8108,0x7fffffffc228,0x0,0) = 0 (0x0)
getrlimit(RLIMIT_STACK,{ cur=536870912,max=536870912 }) = 0 (0x0)
thr_self(0x803084000) = 0 (0x0)
mmap(0x7fffdfffd000,4096,PROT_NONE,MAP_ANON,-1,0x0) = 140736951472128 (0x7fffdfffd000)
@valpackett
valpackett / 1_WTF.md
Created February 3, 2012 18:32
Kindle dictionary template

Kindle dictionary template

Use it with KindleGen

kindlegen dic.opf

@valpackett
valpackett / dump.json
Created April 28, 2017 17:44
my geekedin profile
{
"_id": "d08a4d8d-5c30-42a7-a6fe-42af3d3243da1448627578734",
"_class": "com.geekedin.domain.entities.mongo.EDeveloper",
"scores": [
{
"technology": "CSS",
"score": 1141,
"lastCompute": {
"sec": 1470051310,
"usec": 552000
@valpackett
valpackett / LICENSE.md
Created November 10, 2011 17:48
Evernote-Marked integration
       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
               Version 2, December 2004

Copyright (C) 2011 Grigory V. floatboth@me.com

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

@valpackett
valpackett / no-ubt.conf
Created November 26, 2016 14:03
Disable automatic Bluetooth stack loading on FreeBSD (put into /usr/local/etc/devd and restart devd)
# Do nothing when a ubt device is attached
attach 999 {
device-name "ubt[0-9]+";
};
detach 999 {
device-name "ubt[0-9]+";
};
# Do not even load ubt
@valpackett
valpackett / tokio-wayland-loop.rs
Created May 30, 2020 21:41
tokio-wayland-loop.rs
use smithay_client_toolkit::reexports::client::{
EventQueue, Interface, Main, MessageGroup, Proxy, ProxyMap,
};
/// Tokio task for polling the Wayland socket, dispatching the callbacks.
/// This makes wayland_event_chan work.
pub async fn wayland_loop(event_queue: &mut EventQueue) -> Result<(), Box<dyn std::error::Error>> {
use std::task::Poll;
let fd = event_queue.display().get_connection_fd();
@valpackett
valpackett / dpcd-eve.patch
Created April 9, 2020 12:04
Patch forcing DPCD backlight on Pixelbook
diff --git i/drivers/gpu/drm/i915/intel_dp_aux_backlight.c w/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
index 357136f17..7de91a4a5 100644
--- i/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
+++ w/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
@@ -252,8 +252,12 @@ intel_dp_aux_display_control_capable(struct intel_connector *connector)
* the panel can support backlight control over the aux channel
*/
if (intel_dp->edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP &&
- (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP) &&
- !(intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP)) {