Skip to content

Instantly share code, notes, and snippets.

View BH1SCW's full-sized avatar

F.J Kong BH1SCW

View GitHub Profile
@BH1SCW
BH1SCW / gpgcryptic.txt
Created April 29, 2022 09:37 — forked from cliffano/gpgcryptic.txt
gpg cryptic errors
I started getting the error below after upgrading to gpg (GnuPG) 2.1.21 .
gpg: signing failed: Timeout
gpg: signing failed: Timeout
This was confusing at first, but the timeout was caused by gpg showing a password prompt that takes the full screen of the terminal, and after a period of time, it returned to the command line showing the timeout error.
I didn't notice the password prompt at first because I was working on multiple terminals and only saw the timeout error at the end.
Another error that I encountered earlier was:
@kwilczynski
kwilczynski / gist:dc69ed5acb27a19ec1e29914895d7666
Last active May 30, 2024 19:15
Install lei for kernel development using lore directly on Ubuntu
apt install -y vim
apt install -y wget
apt install -y sqlite3 (used by a test, not needed for the build to complete)
apt install -y curl
apt install -y git
apt install -y build-essential
apt install -y pkg-config
@RahulDas-dev
RahulDas-dev / Sqlx_Sqlite.rs
Last active February 17, 2023 07:57
Sqlx::Sqlite Integration with Rust
/*
[dependencies]
sqlx = { version = "0.5.9", features = [ "runtime-async-std-native-tls", "sqlite" ] }
async-std = { version = "1.6", features = [ "attributes" ] }
futures = "0.3.18"
*/
use std::result::Result;
use sqlx::{sqlite::SqliteQueryResult, Sqlite, SqlitePool, migrate::MigrateDatabase};
@vegard
vegard / kernel-dev.md
Last active October 30, 2024 03:12
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@ganapathichidambaram
ganapathichidambaram / centos-8_custom_iso_creation.md
Created January 13, 2020 09:50
Creation of CentOS-8 Custom ISO

ISO Creation from Scratch

In this tutorial we are going to look into creation of CentOS ISO based on CentOS 8. There are few slight difference between the folder structure from CentOS 7. In CentOS 7 isolinux contains directly Packages without any parent folder and every rpm will be under single folder. But in CentOS 8 it would segreagated into two separate folder such as BaseOS and AppStream. And those configuration defined on media.repo file present in the iso file.

  • To Create ISO we need to create necessary folder struture like mentioned below.
mkdir -p ~/kickstart_build/isolinux/{BaseOS,AppStream}/Packages
@rikka0w0
rikka0w0 / pxe_tftp_openwrt.md
Last active September 13, 2024 17:58
PXE on OpenWrt with a different TFTP server

In this configuration, DHCP will run on the OpenWrt Box, while the TFTP server (the one serves the boot files) runs on a different computer.

1. Add to /etc/config/dhcp on OpenWrt Box

config boot linux
        option filename 'pxelinux.0'
        option serveraddress '192.168.?.?'
        option servername '?'
@isomorphisms
isomorphisms / gist:3114ab86960656a729a6b4653001aae2
Created November 27, 2019 06:08
how to pull from docker hub using podman/buildah
On void linux.
Under `/etc/containers/` there is a file called `registries.conf`. It is complemented by `man 5 containers-registries.conf`.
Change (for me lines 11-12) which say
[registries.search]
registries = []
@sergei-mironov
sergei-mironov / mosh-nat-server.sh
Created September 15, 2019 20:21
mosh-nat-server.sh
#!/bin/sh
RELAY="$1"
PORT="$2"
echo -n 'nat-hole-punch' | socat STDIN "UDP-SENDTO:$RELAY:$PORT,sourceport=$PORT"
mosh-server new -p "$PORT" | sed -n 's/MOSH CONNECT [0-9]\+ \(.*\)$/\1/g p'
@talkingmoose
talkingmoose / List macOS 32-bit apps.bash
Last active August 26, 2021 11:54
In preparation for macOS 10.15, this list identifies 32-bit apps in the Applications folder and returns the list to an extension attribute in Jamf Pro. The returned list may include Xcode because it contains an app with a non-standard file in place of a binary deep within its app bundle. This may be ignored.
#!/bin/bash
# create a list of paths in the Applications folder for testing
MacOSPaths=$( /usr/bin/mdfind kMDItemKind==Application )
# recurse through the list and create a list of apps with 32-bit binaries
while IFS= read aPath
do
cd "$aPath/Contents/MacOS"
@iafisher
iafisher / bookmarks_from_sql.py
Created March 9, 2019 22:54
Programmatically access your Firefox bookmarks
"""
A script to automatically export bookmarks from Firefox's SQLite database.
There does not seem to be a programmatic way to get Firefox to export its bookmarks in
the conventional HTML format. However, you can access the bookmark information directly
in Firefox's internal database, which is what this script does.
Always be careful when working with the internal database! If you delete data, you will
likely not be able to recover it.