Skip to content

Instantly share code, notes, and snippets.

View cengiz-io's full-sized avatar

Cengiz Can cengiz-io

View GitHub Profile
@r41k0u
r41k0u / debug.md
Last active May 15, 2025 15:21
KGDB on Raspberry Pi 5 running Ubuntu using the Raspberry Pi Debug Probe

TODO: try with linux-image-*-dbgsym package as well, maybe we can cut on the compile time.

Step 1: Compile

  • Taken largely from this, though you can use your own kernel source. You can also do a cross-compilation, refer to the previous link for details on that
  • specify the KERNEL (kernel_2712 in my case). Do make menuconfig instead of the raspi preset defconfigs
  • Enable the KGDB options under Kernel Hacking. I don't remember exactly what flags you need, but the following in .config should set you up for something atleast
    • CONFIG_DEBUG_INFO=y
    • CONFIG_GDB_SCRIPTS=y
    • # CONFIG_DEBUG_INFO_REDUCED is not set
  • CONFIG_KALLSYMS can also be set
@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active May 22, 2025 13:52
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
@cengiz-io
cengiz-io / esbbs.pas
Created July 29, 2022 15:23 — forked from ssg/esbbs.pas
ES BBS Intro
{ ES BBS Intro - 1995 }
{ Binary can be get at http://www.pouet.net/prod.php?which=55705 }
{$M $800,0,655360}
{$N-,E-,F+}
uses Strings,XBuf,XMode;
const
static const struct display_timing tianma_tm050rdzg03_timing = {
.pixelclock = { 29500000, 30000000, 50000000 },
.hactive = { 800, 800, 800 },
.hfront_porch = { 1, 40, 255 },
.hback_porch = { 88, 88, 88 },
.hsync_len = { 1, 48, 255 },
.vactive = { 480, 480, 480 },
.vfront_porch = { 1, 13, 255 },
.vback_porch = { 32, 32, 32 },
.vsync_len = { 3, 3, 255 },
@rcarmo
rcarmo / bt-agent.service
Last active February 19, 2025 12:57
Set up PAN networking on Raspbian Stretch (use sudo to create these files and run all commands)
# in /etc/systemd/system
[Unit]
Description=Bluetooth Agent
[Service]
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Type=simple
[Install]
WantedBy=multi-user.target
@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@fay59
fay59 / Quirks of C.md
Last active May 23, 2025 21:05
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@F21
F21 / signing-gpg-keys.md
Last active May 18, 2025 16:53
Signing someone's GPG key

This is a quick guide of the commands we use to sign someone's GPG key in a virtual key signing party.

Note: The steps cover only the technical aspects of signing someone's key. Before signing someone's key, you must verify their identity. This is usually done by showing government-issued ID and confirming the key's fingerprint

The commands will work for both GPG and GPG2.

I use Julian's key for the examples. His key id is 2AD3FAE3. You should substitute with the appropriate key id when running the commands.

Signing the key

  1. List the keys currently in your keyring: gpg --list-keys.
@hikiko
hikiko / side-by-side-diff.pl
Last active January 17, 2019 11:01
a script I use with claws-mail: https://bit.ly/2JJs5ql
#!/usr/bin/perl
use strict;
use warnings;
use File::Copy qw(copy);
#use X11::Protocol;
my $fname = $ARGV[0];
if(not defined $fname) {
die "No input\n";
}
@matt-bailey
matt-bailey / github-pages-custom-domain-gandi-dns-records.md
Last active December 30, 2024 20:25
How to set up DNS records on gandi.net to use a custom domain on Github Pages

How to set up DNS records on gandi.net to use a custom domain on Github Pages

You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.

Create the following A records:

@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153