Skip to content

Instantly share code, notes, and snippets.

View elieux's full-sized avatar

David Macek elieux

View GitHub Profile
@elieux
elieux / guide.md
Last active March 15, 2024 16:25
pacman-sign-guide

have a GPG key

Create your new key: gpg --gen-key more...

Back it up: gpg --export-secret-keys --armor <keyid> > my_key_backup.asc more...

@elieux
elieux / msys2-here-uninstall.reg
Created November 23, 2015 08:32
MSYS2 here context menu items
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW32 here]
@elieux
elieux / midipix.sh
Created June 15, 2016 19:18
Alternative Midipix startup script
#!/bin/sh
prepend_path() {
local _pname _pname_prepend="${1}" IFS=":"
for _pname in ${PATH}; do
if [ "${_pname}" = "${_pname_prepend}" ]; then
return
fi
done
export PATH="${_pname_prepend}${PATH:+:${PATH}}"
@elieux
elieux / aws-vault.lua
Last active August 19, 2022 08:46
clink/completions/aws-vault.lua
local map = require("funclib").map
local strings = require("strings")
local sys = require("sys")
local function profile()
return sys.exec("aws-vault list --profiles")
end
local function backend()
local list = {}
@elieux
elieux / mingw32.cmd
Last active December 26, 2021 23:36
MSYS2 start scripts
@echo off
set MSYSTEM=MINGW32
"%~dp0msys2.cmd" %*
set MSYSTEM=
@elieux
elieux / What happens
Last active December 19, 2019 21:02
mingw-w64 GCC from MSYS2 fails spectacularly
W:\temp\openconnect\_>gcc -c -g -O2 conftest.c
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s: Assembler messages:
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:14: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:14: Error: junk at end of line, first unrecognized character is `-'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:20: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:20: Error: unknown pseudo-op: `.lvu1'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:23: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:23: Error: unknown pseudo-op: `.lvu2'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:24: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:24: Error: unknown pseudo-op: `.lvu3'
@elieux
elieux / index.sql
Created November 20, 2019 12:54
Weird MySQL index thing
SELECT main.id, (
SELECT SUM(group_member.col)
FROM tbl AS group_member
WHERE main.id = group_member.id OR main.parent_id > 0 main.parent_id = group_member.parent_id
) AS col_sum
FROM tbl AS main
ORDER BY id DESC
LIMIT 50;
@elieux
elieux / fifo.c
Created November 19, 2019 09:57
Cygwin vs Linux fifo bug?
/*
* $ gcc -Wall -Wextra -std=c11 fifo.c -o fifo
*
* Linux:
* $ ./fifo
* $ echo $?
* 0
*
* Cygwin:
* $ ./fifo
@elieux
elieux / popt.patch
Last active January 28, 2019 20:57
popt-1.16 opt != NULL patch
--- original/popt-1.16/popt.c 2010-01-19 01:39:10.000000000 +0100
+++ patched/popt-1.16/popt.c 2019-01-28 21:49:43.543620300 +0100
@@ -75,8 +75,7 @@
/*@globals internalState@*/
/*@modifies internalState@*/
{
- if (opt != NULL)
- for (; opt->longName || opt->shortName || opt->arg; opt++) {
+ for (; opt != NULL && (opt->longName || opt->shortName || opt->arg); opt++) {
poptArg arg = { .ptr = opt->arg };
@elieux
elieux / midipix-deps-ubuntu.txt
Created December 24, 2018 12:49
Midipix build dependencies on Ubuntu
Ubuntu 18.04.1 LTS (bionic)
WSL on Windows 10 release 1809 build 17763
sudo apt update
sudo apt upgrade
sudo apt install \
autoconf \
automake \
flex \
g++ \