Skip to content

Instantly share code, notes, and snippets.

View mikesart's full-sized avatar

Michael Sartain mikesart

  • Journalytic
  • Colorado Springs
View GitHub Profile
@mikesart
mikesart / dmesg.log
Created March 6, 2020 22:31
syslog for system76 amd 3990x rebooting
-- Logs begin at Tue 2020-02-25 18:38:45 MST, end at Fri 2020-03-06 15:18:23 MST. --
Mar 05 08:17:08 mikesart-tr3 kernel: Linux version 5.4.0-4-amd64 ([email protected]) (gcc version 9.2.1 20200203 (Debian 9.2.1-28)) #1 SMP Debian 5.4.19-1 (2020-02-13)
Mar 05 08:17:08 mikesart-tr3 kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-4-amd64 root=UUID=43ec9936-5d12-4283-9cf2-e08c1986b8c9 ro
Mar 05 08:17:08 mikesart-tr3 kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Mar 05 08:17:08 mikesart-tr3 kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Mar 05 08:17:08 mikesart-tr3 kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
Mar 05 08:17:08 mikesart-tr3 kernel: x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
Mar 05 08:17:08 mikesart-tr3 kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
Mar 05 08:17:08 mikesart-tr3 kernel: BIOS-provided physical RAM map:
Mar 05 08:17:08 mikesart-tr3 ker
@mikesart
mikesart / BuildLibCxx.sh
Created August 7, 2019 03:24
Build UE4 LIbCxx
#!/bin/bash
set -eu
SCRIPT_DIR=$(cd "$(dirname "$BASH_SOURCE")" ; pwd)
LLVM_DIR=${1:---help}
if [[ "${LLVM_DIR}" == "--help" ]] || [[ ! -f "${LLVM_DIR}/llvm/CMakeLists.txt" ]]; then
echo "Usage: ${BASH_SOURCE} llvm-git-repo"
@mikesart
mikesart / gist:dcc62be3a52c3b4031bb2fba62f776f5
Created May 30, 2019 17:49
Subsurface-4.8.6-x86_64.AppImage mount directory
.mount_SubsurYUXGLu/
├── [ 18] AppRun -> usr/bin/subsurface*
├── [ 15K] .DirIcon
├── [ 276] subsurface.desktop
├── [ 15K] subsurface-icon.png
└── [221M] usr/
├── [ 76M] bin/
│   ├── [ 146] qt.conf
│   ├── [ 75M] subsurface*
│   └── [3.4K] subsurface.debug
@mikesart
mikesart / foobar.cpp
Last active February 28, 2019 01:55
Linux read times
// g++ -O3 foobar.cpp -g -o foobar
//
// Create large input file
// dd if=/dev/zero of=/mnt/dev/infile.txt count=180 bs=1M
//
// Run test app
// foobar /mnt/dev/infile.txt /mnt/dev/outfile.txt
#include <errno.h>
#include <stdio.h>
@mikesart
mikesart / readme.md
Last active November 29, 2018 04:45
Clear Linux custom kernel

Get Clear Linux kernel patch files

git clone https://github.com/clearlinux-pkgs/linux.git clearlinux-pkgs-linux.git
cd clearlinux-pkgs-linux.git
git checkout -b 4.19.4-664 4.19.4-664

Get kernel source

cd ..
@mikesart
mikesart / sdl2_opengl.cpp
Created August 29, 2018 23:40
sdl opengl gamma
// gcc:
// g++ sdl2_opengl.cpp -lSDL2 -lGL -o sdl2_opengl
#include <stdint.h>
#include <stdio.h>
#include <GL/gl.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@mikesart
mikesart / pthreads.cpp
Created June 9, 2017 00:08
quick / simple pthread test app
/*
* pthread example test app for lldb, from Michael Sartain's post at
* http://linux-debugger-bits.blogspot.com/2013/07/linux-pthread-test-app-with-lldb.html
*
* clang -Wall -g -o mikesart_pthread -lpthread mikesart_pthread.c
*/
#include <stdio.h>
#include <string.h>
#include <pthread.h>
@mikesart
mikesart / stashtest.cpp
Created August 25, 2016 03:54
Simple libgit2 git_stash_save sample
#define __GNU_SOURCE
#include <stdio.h>
#include <chrono>
#include "git2.h"
// Timer routines. Use like:
// util_time_t t0 = util_get_time();
// printf( "%.2fms\n", util_time_to_ms( t0, util_get_time() );
typedef std::chrono::time_point< std::chrono::high_resolution_clock > util_time_t;
@mikesart
mikesart / gist:b33762363153e2b8c7c7
Created August 27, 2015 17:16
E-mail Date: fields
13 Feb 08 02:15:46
15 Oct 09 16:20:45 EDT ; EDT MSD
02 Jul 2003 01:33 GMT
2 Aug 2006 19:09:11 GMT
19 Oct 05 20:59 -0800
13 Oct 12 02:12:41 +0200
Fri, 8 Mar 2002 21:29:44
03 Apr 2008 12:36:15 PDT ; PDT PST GMT
Fri Apr 06 12:37:39 2007
1-Apr-1997 07:46:20 -0700
@mikesart
mikesart / gist:dbee9d3787c409974cd1
Created August 13, 2014 00:37
GDB Python Print not working.
I'm trying to figure out why 'python print "hello"' is giving me invalid syntax.
(gdb) python import gdb
(gdb) python print "hello"
File "<string>", line 1
print "hello"
^
SyntaxError: invalid syntax
Error while executing Python code.