Skip to content

Instantly share code, notes, and snippets.

View surface-temperature.py
#!/usr/bin/env python3
import json
import subprocess
import time
cputool = '/home/hasse/.local/share/gnome-shell/extensions/cpupower@mko-sl.de/src/cpufreqctl'
turbo_output = subprocess.check_output([cputool, 'turbo', 'get']).decode().strip()
if turbo_output != '0' and turbo_output != '1':
View dll.py
import sys
import subprocess
import os
import shutil
import re
old_dll = ""
def copy_dlls(binary):
print("\nChecking " + binary)
View wxNO_UNSAFE_WXSTRING_CONV2.patch
diff --git a/include/wx/string.h b/include/wx/string.h
index a4e682b8ff..ad0cc200a2 100644
--- a/include/wx/string.h
+++ b/include/wx/string.h
@@ -17,6 +17,8 @@
#ifndef _WX_WXSTRING_H__
#define _WX_WXSTRING_H__
+#define wxNO_UNSAFE_WXSTRING_CONV2 1
+
View gist:d6b5701e4758fcc02735016b7f3ab480
# pacman -Syu --needed --noconfirm --noprogressbar meson gcc sdl2 pkg-config fontconfig glew libwebp openal libvorbis boost
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
:: Starting full system upgrade...
resolving dependencies...
:: There are 2 providers available for libgl:
:: Repository extra
1) libglvnd 2) nvidia-340xx-utils
@jhasse
jhasse / tasks.json
Created September 12, 2017 08:13
Visual Studio Code task for cargo
View tasks.json
{
"version": "2.0.0",
"windows": {
"command": "C:\\msys64\\usr\\bin\\bash"
},
"linux": {
"command": "/bin/bash"
},
"args": ["-lc", "cd \"\"${workspaceRoot}\"\" && cargo $0 && $@"],
"options": {
View windows.py
try:
import msvcrt
import atexit
import ctypes
from ctypes import wintypes
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
# input flags
ENABLE_PROCESSED_INPUT = 0x0001
ENABLE_LINE_INPUT = 0x0002
View gist:98721288d10ebc74d0f849036eaeef51
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007fbb3a7d191c in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
#2 0x00007fbb3a7d1eb4 in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
#3 0x00007fbb3a7d4b56 in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
#4 0x00007fbb39c5ed98 in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
#5 0x00007fbb39c08f64 in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
#6 0x00007fbb39c09167 in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
#7 0x00007fbb3891f05f in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
#8 0x00007fbb398301b7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
View gist:a1c78015de240618f31c0f905e86deb0
~/git/rust-opengl-test (master) $ ulimit -c unlimited
~/git/rust-opengl-test (master) $ cargo run
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/rust-opengl-test`
Prefix path: /home/jhasse/git/rust-opengl-test
error: Process didn't exit successfully: `target/debug/rust-opengl-test` (signal: 11, SIGSEGV: invalid memory reference)
~/git/rust-opengl-test (master) $ ls /var/lib/systemd/coredump/
~/git/rust-opengl-test (master) $
View gist:e34c9bb18971e333734f856210987f71
(gdb) run
Starting program: /home/jhasse/.cargo/bin/cargo run
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/rust-opengl-test`
Prefix path: /home/jhasse/git/rust-opengl-test
error: Process didn't exit successfully: `target/debug/rust-opengl-test` (signal: 11, SIGSEGV: invalid memory reference)
[Inferior 1 (process 2907) exited with code 0145]
(gdb) bt
View gist:a3898302e4f8be682d053dd5e3b4b62a
// launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "example",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "/usr/bin/gdb",
"targetArchitecture": "x64",