Skip to content

Instantly share code, notes, and snippets.

@caesar
caesar / Thunderbird Launcher.applescript
Last active February 8, 2020 09:44
Automate loading of Thunderbird profile on encrypted disk image (OS X)
-- Thunderbird Launcher app
-- Mounts a disk image before launching Thunderbird, and unmounts it when Thuderbird closes
-- by Caesar Schinas, based on ideas at http://hintsforums.macworld.com/showthread.php?t=26597
on run
set diskname to "Thunderbird Profile"
set diskpath to "~/Library/Thunderbird/Profiles/Thunderbird Profile.sparsebundle"
set itemname to "/Applications/Thunderbird"
tell application "Finder"
if not (exists the disk diskname) then
@linuxgemini
linuxgemini / whois.erl
Last active September 26, 2021 02:22
%% Simple(?) WHOIS Client in Erlang
%% Copyright 2020 İlteriş Yağıztegin Eroğlu (linuxgemini) <new-iwhois@linuxgemini.space>
%% SPDX-License-Identifier: AGPL-3.0-or-later
-module(whois).
-export([query_iana/1,
query_ripe/1,
query_arin/1,
query_afrinic/1,
query_apnic/1,

A pseudonymous trust system for a decentralized anonymous marketplace

Dionysis Zindros, National Technical University of Athens dionyziz@gmail.com

Keywords

pseudonymous anonymous web-of-trust identity trust bitcoin namecoin proof-of-burn timelock decentralized anonymous marketplace openbazaar

Abstract

@memoz
memoz / sjis-emoticons.txt
Created March 7, 2016 05:23
Randomly collected Shift-JIS emoticons
_(:」∠)_
_(:_」∠)_
_(:з」∠)_
_(:зゝ∠)_
╮( ̄▽ ̄)╭
╮( ̄▽ ̄")╭
╮(╯▽╰)╭
(*・ω・)✄╰ひ╯
╮(╯_╰)╭
(ˉ﹃ˉ)
@mjohnsullivan
mjohnsullivan / parse_json.go
Created December 14, 2015 23:17
Parse JSON objects with arbitrary key names in Go using interfaces and type assertions
// Parsing arbitrary JSON using interfaces in Go
// Demonstrates how to parse JSON with abritrary key names
// See https://blog.golang.org/json-and-go for more info on generic JSON parsing
package main
import (
"encoding/json"
"fmt"
)
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@tazjin
tazjin / thoughts.md
Last active February 28, 2024 12:05
Nix builder for Kubernetes
@nh2
nh2 / nixos-rootfs.nix
Last active March 27, 2024 14:34
Example of how to build a NixOS root file system
# Build with:
# NIX_PATH=nixpkgs=$HOME/src/nixpkgs nix-build --no-link '<nixpkgs/nixos>' -A config.system.build.tarball -I nixos-config=thisfile.nix
# You can also use
# -A config.system.build.toplevel
# to build something you can browse locally (that uses symlinks into your nix store).
{config, pkgs, ...}:
{
# We need no bootloader, because the Chromebook can't use that anyway.
boot.loader.grub.enable = false;
@Brainiarc7
Brainiarc7 / skylake-tuning-linux.md
Last active March 30, 2024 16:01
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

@Mnkai
Mnkai / README.md
Last active April 13, 2024 14:11
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and turbo parameter modification with MSR on non-overclockable CPU

Disclaimer

  • MSR modification may void your CPU's (or system board's) warranty. Proceed with care. I'm not responsible for any destruction caused by this article.
  • MSR address (greatly) differs from CPU to CPU. Check your own CPU's MSR address using Intel's documentation.
  • Only tested on Intel i7-8550U (Kaby Lake R).
  • This article is translation of this article. If you can understand Korean, I recommend reading that article, not this.

Start