Skip to content

Instantly share code, notes, and snippets.

View dreamcat4's full-sized avatar
😋

Dreamcat4 dreamcat4

😋
View GitHub Profile
I've been fighting the same problem and have to say the hint provided here about resetting the launch services, and letting `launchd` do this at login (via Lingon) is invaluable. Thanks a lot for that, it makes FileVault far more usable!
After using this for a while, I have however discovered a side effect of resetting the launch services that is rather annoying--but I have also found a solution for it.
The _problem_ is that after resetting the launch services, calling a protocol handler registered by a user installed application is considered a **first time call** again, meaning it needs to be confirmed by the user (unless the app has been started directly before the call). Examples I stumbled upon are:
* bookmarking through the Pukka bookmarklet
* opening an Evernote note from a Spotlight search
* calling a `man` page in Safari through Bwana.
@dreamcat4
dreamcat4 / tv.sh
Created August 25, 2014 18:52 — forked from BtbN/tv.sh
#!/bin/bash
cd "$(dirname "$0")"
source .qstr.bash
echo -ne "Content-Type: video/x-matroska\r\n\r\n"
if [ -f /tmp/tv.pid ]; then
if kill -0 $(cat /tmp/tv.pid) >/dev/null 2>&1; then
exit
fi
/var/lib/docker/containers/*/*-json.log {
dateext
daily
rotate 365
compress
delaycompress
missingok
}
#!/bin/sh
#
# You should define BINTRAY_ACCOUNT and BINTRAY_APIKEY here or from the outside
# BINTRAY_ACCOUNT is you Bintray account and BINTRAY_APIKEY, API Key generated under your Bintray profile
# Redefine following variables to match your own usage
RPMS_DIR=RPMS/noarch
BINTRAY_ACCOUNT=hgomez
BINTRAY_REPO=devops-incubator-rpm
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@dreamcat4
dreamcat4 / winpath.sh
Created April 29, 2017 20:01
Change a Unix path in to Windows path for WSL
winpath() {
# get the Windows user path, convert to Unix line endings
user_path=$(echo "$(/mnt/c/Windows/System32/cmd.exe /C echo %HOMEDRIVE%%HOMEPATH%)" | tr -d "\r")
# expand the specified path
target_path=$(readlink -f $1)
# change ~ to $user_path
if grep -q "^/home/" <<< $target_path; then
temp_user_path=$(echo "$user_path" | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|' -e 's|^M$||')
From 966471712184cfb3b067f2ae8dad9d8e2a896cae Mon Sep 17 00:00:00 2001
From: Bearice Ren <bearice@icybear.net>
Date: Tue, 20 Sep 2016 11:52:08 +0800
Subject: [PATCH] add filter-aaaa option
---
src/dnsmasq.h | 3 ++-
src/option.c | 3 +++
src/rfc1035.c | 9 +++++++++
3 files changed, 14 insertions(+), 1 deletion(-)
@dreamcat4
dreamcat4 / dmesg.log
Created January 16, 2020 12:46 — forked from aziraphale/dmesg.log
AGPTEK USB 3.0 HDMI Capture Box (VG0061) hardware information
New USB device found, idVendor=1bcf, idProduct=2c99
New USB device strings: Mfr=1, Product=2, SerialNumber=0
Product: FHD Capture
Manufacturer: VXIS Inc
@dreamcat4
dreamcat4 / docker-cleanup-resources.md
Created January 25, 2020 10:00 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@dreamcat4
dreamcat4 / Otterpill-Blink.md
Created May 26, 2020 16:16 — forked from ansemjo/Otterpill-Blink.md
minimal blink exmaple for the otterpill with platformio and the stm32cube-hal