Skip to content

Instantly share code, notes, and snippets.

View j1ah0ng's full-sized avatar
🥚
leggo my eggo

j1ah0ng j1ah0ng

🥚
leggo my eggo
View GitHub Profile
@j1ah0ng
j1ah0ng / download.sh
Created March 21, 2020 19:35
syncing from servers
#!/usr/bin/env bash
echo "Please make sure you are running this script from the directory\
you want to download your PA to."
echo -n "The current directory is "
echo -n $(pwd)
echo -n " and contains "
echo -n $(ls -l | wc -L)
echo " files."
echo
@j1ah0ng
j1ah0ng / resolve-net-interface-index.c
Last active March 23, 2020 06:37
quick little program that takes a network interface at argv[1] and gets the Linux interface id
#include <errno.h>
#include <net/if.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef NULL
#define NULL 0
#endif
int main(int argc, char *argv[]) {
@j1ah0ng
j1ah0ng / README.md
Last active June 9, 2022 22:46
Fixing Tiger Lake audio on Thinkpad P15s with ALC257 codec

What this fixed for me

The default settings on my machine would populate pavucontrol and alsamixer with the correct audio sources and sinks, but playing audio would not actually output sound (however, the microphone input would respond properly and record audio). Setting the snd-intel-dspcfg.dsp_driver=1 kernel argument to force the legacy snd_hda_intel driver would allow speakers to work, but this would break the microphone.

Procedure

Hopefully this saves someone else some time - this system is on Ubuntu 22.04. Ensure firmware-sof-signed is installed along with linux-firmware.

@j1ah0ng
j1ah0ng / .zshrc
Created November 20, 2023 19:09
zshrc
alias gd='git diff'
alias gdn='git diff --name-only'
alias gdm='git diff $(git merge-base develop HEAD)'
alias gdmn='git diff $(git merge-base develop HEAD) --name-only'
VI_MODE_SET_CURSOR=true
VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
alias graph='git log --graph --all --pretty=oneline'
alias ggraph='git log --graph --pretty=oneline'
@j1ah0ng
j1ah0ng / init.vim
Created November 20, 2023 19:11
init.vim
set nocompatible " be iMproved, required
filetype off " required
nnoremap <SPACE> <Nop>
let g:mapleader = " "
set relativenumber
filetype plugin indent on " required
" To ignore plugin indent changes, instead use: