Skip to content

Instantly share code, notes, and snippets.

@alxbnct
alxbnct / kernel-dev.md
Created September 8, 2023 02:53 — forked from vegard/kernel-dev.md
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.

@alxbnct
alxbnct / bookmarks.sql
Created September 6, 2023 11:04 — forked from dogancelik/bookmarks.sql
Export Firefox Mobile Bookmarks #Android
/* bookmarks are stored in “/data/data/org.mozilla.firefox/files/mozilla/…….default/browser.db” */
SELECT url, created
FROM bookmarks
WHERE COALESCE(url, '') <> ''
ORDER BY created ASC
@alxbnct
alxbnct / gist:59da6be4f0e0e3f317e3c244e7dfe30a
Created July 17, 2023 14:17 — forked from pwlin/gist:8a0d01e6428b7a96e2eb
Android : add cert to system store
https://code.google.com/p/android/issues/detail?id=32696#c5
If you have a certificate that is not
trusted by Android, when you add it, it goes in the personal cert store.
When you add a cert in this personal cert store, the system requires a
higher security level to unlock the device. But if you manage to add your
cert to the system store then you don't have this requirement. Obviously,
root is required to add a certificate to the system store, but it is quiet
easy.
@alxbnct
alxbnct / yplay.scm
Created March 14, 2023 04:09 — forked from jjwatt/yplay.scm
The Y Combinator explained in a runnable Scheme file
;;; The Y Combinator explained in scheme.
;;; with credits to:
;;; https://mvanier.livejournal.com/2897.html
;;; Status: WIP
(define fibonacci
(lambda (n)
(cond ((= n 0) 0)
((= n 1) 1)
(else (+ (fibonacci (- n 1)) (fibonacci (- n 2)))))))
@alxbnct
alxbnct / ssh-forward-clipboard.md
Created March 8, 2023 02:35 — forked from dergachev/ssh-forward-clipboard.md
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command:

@alxbnct
alxbnct / firewall.sh
Created September 4, 2022 09:50 — forked from furdarius/firewall.sh
Iptables desktop firewall
#!/bin/bash
#Simple Firewall Script.
#Add "pre-up iptables-restore < /etc/iptables.rules" to /etc/network/interfaces
#Setting up default kernel tunings here (don't worry too much about these right now, they are acceptable defaults) #DROP ICMP echo-requests sent to broadcast/multi-cast addresses.
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
#DROP source routed packets
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
#Enable TCP SYN cookies
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
@alxbnct
alxbnct / openbsd_vbox_resolution.sh
Created September 1, 2022 12:59 — forked from kasramp/openbsd_vbox_resolution.sh
Set OpenBSD screen resolution on Virtualbox
#!/bin/sh
# inspired by https://www.tumfatig.net/20190131/customized-resolution-for-openbsd-in-virtualbox/
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
mkdir -p /etc/X11/xorg.conf.d
@alxbnct
alxbnct / host_vbox_custom_resolution.sh
Created September 1, 2022 12:59 — forked from kasramp/host_vbox_custom_resolution.sh
Set screen resolution on Virtualbox (host machine)
#!/bin/sh
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Pass VBox machine name and screen resolution"
echo "Example: 'OpenBSD New' '1920x1080x32'"
exit 1
fi
VBoxManage setextradata "$1" CustomVideoMode1 "$2"
@alxbnct
alxbnct / unbond.conf
Created August 20, 2022 14:37 — forked from MatthewVance/unbond.conf
Example of how to configure Unbound as a local forwarder using DNS-over-TLS to forward queries.
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
cache-max-ttl: 86400
@alxbnct
alxbnct / advanced_search.markdown
Created August 19, 2022 12:08 — forked from dohsimpson/advanced_search.markdown
Advanced Search Tricks

Google

  • "cocotte bag": exact match
  • "* is thicker than water": * to replace a phrase inside exact match
  • jaguar -car: minus to filter out matches
  • site:time.com google: search on site, you don't need '.', e.g. 'site:gov'
  • define:bae: check definition, even for slang
  • $0..$50: numeric range (ignore $)
  • "inbound marketing" ~professional: synonyms
  • related:nationalgeographic.com: similar sites