Skip to content

Instantly share code, notes, and snippets.

As a work colleague asked me about how I setup my "multi-live-system-thumbdrive": As a base I installed https://grml.org/ but I am sure another system using grub2 would also work. This installed grub on my USB thumbdrive with a rather simple main grub.cfg:

## grub2 configuration
source /boot/grub/header.cfg

insmod regexp

for config in /boot/grub/*_default.cfg ; do source "$config" ; done
for config in /boot/grub/*_options.cfg ; do source "$config" ; done
@Aerocatia
Aerocatia / PKGBUILD
Last active September 1, 2021 16:38
Arch Linux mingw-w64-harfbuzz 2.9.0
# Maintainer: pingplug < aur at pingplug dot me >
# Contributor: Schala Zeal < schalaalexiazeal at gmail dot com >
_commit=9aa6f8a93f035dd0a1e3978da495d830049480c8 # tags/2.9.0
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
pkgbase=mingw-w64-harfbuzz
pkgname=('mingw-w64-harfbuzz' 'mingw-w64-harfbuzz-icu')
pkgver=2.9.0
pkgrel=2
#!/usr/bin/python3
import argparse
import os
import os.path
import pathlib
import struct
import sys
import fileinput

Paste text on VNC terminal that don't allow copy-paste

  • Prepare script on terminal
  • Copy data
  • Run script
  • Move focus to destination target
  • Script will 'type' for you
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@brasey
brasey / Configure systemd-resolved to use a specific DNS nameserver for a given domain.md
Created October 25, 2019 14:38
Configure systemd-resolved to use a specific DNS nameserver for a given domain

Configure systemd-resolved to use a specific DNS nameserver for a given domain

Use case

Given

  • I use a VPN to connect to my work network
  • I'm on a Linux computer that uses systemd-resolved
  • I have a work domain called example.com
  • example.com is hosted by both public and private DNS nameservers
@kraih
kraih / local_lib.txt
Created June 5, 2019 11:54
Use multiple versions of the same Perl library with local::lib
$ cpanm -Lperltidy_new Perl::Tidy
--> Working on Perl::Tidy
...
1 distribution installed
$ cpanm -Lperltidy_old Perl::Tidy@20181120
--> Working on Perl::Tidy
...
1 distribution installed
@okurz
okurz / test_ssh.pl
Created February 25, 2019 21:27
test_ssh.pl
use strict;
use warnings;
use Net::SSH2;
my %args = (hostname => 'myhost', password => 'XXX', username => 'root');
my $ssh = Net::SSH2->new;
sub get_ssh_output {
my ($chan) = @_;
@facontidavide
facontidavide / unordered_with_string_view.cpp
Last active June 6, 2023 22:22
Use std::string_view to find() an element in std::unordered_map<string,T>, avoiding potential memory allocations
#include <iostream>
#include <cstring>
#include <unordered_map>
// https://github.com/martinmoene/string-view-lite
#include "string_view.hpp"
template <typename Value>
class StringMap: public std::unordered_map<std::string, Value>
{
public:

Building a mingw-w64 GCC cross-compiler with nixcrpkgs: instructions for Terry, October 2018

  1. Install Nix, the functional package manager. You'll need Linux (but macOS might work too).
  2. Make sure you have at least 4 GB of free space available for /tmp and a few GB of free space available for /nix.
  3. To get my recipes, run: git clone https://github.com/DavidEGrayson/nixcrpkgs && cd nixcrpkgs && git checkout 4f7b11d That commit is the current tip of the dev/david/2019 branch.
  4. To build a i686-w64-mingw32 C/C++ cross-compiling toolchain and a hello world program, run: nix-build -A win32.hello
  5. To build Qt and its examples, run: nix-build -A win32.qt.examples
  6. To just build the toolchain itself, run: nix-build -A win32.gcc