Skip to content

Instantly share code, notes, and snippets.

View abcarroll's full-sized avatar

A.B. Carroll III abcarroll

View GitHub Profile
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
//void _dump_debug_trace() {}
//void _dump_string(void *pointerToString) {}
// This will work for GCC and clang for x64
// #define GET_STACK_POINTER(NAME) uintptr_t NAME; asm("mov %%rsp, %0": "=r" ( NAME ));
ab@tower:~/vxx$ echo "drop database xxx" | sudo mysql
ab@tower:~/vxx$ echo "create database if not exists xxx; use xxx; create table if not exists a( b blob ); insert into a (b) values(X'000a0af0ffdeadbeef');" | sudo mysql
ab@tower:~/vxx$ echo "select * from xxx.a" | sudo mysql --raw -b > data
ab@tower:~/vxx$ hd data
00000000 62 0a 00 0a 0a f0 ff de ad be ef 0a |b...........|
0000000c
@abcarroll
abcarroll / install-php-interactive
Created February 12, 2020 18:45
Interactive tool to install PHP on Debian based systems, including Ubuntu.
#!/bin/bash
# ----
# Written By
# A.B. Carroll <[email protected]>,
# Feb. 2020
#
# Released under the terms of "the Unlicense"
# For the complete license text, please see <http://unlicense.org/>
# ----
################################################################################
# GnuPG Options
# (OpenPGP-Configuration-Options)
# Assume that command line arguments are given as UTF8 strings.
utf8-strings
# (OpenPGP-Protocol-Options)
# Set the list of personal digest/cipher/compression preferences. This allows
# the user to safely override the algorithm chosen by the recipient key

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@abcarroll
abcarroll / lmdb.tcl
Created November 9, 2019 06:10 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@abcarroll
abcarroll / lmdb.tcl
Created November 9, 2019 06:10 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@abcarroll
abcarroll / DontDoDrugsAndCode.php
Last active November 8, 2019 23:31
Nasty Nate's Pipelines
<?php
/*
* So, I have no idea what exactly you could do with this.
* I'm sure it's been done before, as well.
* But, I've never thought about a 'multi-prong' call pipeline ...
* where you have
* the return value
* parameter arg
@abcarroll
abcarroll / README.md
Created October 1, 2019 05:03 — forked from joyrexus/README.md
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

#include <stdio.h>
#include <iostream>
#include <thread>
#include <list>
#include <sapi/embed/php_embed.h>
int main(int argc, char* argv[]) {
PHP_EMBED_START_BLOCK(argc, argv)