Skip to content

Instantly share code, notes, and snippets.

View sagi's full-sized avatar
Making

Sagi Kedmi sagi

Making
View GitHub Profile
@sagi
sagi / keybase.md
Last active September 23, 2015 06:15

Keybase proof

I hereby claim:

  • I am sagi on github.
  • I am sagi (https://keybase.io/sagi) on keybase.
  • I have a public key whose fingerprint is 7627 F97C 2B14 3C9A 2E05 C1C5 2C43 F831 18F6 0C29

To claim this, I am signing this object:

@sagi
sagi / vboxdrv.sh
Last active October 27, 2017 06:55
vboxdrv Kernel Module Signing on Ubuntu 16.04 (UEFI Secure Boot)
# Secure Boot in Ubunutu: https://wiki.ubuntu.com/SecurityTeam/SecureBoot#Shim_bootloader_signed_with_Microsoft_key
# Ubuntu Kernel notes: https://github.com/Canonical-kernel/Ubuntu-kernel/blob/master/Documentation/module-signing.txt
# We'll have to sign the vboxdrv module because of UEFI's Secure Boot
openssl req -new -x509 -newkey rsa:4096 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Kernel Module Signer/"
$ sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv)
# Add our Machine Owner Key to the trusted keys in Ubuntu's Shim 2nd stage bootloader
$ sudo mokutil --import MOK.der
@sagi
sagi / osx_vbx.sh
Created August 5, 2017 10:25
OSX on VirtualBox vboxmanage
#!/bin/bash
vboxmanage modifyvm "osx" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
vboxmanage setextradata "osx" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
vboxmanage setextradata "osx" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
vboxmanage setextradata "osx" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
vboxmanage setextradata "osx" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
vboxmanage setextradata "osx" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
vboxmanage setextradata "osx" VBoxInternal2/EfiGopMode 5

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@sagi
sagi / click_on_tap_i3_ubuntu_18.04.md
Created October 25, 2018 08:38
Click on Tap for i3, Ubuntu 18.04

Check out the xinput command. xinput list will give you a list of input devices; find the ID of the one which looks like a touchpad. Then do xinput list-props <device id>, which should tell you what properties you can change for the input device. You should find one called something like Tapping Enabled and a number in parens after it (in my case, it's libinput Tapping Enabled (276). Finally, run xinput set-prop <device id> <property id> 1, and tapping should work.

To make the change permanent, find a way to run that command on startup. One way would be to add exec xinput set-prop <device id> <property id> 1 to ~/.i3/config.

@sagi
sagi / debug_latency.sh
Created November 2, 2018 22:29
Debug DNS, TCP, TLS Latency Issues with Curl
curl -w "dns_resolution: %{time_namelookup}, tcp_established: %{time_connect}, ssl_handshake_done: %{time_appconnect}, TTFB: %{time_starttransfer}\n" -o /dev/null -s https://cloudflare-dns.com
@sagi
sagi / reverse.js
Created December 18, 2018 10:03
Reversing a String in Javascript
const reverse = s => (s === '' ? '' : reverse(s.substr(1)) + s.charAt(0));
@sagi
sagi / fzf_config_with_ripgrep_and_fd.sh
Created April 6, 2019 03:20
FZF Config with Ripgrep and Fd (Fast Rust-based CLI tools)
export FZF_DEFAULT_COMMAND="rg --files --no-ignore-vcs --glob '!*/{.git,node_modules}/**'"
export FZF_CTRL_T_COMMAND="rg --files --no-ignore-vcs --glob '!*/{.git,node_modules}/**'"
export FZF_ALT_C_COMMAND="fd --type d --no-ignore-vcs --exclude node_modules --exclude .git"
@sagi
sagi / install_google_fonts.sh
Created April 7, 2019 09:27
Installing Google Fonts on Ubuntu
wget https://raw.githubusercontent.com/hotice/webupd8/master/install-google-fonts && chmod +x install-google-fonts && ./install-google-fonts
@sagi
sagi / sof-audio-setup-carbonx1.sh
Created January 8, 2020 22:37 — forked from hamidzr/sof-audio-setup-carbonx1.sh
Lenovo Carbon X1 Gen 7 - Audio and microphone fix - Arch Linux and kernel 5.3+ required. Updates will be made as they become necessary / available.
#!/bin/bash
## Description
# Lenovo Carbon X1 Gen 7 - Audio and microphone fix - kernel 5.3+ required.
# The script has only been tested for Arch and OpenSuse,
# Original thread: https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/td-p/4489823
# Prereq: Install Linux 5.3 or newer
# NOTE: run this script as root and at your own risk.