Skip to content

Instantly share code, notes, and snippets.

@j-keck
j-keck / readme.md
Created February 7, 2021 08:53 — forked from rometsch/BH456A_linux_driver.md
MPOW BH456A Bluetooth USB Adapter Kernel Module Adjustements (Realtek RTL8761B chip)

Problem

The MPOW Bluetooth 5 dongle (Model: BH456A) does not work out of the box on Ubuntu 20.04 (kernel 5.4.0-42).

Solution

Patch the bluetooth kernel module and copy the firmware binaries to /lib/firmware.

Copy the fimware

@j-keck
j-keck / angular-install.sh
Created December 16, 2020 08:31 — forked from StephenFluin/angular-install.sh
Install Angular on a *nix system
# NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 10
# Yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
@j-keck
j-keck / aws-sqs.policy
Created October 1, 2020 14:29 — forked from marcelog/aws-sqs.policy
SQS Policy to allow an S3 bucket to publish messages
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@j-keck
j-keck / aws-sqs.policy
Created October 1, 2020 14:29 — forked from marcelog/aws-sqs.policy
SQS Policy to allow an S3 bucket to publish messages
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@j-keck
j-keck / gist:79387ce27ae2534c362d480d219a795a
Last active December 1, 2023 08:24
kubectl get all --everything
kubectl api-resources --verbs=list --namespaced -o name | while read name; do echo -e "\n$name:"; kubectl get -A --show-kind $name;done
@j-keck
j-keck / covid19.sc
Last active June 10, 2020 12:02
small ammonite script to fetch covid19 datasets from https://pavelmayer.de/covid/risks/
//
// covid19 dataset from https://pavelmayer.de/covid/risks/
//
// amm script.sc fetch : fetch the actual day
// amm script.sc cron : fetch every 24 hours
// amm script.sc show <region>: show the last dataset for <region> (default: Ortenaukreis)
// amm script.sc list <region>: list all datasets for <region> (default: Ortenaukreis)
//
import $ivy.`org.http4s::http4s-blaze-client:0.21.4`
import $ivy.`co.fs2::fs2-core:2.2.1`
import sbt._
import sbt.Keys._
import sbtassembly.AssemblyPlugin, AssemblyPlugin.autoImport._
object ProguardKeys {
val proguard = taskKey[File]("builds the proguarded jar file")
val proguardOptions = settingKey[Seq[String]]("CLI options")
val proguardVersion = settingKey[String]("proguard's artefact version")

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

@j-keck
j-keck / pg-fsync.stp
Last active May 4, 2017 05:58
simple postgres io statistics
#!/usr/bin/env stap
#
# logs sync events triggered from postgres
#
#
# example output:
#
# = table insert =
#
@j-keck
j-keck / nixos-as-bhyve-guest.md
Last active November 5, 2024 08:38
nixos as bhyve guest

create a vm

root@main:~ # vm create -t debian -s 100G nixos
root@main:~ # vm iso /stuff/downloads/nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso 
root@main:~ # vm -f install nixos nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso

boot the image

determine the 'init' executable path from '(cd0)/isolinux/isolinux.cfg'. look for a line which start's with: 'APPEND init=/nix/store/.....'