Skip to content

Instantly share code, notes, and snippets.

@adrienthebo
adrienthebo / readme.md
Created February 22, 2023 17:53 — forked from legowerewolf/readme.md
Tailscale on Steam Deck

Tailscale on the Steam Deck

This process is derived from the [official guide][official-guide], but lightly tweaked to make the process smoother and produce an installation that comes up automatically on boot (no need to enter desktop mode) and survives system updates.

Installing Tailscale

⚠️ This process will probably fail if you are accessing the terminal over Tailscale

@adrienthebo
adrienthebo / text.md
Last active November 27, 2019 15:04
Fancy text shell

Terminal emulator:

  • iterm2: pretty standard, easy to use, looks nicer
  • alacritty: more complex to install and build but I liked running it and it pairs well with tmux.

Fonts

There are customized fonts that add special characters, it's not strictly useful but it's very good looking. Powerline characters are some of those extra characters that add the diamonds to your terminal. I like "Source Code Pro Powerline" and "Ubuntu Mono Powerline""

https://github.com/ryanoasis/nerd-fonts

control 'project-bindings' do
projects.each do |project|
describe command("gcloud projects get-iam-policy #{project} --format='json(bindings)'") do
its('exit_status') { should eq 0 }
its('stderr') { should eq '' }
let(:members) do
bindings = JSON.parse(subject.stdout, symbolize_names: true)[:bindings]
bindings.find { |b| b[:'role'] == projectRoles[0] }[:members]
end
function docker() {
command docker info 2>&- 1>&-
if [[ $? -eq 1 ]]; then
echo "-- Loading docker configuration - this may take a few seconds..."
eval $(docker-machine env default)
fi
command docker $@
}
OUTPUT_OBJECT_PATTERN = re.compile(r"""
^output\s+ # Terraform `output` object declaration
"(?P<objname>.*?)"\s* # Variable name, within quotes - non-greedy match within quotes
\{\s* # Opening brace
(?: # Order independent matching of variable fields
(?: # Attempt to extract the description field
description\s* # Match 'description' literal
=\s* # Match '=' literal
"(?P<desc>.*?)"\s* # Match and capture quoted string
)
#!/bin/sh
set -u
set -e
export RPI_FW_REV=$(zcat /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | sed -n '/.*firmware as of [0-9a-fA-F]\+/ {s/.*firmware as of \([0-9a-fA-F]\+\)/\1/;p;q}')
echo "Raspberry Pi 3 Firmware revision: $RPI_FW_REV"
export RPI_LINUX_REV=$(wget https://raw.github.com/raspberrypi/firmware/$RPI_FW_REV/extra/git_hash --quiet -O -)
echo "Raspberry Pi 3 Linux kernel revision: $RPI_LINUX_REV"
@adrienthebo
adrienthebo / ruby187-no-sslv3.patch
Created May 12, 2017 19:24
ruby 1.8.7-p374 sans SSLv3
diff --git ext/openssl/extconf.rb ext/openssl/extconf.rb
index 3f9ef511f3..e2eb0764bd 100644
--- ext/openssl/extconf.rb
+++ ext/openssl/extconf.rb
@@ -103,6 +103,9 @@ end
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
void Reader::teardown() {
if (_read_ptr) {
/* This provides some basic RAII functionality for the pants on head logic that is libpng.
* libpng provides a single function for releasing structs allocated for reading a
* png and uses multiple arguments for destroying these structs.
*
* Here's the story on what's actually happening here.
*
* 1. If `_read_ptr` is null then nothing has been initialized at all so we have
* nothing to tear down. Life is simple.
/*
* The peripheral base offset varies between the RPi 2 and 3.
* * RPi 2: 0x20000000
* * RPi 3: 0x3F000000
*/
#define BCM2708_PERI_BASE 0x3F000000
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO controller */
#define PAGE_SIZE (4*1024)
def flatten_structure(path, structure)
results = {}
if structure.is_a? Hash
structure.each_pair do |name, value|
new_path = "#{path}_#{name}".gsub(/\-|\//, '_')
results.merge! flatten_structure(new_path, value)
end
elsif structure.is_a? Array
structure.each_with_index do |value, index|