Skip to content

Instantly share code, notes, and snippets.

@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active September 12, 2024 23:46
Hacking the LG Monitor's EDID

preface: Posting these online since it sounds like these notes are somewhat interesting based on a few folks I've shared with. These are semi-rough notes that I basically wrote for myself in case I ever needed to revisit this fix, so keep that in mind.

I recently bought an LG ULTRAGEAR monitor secondhand off of a coworker. I really love it and it's been great so far, but I ran into some minor issues with it in Linux. It works great on both Mac and Windows, but on Linux it displays just a black panel until I use the second monitor to go in and reduce the refresh rate down to 60 Hz.

This has worked decent so far but there's some issues:

  • It doesn't work while linux is booting up. The motherboards boot sequence is visible just fine, but as soon as control is handed over to Linux and I'd normally see a splash screen while I'm waiting for my login window, I see nothing.
  • It doesn't work on the login screen. This would be fine if login consistently worked on my second screen, but I need to manually switch
@kendallroth
kendallroth / ignore_diffs.md
Created January 24, 2022 17:43
Exclude files from Gid diff

Some projects may have files that should be skipped in Git diff but still show in Git status (and be tracked). This can be made possible with a custom diff driver that uses a no-op command.

Adapted from StackOverflow - @KurzedMetal.

Custom diff driver

Create a global no-op diff command driver with the following command. Note that driver can be limited to local respository by removing the --global flag.

git config diff.nodiff.command /bin/true
@coolreader18
coolreader18 / segfault.py
Last active March 30, 2024 08:05
CPython segfault in 5 lines of code
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
(function(){
let arr = document.getElementsByTagName("a");
let arrL = arr.length;
for(let i=0; i<arrL; i++){
arr[i].removeAttribute("data-lynx-uri");
}
})();
@ibraheem4
ibraheem4 / postgres-brew.md
Last active October 14, 2024 11:59 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active November 11, 2024 14:18
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@tasdikrahman
tasdikrahman / irssi.md
Last active September 17, 2024 19:56
irssi cheatsheet
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@thomasdarimont
thomasdarimont / readme.md
Last active October 30, 2024 03:31
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@babldev
babldev / decode_flask_cookie.py
Last active December 15, 2023 12:02
Decode a Flask Session cookie, given the cookie and secret key