Skip to content

Instantly share code, notes, and snippets.

@jtfogarty
jtfogarty / v1.sh
Last active February 19, 2022 02:48
CertificateSigningRequest
#!/bin/bash
# SERVICE=vault-server-tls
SERVICE=vault-svc
# NAMESPACE where the Vault service is running.
NAMESPACE=vault
# SECRET_NAME to create in the Kubernetes secrets store.
SECRET_NAME=vault-server-tls
@andrebrait
andrebrait / keychron_linux.md
Last active June 7, 2024 01:27
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active May 28, 2024 20:30
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@intinig
intinig / .clang-format
Last active January 13, 2024 11:56
.clang-format for UE4
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
@ViteFalcon
ViteFalcon / godot-multithreaded-programming.md
Created February 11, 2018 18:59
Godot: Multithreaded Programming

Problem

I wanted to start building the GUI parts of the game, but create it in such a way that I will have a network interface that I can later replace with the actual implementation.

What I did

I created a LoginClient that provides an interface to the login server functions. This client works in an asynchronous manner. Login requests gets queued, which then gets processed by a thread. The fun part was in the details, which I will explain here.

Threads in Godot

I feel this is one of the things that has been least documented in Godot's documentation and few people in Godot's Discord channel have knowledge of how this works.

The general code to create and run a method in a thread looks like this:

@ViteFalcon
ViteFalcon / queue.gd
Created February 11, 2018 10:53
Thread-safe circular buffer queue
extends Node
var array
var size
var start = 0
var end = -1
var mutex = Mutex.new()
signal item_removed
@dyoung522
dyoung522 / kafka-oracle-vm-config.md
Last active June 4, 2024 12:57 — forked from vipmax/kafka install systemd.md
kafka installation with systemd
  1. Install Kafka

    cd /opt
    curl -O http://www.gtlib.gatech.edu/pub/apache/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz
    tar xvzf kafka_2.11-0.11.0.0.tgz
    ln -s kafka_2.11-0.11.0.0/ kafka
  2. Edit /usr/lib/systemd/system/kafka-zookeeper.service

Kafka installation with systemd

0. Create kafka user

sudo adduser kafka
sudo adduser kafka sudo
su -l kafka

1. Download and Install kafka archive

@shreve
shreve / pdfmarks
Last active August 5, 2023 06:44
Example of adding PDF metadata (bookmarks / ToC) with Ghostscript
[ /Title (Elementary Differential Equations)
/Author (Edwards & Penney)
/DOCINFO pdfmark
[ /Title (Contents)
/Page 6
/OUT pdfmark
[ /Count -8
/Title (1. First-Order Differential Equations)