Skip to content

Instantly share code, notes, and snippets.

@eclecticc
eclecticc / Ubuntu 22.04 LTS Installation on the Framework Laptop steps
Last active November 26, 2024 12:18
Ubuntu 22.04 LTS Installation on the Framework Laptop steps
# Make sure to update your packages to get the latest kernel
sudo apt update && sudo apt upgrade -y
# To enable headset mic input, edit /etc/modprobe.d/alsa-base.conf
echo "options snd-hda-intel model=dell-headset-multi" | sudo tee -a /etc/modprobe.d/alsa-base.conf
# On some SSDs (e.g. SN750 with older firmware), there is a workaround to improve suspend battery life
sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvme.noacpi=1"/g' /etc/default/grub
# Then refresh the GRUB configuration
@surki
surki / mozilla-rr-ruby.org
Last active January 13, 2022 01:39
mozilla rr setup for ruby

Setup

Install rr

# Install rr dependencies
sudo yum install git python2 ccache cmake make gcc gcc-c++ gdb libgcc glibc-devel libstdc++-devel zlib-devel python27-pexpect man-pages capnproto

# Compile/install capnproto if no package available
curl -O https://capnproto.org/capnproto-c++-0.6.1.tar.gz
tar zxf capnproto-c++-0.6.1.tar.gz
pushd capnproto-c++-0.6.1
@ericnormand
ericnormand / 00_script.clj
Last active February 22, 2025 10:41
Boilerplate for running Clojure as a shebang script
#!/bin/sh
#_(
#_DEPS is same format as deps.edn. Multiline is okay.
DEPS='
{:deps {clj-time {:mvn/version "0.14.2"}}}
'
#_You can put other options here
OPTS='
@SamSaffron
SamSaffron / referring_paths.rb
Last active June 13, 2018 18:36
referring_paths.rb
require 'objspace'
class A
attr_accessor :b
end
class B
attr_accessor :c
end
@serinth
serinth / makefile
Created March 8, 2018 19:21
Golang Makefile
# Basic Makefile for Golang project
# Includes GRPC Gateway, Protocol Buffers
SERVICE ?= $(shell basename `go list`)
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || cat $(PWD)/.version 2> /dev/null || echo v0)
PACKAGE ?= $(shell go list)
PACKAGES ?= $(shell go list ./...)
FILES ?= $(shell find . -type f -name '*.go' -not -path "./vendor/*")
# Binaries
PROTOC ?= protoc
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 3, 2025 07:08 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@yuasatakayuki
yuasatakayuki / ruby_gnuplot_time_series.rb
Last active October 6, 2021 14:50
Plot time-series data using Ruby Gnuplot
require "gnuplot"
data=<<EOS
2016-07-19T23:47:53.432Z 33.2
2016-07-19T23:41:59.558Z 33.1
2016-07-19T23:36:06.183Z 32.9
2016-07-19T23:30:09.101Z 32.7
2016-07-19T23:24:15.936Z 32.6
2016-07-19T23:18:19.082Z 32.4
2016-07-19T23:12:20.944Z 32.4
@staltz
staltz / jsx-quasi.js
Last active May 6, 2024 03:15 — forked from lygaret/index.js
ES6 Quasi-Literal for JSX
define(function(require) {
var React = require('react');
var paramRegex = /__(\d)+/;
var parser = new DOMParser();
var errorDoc = parser.parseFromString('INVALID', 'text/xml');
var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI;
// turns the array of string parts into a DOM
// throws if the result is an invalid XML document.
@kxxoling
kxxoling / locale-c
Created June 8, 2015 04:13
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
AWS_ACCESS_KEY_ID="YOURAWSACCESSKEYID"
AWS_SECRET_KEY="YOURAWSSECRETKEY"
EC2_REGION=$(wget -q -O - http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
EC2_INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
EC2_CLOUDWATCH_NAMESPACE='WebService'
NGINX_CONNECTIONS=$(wget -q -O - http://127.0.0.1/nginx_status | grep 'connections' | awk '{print $3}')
/usr/bin/mon-put-data --region \"$EC2_REGION\" --metric-name HttpConnections --namespace \"$EC2_CLOUDWATCH_NAMESPACE\" --dimensions \"InstanceId=$EC2_INSTANCE_ID\" --value \"$NGINX_CONNECTIONS\" -I \"$AWS_ACCESS_KEY_ID\" -S \"$AWS_SECRET_KEY\"