Skip to content

Instantly share code, notes, and snippets.

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

Jiahong Long j1ah0ng

🥚
leggo my eggo
View GitHub Profile
@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:
@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 / 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 / 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 / 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 / upload.sh
Created March 21, 2020 19:18
syncing to ucsd servers
#!/usr/bin/env bash
echo "Please make sure you are running this script from the directory\
containing your working files."
echo -n "The current directory is "
echo -n $(pwd)
echo -n " and contains "
echo -n $(ls -l | wc -L)
echo " files."
echo
@j1ah0ng
j1ah0ng / config
Created December 16, 2019 05:00
polybar-config
[bar/white]
;------------;
; DIMENSIONS ;
;------------;
width = 100%
height = 20
offset-y = 0
offset-x = 0
border-top-size = 12
border-bottom-size = 0
@j1ah0ng
j1ah0ng / i3-config
Created November 29, 2019 08:25
Dotfiles!
# x env vars
exec --no-startup-id "/home/sushisharkjl/.config/i3/save_dbus.sh"
# mod keys
set $mod Mod4
set $alt Mod1
# Background and HDMI monitor
exec --no-startup-id "xrandr --output HDMI1 --pos 2560x0"
exec --no-startup-id "nitrogen --set-zoom-fill /home/sushisharkjl/Pictures/Wallpapers/wallpaper &"
@j1ah0ng
j1ah0ng / compton.conf
Created October 28, 2019 20:30
Not that disgusting compton configuration for people who like background blurs uwu
# rendering backend
backend = "glx";
glx-no-stencil = true;
glx-copy-from-front = false;
glx-swap-method = "undefined";
glx-use-gpushader4 = true;
# shadows
shadow = true;
no-dnd-shadow = true;
@j1ah0ng
j1ah0ng / .zshrc
Created October 28, 2019 20:29
Equally disgusting zshell configuration for people who enjoy disgusting shell functions and nonextensible configuration
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/.local/bin:$HOME/bin:/usr/local/bin:$PATH
export DEFAULT_USER=$USER
prompt_context() {}
# Path to your oh-my-zsh installation.
export ZSH="/home/sushisharkjl/.oh-my-zsh"