Skip to content

Instantly share code, notes, and snippets.

View ohdarling's full-sized avatar
🎯
Focusing

ohdarling88 ohdarling

🎯
Focusing
View GitHub Profile
@RLovelett
RLovelett / README.md
Last active March 19, 2024 12:52
Force RGB instead of YCbCr output for HDMI on Ubuntu

Force RGB pixel format over YCbCr

There are some monitors, in my case Dell U2413, that report having YCbCr support when plugged in over HDMI. My AMD Radeon RX 570 Series video card sees this YCbCr pixel format and then prefers that over the RGB pixel format. The result is that fonts, graphics and other visuals are pixelated and not smooth in Ubuntu.

This actually is not just a Linux problem. A similar problem exists on macOS with the same monitor hooked up over HDMI. In fact an article by John Ruble on the Atomic Object blog called Fixing the External Monitor Color Problem with My 2018 MacBook Pro attempts to fix the exact same thing.

Solution

All of the articles I could find exploring this topic advocate patching the EDID for the monitor. Unfortunately the macOS solution would not work here. Luckily I found a Reddit post that covered how to get it working.

@wsvn53
wsvn53 / vpnc-enable-disable-ping.sh
Last active March 16, 2016 13:03
Auto enbale/disable ping request of gateway, for router check gateway avaliable.
/etc/vpnc/post-connect.d/enable-ping.sh
---------------------------------------
#!/bin/bash
echo "Connected.";
# enable host ping
while [ ! -z "$(iptables -L | grep icmp-net-unreachable)" ]; do
echo "==> delete icmp-net-unreachable";
iptables -D INPUT -p icmp -m icmp --icmp-type echo-request -j REJECT --reject-with icmp-net-unreachable;
done
*.cn DirectConnection
*tmall* DirectConnection
.10010.com DirectConnection
.10050.net DirectConnection
.115.com DirectConnection
.115img.com DirectConnection
.123cha.com DirectConnection
.126.com DirectConnection
.126.net DirectConnection
.163.com DirectConnection
@jonathanmorley
jonathanmorley / regex_golf.md
Last active November 16, 2022 17:42 — forked from jpsim/answers.md
Best possible answers collected so far for [Regex golf](http://regex.alf.nu/). === WARNING: SPOILERS ===
@zellux
zellux / zhihu.recipe
Last active August 9, 2019 16:50
知乎日报 Kindle 版生成工具,可用于 Calibre
#!/usr/bin/env python
__copyright__ = 'Yuanxuan Wang <zellux at gmail dot com>'
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import Tag, NavigableString
from collections import OrderedDict
from contextlib import nested, closing
import json
@chen-hongzhi
chen-hongzhi / gist:5719035
Last active September 23, 2021 10:39
Add self-signed CA certificate to the system's keychain and make it trusted.
SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certData);
status = SecCertificateAddToKeychain(cert, keychain);
if (status == errSecDuplicateItem) {
status = errSecSuccess;
}
if (status == errSecSuccess) {
int allowErr = -2147409654;
SecPolicyRef x509Policy = SecPolicyCreateBasicX509();
@janlay
janlay / whitelist.pac
Last active February 29, 2024 20:23
A white-list based PAC.
/*
* A white-list based PAC without regexp, by @janlay
* It's just simple and fast.
* Last update: Oct 20, 2015
* Special thanks to @Paveo
*/
function FindProxyForURL(url, host) {
// REPLACE PROXY WITH YOUR OWN'S
var PROXY = "SOCKS 127.0.0.1:8801;SOCKS5 127.0.0.1:8801;PROXY 127.0.0.1:8800";
var BLACKHOLE = "127.0.0.2";
@roxlu
roxlu / SSLBuffer.cpp
Created November 2, 2012 11:38
libuv + openssl + SSLBuffer
#include "SSLBuffer.h"
SSLBuffer::SSLBuffer()
:ssl(NULL)
,read_bio(NULL)
,write_bio(NULL)
,write_to_socket_callback(NULL)
,write_to_socket_callback_data(NULL)
,read_decrypted_callback(NULL)
,read_decrypted_callback_data(NULL)
@dav
dav / gist:3738695
Created September 17, 2012 17:40
Script to copy photos/videos into iPhone Simulator
require 'etc'
require 'fileutils'
# Copies the most recent MAX_IMAGES photos/videos from the device image dir.
# I use Dropbox to sync my device images to my workstation disk
MAX_IMAGES=500
USER_HOME_DIR = Etc::getpwuid.dir
DEVICE_IMAGES_DIR="#{USER_HOME_DIR}/Dropbox/Camera Uploads"
SIMULATOR_IMAGES_DIR="#{USER_HOME_DIR}/Library/Application Support/iPhone Simulator/5.1/Media/DCIM/100APPLE"
@uchida
uchida / dlclt.py
Created August 31, 2012 22:22
CUI Downloader of Command Line Tools for Xcode
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# CUI Downloader of "Command Line Tools for Xcode"
# by Akihiro Uchida, CC0 dedicated to the public domain
# see http://creativecommons.org/publicdomain/zero/1.0/
import sys, os
import urllib, urllib2, cookielib
from getpass import getpass
from HTMLParser import HTMLParser