Skip to content

Instantly share code, notes, and snippets.

BA steakknife

View GitHub Profile
View gist:615f08981c9b18271ec3600c6995a31a
Tue Mar 12 01:21:42 2019
*** Panic Report ***
panic(cpu 1 caller 0xffffff801a5dad90): "trying to interlock destroyed mutex (0xffffff8045132840)"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-4903.241.1/osfmk/i386/locks_i386.c:2817
Backtrace (CPU 1), Frame : Return Address
0xffffff8035343690 : 0xffffff801a5aeb0d
0xffffff80353436e0 : 0xffffff801a6e8653
0xffffff8035343720 : 0xffffff801a6da07a
0xffffff8035343790 : 0xffffff801a55bca0
0xffffff80353437b0 : 0xffffff801a5ae527
View derparser.rb
class Derives
def initialize
raise "Cannot construct an abstract base class"
end
def call(s)
return nullable? if s.empty?
c = s.slice!(0)
derive(c).(s)
end
View reflex.rb
class Reflex < Formula
desc "The regex-centric, fast and flexible scanner generator for C++"
homepage "https://www.genivia.com/doc/reflex/html"
# This project is master-stable, no releases (yet)
url "https://github.com/Genivia/RE-flex.git"
version "1.0.12"
depends_on "autoconf" => :build
depends_on "coreutils" => :build
depends_on "gawk" => :build
depends_on "grep" => :build
View playground.rs
#![allow(dead_code, unused_macros)]
use std::fmt::Debug;
trait MusicElement: MusicElementClone + Debug {
fn duration(&self) -> f32;
}
trait MusicElementClone {
fn clone_box(&self) -> Box<MusicElement>;
}
@steakknife
steakknife / lib.rs
Last active Jan 4, 2019
AtomTable singleton in Rust
View lib.rs
#[macro_use]
extern crate lazy_static;
use std::collections::HashMap;
use std::sync::{Mutex, Arc};
lazy_static! {
static ref table: Arc<Mutex<AtomTable>> = {
Arc::new(Mutex::new(AtomTable::new()))
};
View subshell_example.c
/*
* $ F=1 ./a.out F
* $
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void main(int argc, char **argv) {
if (fork() == 0) {
char buf[256];
View gist:763e9b93c5a6663518135ef87facdf09
SYSCALL(args) = return
[2018-10-17 21:35:08] [NOTICE] Source [public-resolvers.md] loaded
[2018-10-17 21:35:08] [NOTICE] dnscrypt-proxy 2.0.17
[2018-10-17 21:35:08] [NOTICE] Dropping privileges
[2018-10-17 21:35:08] [FATAL] Unable to reexecute [/usr/local/opt/dnscrypt-proxy/sbin/dnscrypt-proxy]
open("/dev/dtracehelper\0", 0x2, 0xFFFFFFFFEFBFEDC0) = 3 0
ioctl(0x3, 0x80086804, 0x7FFEEFBFEBD0) = 0 0
close(0x3) = 0 0
access("/AppleInternal/XBS/.isChrooted\0", 0x0, 0x0) = -1 Err#2
bsdthread_register(0x7FFF5C753418, 0x7FFF5C753408, 0x2000) = 1073742047 0
@steakknife
steakknife / rhel-centos-el7-checkinstall.patch
Last active Sep 25, 2018
Patch checkinstall-1.6.2 for RHEL & CentOS el7
View rhel-centos-el7-checkinstall.patch
diff --git a/checkinstall b/checkinstall
index 41a7978..26b1fe8 100755
--- a/checkinstall
+++ b/checkinstall
@@ -468,10 +468,10 @@ function copy_dir_hierarchy {
if [ $? -eq 0 ]; then
if [ deref_parents -eq 1 ]; then
# Add the -h option to the tar command for dereferencing
- $TAR --no-recursion -C "${root}" -cphf - $files | $TAR -f - -xvpC \
+ $TAR --no-recursion -C "${root}" -cphf - $files | $TAR -f - -xvpPC \
@steakknife
steakknife / install-latest-ruby-on-centos-7.sh
Last active Jan 14, 2019 — forked from mustafaturan/ruby.2.5.3-setup.sh
ruby latest setup for centos 7.x
View install-latest-ruby-on-centos-7.sh
#!/usr/bin/env bash
set -ex
toolset=devtoolset-7
yum install -y epel-release # EPEL repo
yum install -y centos-release-scl # shiny-new(er) compliers
# make sure there are no surprises installing from repos
grep -r gpgkey= /etc/yum.repos.d/ | cut -d= -f2 | xargs -L1 rpm --import
yum update -y # system update
# misc dev tools, but we're not going to use the ancient toolchain
@steakknife
steakknife / bitfield.go
Created Sep 21, 2018
C bitfields use in go
View bitfield.go
package main
// #include <stdio.h>
// #include <stdint.h>
/*
#pragma pack(push,1)
typedef struct _s{
uint32_t a: 16;
uint32_t b: 15;
uint32_t c: 1;
You can’t perform that action at this time.