Skip to content

Instantly share code, notes, and snippets.

View elieux's full-sized avatar

David Macek elieux

View GitHub Profile
@elieux
elieux / test.c
Created February 4, 2017 17:12
Cygwin unlinked /proc/self/fd/* is ENOENT
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <alloca.h>
int main() {
char path[] = "tmp";
int r;
@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 / cgywin-stacktrace.txt
Created December 9, 2015 22:35
Cygwin master fork failure stacktrace
crash/abort
???
smallprint.cc:337 __small_vsprintf(...)
else if (sys_wcstombs (tmp, NT_MAX_PATH, us->Buffer,
us->Length / sizeof (WCHAR)))
...
@elieux
elieux / lld.c
Created December 2, 2015 13:15
mingw-w64 %lld example
/* gcc -ggdb -Wall -Wextra -pedantic "lld.c" -o "lld.exe" */
#define __USE_MINGW_ANSI_STDIO 1
#include <stdio.h>
int main() {
long long int answer = 42;
printf("The answer is: %lld\n", answer);
@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 / PKGBUILD
Created November 3, 2015 15:55
makepkg bug?
pkgname=boo
pkgver=0
pkgrel=1
arch=('any')
package() {
echo --with-arch=${_arch}
}
@elieux
elieux / Unserializer.php
Last active April 2, 2017 14:40
PHP Unserializer
<?php
/*
* Custom PHP unserializer with better error reporting
*
* Does not support objects.
*/
class Unserializer {
private $serialized;
private $len;
@elieux
elieux / PKGBUILD
Created May 21, 2015 22:40
Finch MSYS2 package
pkgname=finch
pkgver=2.10.11
pkgrel=1
pkgdesc="To help recreate my issue"
arch=('i686' 'x86_64')
url="http://pidgin.im"
license=('GPL')
depends=('libgnutls')
makedepends=('libgnutls-devel')
source=("http://downloads.sourceforge.net/pidgin/pidgin-2.10.11.tar.bz2")
From f7a540110b276fd4380ceaa72f42c0119d8d8610 Mon Sep 17 00:00:00 2001
From: David Macek <david.macek.0@gmail.com>
Date: Tue, 12 May 2015 00:08:11 +0200
Subject: [PATCH] Remove FILE_OPEN_FOR_BACKUP_INTENT
---
winsup/cygwin/exceptions.cc | 6 +++---
winsup/cygwin/fhandler.cc | 2 +-
winsup/cygwin/fhandler_disk_file.cc | 32 ++++++++++++++++----------------
winsup/cygwin/fhandler_procsys.cc | 4 ++--
@elieux
elieux / msys2-gen-pkg-spreadsheet.sh
Created May 6, 2015 11:08
MSYS2 package spreadsheet generation script
#!/usr/bin/bash
scrape_db() {
local var=$1
local file=$2
local url=$3
[ "$DB_UPDATE" != 'no' ] && wget -nv -O /tmp/$file $url >&2
while read pkg ver; do