Skip to content

Instantly share code, notes, and snippets.

smac89 /
Last active Jun 19, 2021
Linux Fix Fastboot "no permissions, verify udev rules"

Determine your device id

  1. Unplug your device from the computer and type lsusb in the terminal. You should get an output similar to this:
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
smac89 /
Created May 28, 2021 — forked from matthewjberger/
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

smac89 /
Created May 16, 2021
Git sparse checkout a folder from specific branch

The goal

Checkout the llvm folder from the release/11.x branch in

My process

git init llvm-project
cd llvm-project
git remote add origin
git fetch --depth=1
git config core.sparseCheckout true
smac89 /
Last active May 14, 2021
Updating all packages installed by various package managers (brew, sdkman, gem, pip, etc)


brew update && brew upgrade $(brew outdated)


sdk selfupdate && sdk upgrade <package>


gem update $(gem list | cut -d' ' -f1)


smac89 / immutable-stack.scala
Last active May 4, 2021 — forked from lambda-hacker/immutable-stack.scala
Stack using List [Scala]
View immutable-stack.scala
// Immutable Stack Type using List
case class Stack[A] (elems: Seq[A] = List.empty[A]) {
def push(v: A) : Stack[A] = Stack(v +: elems)
def pushAll(xs: Iterable[A]) : Stack[A] =
xs.foldLeft (this) ((accStack, e) => accStack.push(e))
def pop(): Either[String, (A, Stack[A])] = {
if (isEmpty) Left("Cannot pop from empty stack")
smac89 /
Last active Feb 18, 2021
Extended Euclidean Algorithm in Python (Without recurrsion)
import math
# Taken in part from:
def gcdExtended(a, b):
Calculates the GCD of the two given numbers, as well as the coefficients x and y
such that ax + by = gcd(a,b). This is useful in cryptography
smac89 / Restoring
Last active Feb 11, 2021
Linux Desktop User: Sane defaults
View Restoring

Being a Linux desktop user is not easy, but it doesn't have to be difficult.

Enabling persistent journals

This is especially useful for collecting logs of system issues.
smac89 /
Last active Jan 24, 2021
A simple implementation of a JavaFX observable stack
* The MIT License (MIT)
* Copyright (c) 2015 Smac89
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: