Skip to content

Instantly share code, notes, and snippets.

View elieux's full-sized avatar

David Macek elieux

View GitHub Profile
@elieux
elieux / pacman.conf
Created November 16, 2014 14:21
pacman config
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
@elieux
elieux / 10morespace
Last active April 2, 2017 14:56
morespace.sh
#!/system/bin/sh
#
# MORESPACE - init script to use an ext4-formatted sdcard for both app installations and user data
# Revision: 3
# Author: github.com/elieux
# Device: Huawei Ascend G300 [U8815] with CM11
#
# Warning: The script does not reformat your sdcard. That needs to be done manually before installing the script.
# Warning: The script is not designed for multiple-partition sdcards (sd-ext).
#
@elieux
elieux / Makefile
Last active April 2, 2017 14:56
DLL troubles
all: main.exe
foo.o: foo.c
gcc -c foo.c -o foo.o
libfoo.a: foo.o
ar sr libfoo.a foo.o
bar.o: bar.c
gcc -c bar.c -o bar.o
libbar.dll: bar.o libfoo.a
@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 / segfault.c
Created March 7, 2015 14:20
Instant crash
typedef int(*fn)();
int main() {
return ((fn)0)();
}
@elieux
elieux / make.sh
Last active April 2, 2017 14:46
Debugging makefiles
#/usr/bin/sh
#http://www.drdobbs.com/tools/debugging-makefiles/197003338
make --eval='print-%: ; @echo $* is $($*)' --eval='OLD_SHELL := $(SHELL)' --eval='SHELL = $(warning [$@ ($^) ($?)])$(OLD_SHELL) -x'
make V=1 VERBOSE=1
make --dry-run
@elieux
elieux / msys2-mirror.sh
Last active April 2, 2017 14:45
MSYS2 pacman repos mirroring script
#!/usr/bin/bash
ROOT="$(pwd)"
dl() {
local cookie="/tmp/pacman-mirror-cookie.txt"
touch "${cookie}"
local file
@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
@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 / 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]