Skip to content

Instantly share code, notes, and snippets.

View rickhull's full-sized avatar

Rick Hull rickhull

View GitHub Profile
@rickhull
rickhull / output.txt
Last active January 17, 2023 01:20
What are the available Unix Socket types in Ruby (on Linux)?
best [:SOCK_STREAM, :SOCK_DGRAM, :SOCK_SEQPACKET]
:SOCK_STREAM TYPE SOCK_STREAM
:SOCK_DGRAM TYPE SOCK_DGRAM
:SOCK_SEQPACKET TYPE SOCK_SEQPACKET
other [nil, :SOCK_RAW]
nil TYPE SOCK_STREAM
:SOCK_RAW TYPE SOCK_DGRAM
unsupported [:SOCK_RDM, :SOCK_PACKET, :SOCK_NONBLOCK, :SOCK_CLOEXEC]
@rickhull
rickhull / configuration.nix
Last active March 29, 2025 07:38
Prometheus, Grafana, Loki, Promtail on NixOS
# MONITORING: services run on loopback interface
# nginx reverse proxy exposes services to network
# - grafana:3010
# - prometheus:3020
# - loki:3030
# - promtail:3031
# prometheus: port 3020 (8020)
#
services.prometheus = {
@rickhull
rickhull / shell.nix
Last active July 5, 2020 22:33
shell.nix that prepares tildes for pytest
with import <nixpkgs> {};
with python3Packages;
let
testing_common_database = buildPythonPackage rec {
pname = "testing.common.database";
version = "2.0.3";
src = fetchPypi {
inherit pname version;
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
gggI trained Aikido for many years. About the third year, I began a very basic rings routine coupled with running two miles per day. The running meant I no longer ran out of breath during class unless I was testing. The rings meant my hip speed was faster than ever before and I could counter just about every attack with a level of comfort I never had before the rings.
Because my core was so stable and strong, when I turned my hips, my feet and shoulders moved at the same time, like a door. Long lanky me became super quick for the first time in my life. Better shape and posture than in college basketball. Still skinny, but deceptively strong, even at extreme angles.
No injuries to shoulders and a chronic back pain between my shoulder blades went away (shiatsu also played a roll in the pain going away).
What was my ring routine? Dead hangs every day, adding a second a day (that's all; one second) until I could hang for two minutes. This took a few months.
Then I started over with one arm dead hangs until e
class Foo
def initialize
@foo = :foo
end
private
def bar
:bar
end
# normal nesting
module Outer
X = 1
Y = 2
class C
X = Y
end
end
# alternative nesting
def self.def_builtin_commands(delegation_class, command_specs)
for meth, args in command_specs
arg_str = args.collect{|arg| arg.downcase}.join(", ")
call_arg_str = args.collect{
|arg|
case arg
when /^(FILENAME.*)$/
format("expand_path(%s)", $1.downcase)
when /^(\*FILENAME.*)$/
# \*FILENAME* -> filenames.collect{|fn| expand_path(fn)}.join(", ")
rwh@DESKTOP-VA6OTK5:/mnt/c/Users/Rick/git/mruby_tools/mruby$ ruby minirake --trace
(in /mnt/c/Users/Rick/git/mruby_tools/mruby)
/mnt/c/Users/Rick/git/mruby_tools/mruby/tasks/toolchains/gcc.rake:38: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mrbc
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mirb
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mruby
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mruby-strip
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mrdb
/mnt/c/Users/Rick/git/mruby_tools/mruby/build/test/bin/mirb
/mnt/c/Users/Rick/git/mruby_tools/mruby/build/test/bin/mruby
class Character
def self.generate_upp
6.times.reduce('') { |memo, _|
memo + Dice.roll_dice(6,2,1).to_s(16).upcase
}
end
end