Skip to content

Instantly share code, notes, and snippets.

View gptlang's full-sized avatar

gptlang

View GitHub Profile
#!/usr/bin/env python3
from struct import unpack
from bcc import BPF
from socket import if_indextoname
C_BPF_KPROBE = """
#include <net/sock.h>

Global

:h[elp] keyword - open help for keyword
:sav[eas] file - save file as
:clo[se] - close current pane
:ter[minal] - open a terminal window
K - open man page for word under the cursor

Cursor movement

document.addEventListener("DOMContentLoaded", () => {
// we will check if the user accepted the terms or not
const userAcceptedTerms = localStorage.getItem("termsAccepted");
if (userAcceptedTerms !== "true") {
// if the user did not accept the terms, we will redirect him to the terms page
window.location.href = "/terms.html";
}
const socket = io();
@gptlang
gptlang / bingimagecreator.docs.md
Created November 1, 2023 15:18
Bing Image Creator: Updated instructions

Bing Image Creator

The docs at https://github.com/acheong08/BingImageCreator/ is outdated and the repository is archived. That does not mean the library no longer works.

The main issue most will encounter is that the _U cookie will no longer work by itself. I apologize for the incomplete documentation despite supporting this feature all along.

You will need Cookie Editor for Chrome or for Firefox

Microsoft Edge is also preferred as Bing can sometimes discriminate.