Skip to content

Instantly share code, notes, and snippets.

View openglfreak's full-sized avatar

Torge Matthies openglfreak

View GitHub Profile
@openglfreak
openglfreak / keybase.md
Created December 19, 2017 06:22
Keybase proof

Keybase proof

I hereby claim:

  • I am openglfreak on github.
  • I am openglfreak (https://keybase.io/openglfreak) on keybase.
  • I have a public key ASCALhHA0WnG8nc40x4xsU3T40cmK3RwWi49YsubxOmk6wo

To claim this, I am signing this object:

@openglfreak
openglfreak / razer-driver-mode.sh
Last active January 28, 2019 13:39
Script that sets the openrazer driver device mode of connected Razer devices to 'driver'.
#!/bin/sh
:<<'EOF'
Copyright © 2018 Torge Matthies <openglfreak@googlemail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
EOF
LOG_DEBUG="${LOG_DEBUG:-0}"
LOG_INFO="${LOG_INFO:-1}"
#!/bin/sh
:<<'EOF'
Copyright © 2018 Torge Matthies <openglfreak@googlemail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
EOF
# Lists the UUIDs of installed Nvidia GPUs (including the leading "GPU-")
#
@openglfreak
openglfreak / sed_escape_replacement.sh
Created January 31, 2019 11:58
Escape a string for use as/in a sed replacement.
# Escapes a string for use as/in a sed replacement
# https://stackoverflow.com/a/2705678
sed_escape_replacement() {
sed -e 's/[\/&]/\\&/g' -e 's/$/\\n/g' | tr -d '\n' | head -c -2
}
@openglfreak
openglfreak / efistubmgr.conf
Last active April 2, 2021 17:17
My own EFISTUB setup/update script - Development has moved to https://github.com/openglfreak/efistubmgr
VERBOSE=1
_cmdline_quiet='quiet vga=current loglevel=3 rd.systemd.show_status=auto rd.udev.log_priority=3'
_cmdline_misc='rw splash add_efi_memmap threadirqs sysrq_always_enabled=1 systemd.unified_cgroup_hierarchy=1'
_cmdline_nospec='pti=off nopti spectre_v1=off nospectre_v1 spectre_v2=off nospectre_v2 spectre_v2_app2app=off nospectre_v2_app2app l1tf=off nol1tf kvm-intel.vmentry_l1d_flush=never spec_store_bypass_disable=off nospec_store_bypass_disable no_stf_barrier mitigations=off clearcpuid=514'
_cmdline_perf='nowatchdog nmi_watchdog=0 intel_iommu=igfx_off workqueue.power_efficient=0 intel_pstate=hwp_only libahci.ignore_sss=1 scsi_mod.use_blk_mq=1 cryptomgr.notests elevator=bfq noreplace-smp page_alloc.shuffle=1 rcupdate.rcu_expedited=1 skew_tick=1'
_cmdline_gfx='i915.fastboot=1 i915.modeset=1 i915.enable_fbc=0 i915.enable_guc=0 i915.alpha_support=1 i915.disable_power_well=1 i915.lvds_channel_mode=2 nouveau.modeset=0 nvidia-drm.modeset=1'
_cmdline_fixes='acpi_osi=Linux acpi_sleep=nonvs iomem=relaxed slab_c
@openglfreak
openglfreak / fwaitm.py
Last active May 23, 2020 21:30
Python module for using Linux's futex() syscall, and in particular the FUTEX_WAIT_MULTIPLE operation.
#!/usr/bin/env python3
# Copyright (c) 2020 Torge Matthies
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
@openglfreak
openglfreak / tablet-area.sh
Created August 27, 2020 07:03
A small shell script for setting the area of a tablet through xinput/libinput, and making the setting permanent in xfconf (XFCE).
#!/bin/sh
: <<'EOF'
Copyright © 2020 Torge Matthies <openglfreak@googlemail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
EOF
### Settings ###
@openglfreak
openglfreak / disable-sincos.patch
Created May 13, 2021 20:24
Fix for MinGW GCC 11.1 generating calls to sincos.
diff --git a/gcc/config/i386/mingw-w64.h b/gcc/config/i386/mingw-w64.h
index 0cec6b0..4fcf719 100644
--- a/gcc/config/i386/mingw-w64.h
+++ b/gcc/config/i386/mingw-w64.h
@@ -98,9 +98,3 @@ along with GCC; see the file COPYING3. If not see
%{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
" LINK_SPEC_LARGE_ADDR_AWARE "\
%(shared_libgcc_undefs)"
-
-/* Enable sincos optimization, overriding cygming.h. sincos, sincosf
static void test(void)
{
GLenum glerr;
bool has_error = false;
GLuint tex[2];
PFNGLXCOPYIMAGESUBDATANVPROC p_glXCopyImageSubDataNV;
#define check() \
while ((glerr = glGetError()) != GL_NO_ERROR) { \
has_error = true; \
w_try_mv()
{
mv_src="${*: -2:1}"
mv_dst="${*: -1:1}"
if [ "${mv_src^^}" != "${mv_dst^^}" ]; then
w_try mv "$@"
return
fi