Skip to content

Instantly share code, notes, and snippets.

View mpictor's full-sized avatar

Mark mpictor

  • Austin, TX
View GitHub Profile
@mpictor
mpictor / run.sh
Created April 27, 2020 20:48
gdb / qemu kernel debug notes
# notes from when I had trouble with kexec some time back. possibly useful to others.
# disable kaslr or boot with nokaslr, or no symbols will match and no breakpoints will be hit
#
# hbreak used to be necessary? not any more
qemu-system-x86_64 --version
#QEMU emulator version 4.0.0
gdb --version
#GNU gdb (Gentoo 8.3 vanilla) 8.3
@mpictor
mpictor / default.xml
Created January 7, 2019 19:22
libvirt missing ip
<network>
<name>default</name>
<uuid>8c76bca7-e7a6-4f29-8e6c-241d6f616141</uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='off' delay='0'/>
<mac address='52:54:00:e0:18:a8'/>
@mpictor
mpictor / hang.md
Last active July 30, 2018 21:08
4.17.6: "smartpqi 0000:b1:00.0: resetting scsi 0:1:0:0" (mke2fs hangs)

kernel version: 4.17.6 (similar failures with 4.14.28, 4.14.53)

kernel config: file below

hardware: HP ProLiant DL360 Gen10

firmware: UEFI (Note: issue not encountered with legacy boot)

In dmesg, these two lines jump out at me (line 1160-1161):

@mpictor
mpictor / CMakeLists.txt
Last active January 4, 2016 20:59
cmake generates invalid Makefile
# ----- GENERATED FILE -----
# ----- Do not edit! -----
# schema name: index_attribute
# (short name: index_attribute)
# contains 5 entities, 1 types
PROJECT( index_attribute)
# list headers so they can be installed - entity, type, misc
set( index_attribute_entity_hdrs
@mpictor
mpictor / gist:1967483
Created March 3, 2012 18:49
part 21 encode/decode binary
//my version of http://groovyconsole.appspot.com/script/646001
def in_bin = ["0", "1", "111011", "100100101010", "001101", "01000" ]
def p21_rep = [] //in_bin encoded in part 21 format
def d = [] //extra binary digits in p21_rep
def hex = [] //hex part of p21_rep
def nibbles = [] //number of hex digits
def out_bin = [] //p21_rep decoded
def num_bits = [] //number of used bits
def zeros = [] //number of binary zeros to prepend to out_bin
def padded = [] //num_bits + d
@mpictor
mpictor / parser-output.txt
Created November 5, 2011 01:38
Return type or local variable requires type label
# parser output for line 94 of file below
# $ ../bin/fedex_plus -d9 -l94 -u94 ../../test/test_generics_type_label.exp
Schema line number: 94
Next token is token TOK_IDENTIFIER ()
Shifting token TOK_IDENTIFIER ()
Entering state 117
Reducing stack by rule 147 (line 1135):
$1 = token TOK_IDENTIFIER ()
-> $$ = nterm id_list ()
@mpictor
mpictor / CMakeLists.txt
Created October 21, 2011 20:16
Cmake and ctest scripts demonstrating build targets that are also test targets. CMakeLists is rather complicated because it generates source code from targets in a list.
#https://github.com/mpictor/StepClassLibrary/blob/master/data/CMakeLists.txt
#this sets a property so that the target doesn't get built by 'make' or 'make all'
#useful when testing generation of schema code/compiling schem libs/etc
FUNCTION( TESTABLE_TARGET target )
if(ENABLE_TESTING)
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
endif()
ENDFUNCTION( TESTABLE_TARGET )
@mpictor
mpictor / doxyassist.xml
Created October 1, 2011 23:45
doxyassist file for StepClassLibrary - subprojects don't show up in main project
<?xml version="1.0" encoding="utf-8"?>
<!-- run doxyassist from scl root dir:
../doxyassist/doxyassist.py doc/doxyassist.xml -->
<!-- The main tag provides the version (1.0 only for now). The type attribute
is not required, and defaults to "generic". To use a different project handler,
change its type. The "name" attribute defines the name of your configuration.
Note: you must define and use the "http://simply-life.net/doxyassist/project.xsd"
namespace for the XML file to be processed properly. -->
<DoxyAssist xmlns="http://simply-life.net/doxyassist/doxyassist.xsd"
@mpictor
mpictor / test_schema.exp
Created September 8, 2011 09:58
Small schema with "Query expression source must be an aggregate" error
-- $ ../bin/fedex_plus ../../data/test_schema.exp
-- ../../data/test_schema.exp:34: --ERROR: Query expression source must be an aggregate.
-- Errors in input
SCHEMA test_schema;
ENTITY representation_item
SUPERTYPE OF (ONEOF (binary_representation_item, compound_representation_item));
name : label;
--WHERE
@mpictor
mpictor / spaces_in_fct.exp
Created July 29, 2011 23:57
express schema that exposes fedex_plus bug
SCHEMA SPACES_IN_FUNCTION;
TYPE label = STRING; END_TYPE;
TYPE identifier = STRING; END_TYPE;
TYPE text = STRING; END_TYPE;
TYPE transformation = STRING; END_TYPE;
TYPE rigid_placement = STRING; END_TYPE;
TYPE dimension_count = INTEGER; END_TYPE;
TYPE compound_item_definition = STRING; END_TYPE;
TYPE founded_item_select = STRING; END_TYPE;
TYPE id_attribute_select = STRING; END_TYPE;