Skip to content

Instantly share code, notes, and snippets.

@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active May 3, 2024 20:14
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
@OmarAlkousa
OmarAlkousa / Signal_Generator_class.py
Last active February 29, 2024 04:41
Building a class to generate sinusoidal signals
# Import the required package
import numpy as np
# Building a class Signal for better use.
class Signal:
"""
Generate sinusoidal signals with specific ampltiudes, frequencies, duration,
sampling rate, and phase.
Example:
@mauron85
mauron85 / dd-wrt-transparent-proxy.sh
Last active October 22, 2023 11:57
Transparent proxy for openwrt using tinyproxy & redsocks
#!/bin/sh
# https://crosp.net/blog/administration/routing-network-traffic-through-socks5-proxy-using-dd-wrt/
# https://serverfault.com/questions/200635/best-way-to-clear-all-iptables-rules
PROXIFYING_MACHINE=192.168.82.192
MACHINE_TO_PROXIFY=192.168.83.0/24
NETWORK=192.168.83.0/24
WAN_IP=192.168.81.1
iptables -I PREROUTING 1 -t mangle -s $MACHINE_TO_PROXIFY ! -d $NETWORK -p tcp -m multiport --dports 80,443 -j MARK --set-mark 3
@02015678
02015678 / Resistor_Verilog-AMS.v
Created April 17, 2015 16:38
Resistor Model in Verilog-A, used in Cadence Virtuoso
`include "discipline.h"
module polyres_hdl (n2, n1, ctrl2, ctrl1);
//(wr, lr, rtemp, jc1a, jc1b, jc2a, jc2b, tc1, tc2, etch, tnom, rsh0, rmaxvcoef, rminvcoef)
electrical n2, n1, ctrl2, ctrl1;
parameter real lr=0.0;parameter real wr=0.0;
parameter real rtemp=($temperature - 273.15);
parameter real jc1a = 0;parameter real jc1b = 0;
parameter real jc2a = 0;parameter real jc2b= 0;
@sogko
sogko / app.js
Last active November 8, 2022 12:31
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@Integralist
Integralist / 1. TCO description.md
Last active January 20, 2020 13:32
JS Tail Call Optimisation

The problem

If a function calls itself recursively then the JavaScript engine has to create a new 'stack' (i.e. allocate a chunk of memory) to keep track of the function's arguments.

Let's look at an example of this happening:

function sum(x, y) {
    if (y > 0) {
      return sum(x + 1, y - 1);
@thomir
thomir / svg2png.py
Created December 21, 2013 22:21
Various ways to convert SVG -> PNG
#!/usr/bin/env python
"""Convert an SVG file to a PNG file."""
from argparse import ArgumentParser
import subprocess
import os.path
def main():
@lg0
lg0 / toggleiTerm2icon
Last active January 11, 2018 02:51
show/hide iTerm2 Dock icon
# toggle iTerm Dock icon
# add this to your .bash_profile or .zshrc
function toggleiTerm() {
pb='/usr/libexec/PlistBuddy'
iTerm='/Applications/iTerm.app/Contents/Info.plist'
echo "Do you wish to hide iTerm in Dock?"
select ync in "Hide" "Show" "Cancel"; do
case $ync in
'Hide' )
@unapersona
unapersona / transfinish.sh
Created August 10, 2012 09:26
Pushover notification on Transmission file completed
#!/bin/sh
curl -s \
-F "token=APP_TOKEN" \
-F "user=USER_TOKEN" \
-F "title=Download Finished" \
-F "message=$TR_TORRENT_NAME: $TR_TIME_LOCALTIME" \
http://api.pushover.net/1/messages > /dev/null
@Gozala
Gozala / example.js
Created January 29, 2012 03:46
Workaround for lack of "tail call optimization" in JS
// Lack of tail call optimization in JS
var sum = function(x, y) {
return y > 0 ? sum(x + 1, y - 1) :
y < 0 ? sum(x - 1, y + 1) :
x
}
sum(20, 100000) // => RangeError: Maximum call stack size exceeded
// Using workaround