Skip to content

Instantly share code, notes, and snippets.

View colstrom's full-sized avatar

Chris Olstrom colstrom

View GitHub Profile
@colstrom
colstrom / dircomm
Last active January 27, 2020 21:57
Directory Comparison Utility (like comm, but for directories)
#! /usr/bin/env ruby
# SPDX-License-Identifier: MIT
# The MIT License (MIT)
# Copyright © 2020 Chris Olstrom <[email protected]>
# Copyright © 2020 SUSE Software Solutions
# Permission is hereby granted, free of charge, to any person obtaining a copy
@colstrom
colstrom / SuperMicro-IPMI-RADIUS-Notes.md
Created May 30, 2019 22:23
SuperMicro IPMI RADIUS Notes

Shared secrets longer than 32 characters will be silently truncated to 32 characters.

Since only the password is encrypted in the Access-Request packet, this can appear in debugging logs (radiusd -xxx or -xxxx) as strange passwords.

Using a mostly-default configuration (enabling the rest module, with method = post and body = json), these can appear in the request body as a User-Password of some 16-character/27-byte unicode string.

@colstrom
colstrom / files.authorize
Created May 27, 2019 19:00
Minimal FreeRADIUS Configuration
testuser Cleartext-Password := "testpassword"
@colstrom
colstrom / results.txt
Created July 20, 2018 18:46
Ruby Vector Benchmarks (Component Scaling - matrix vs numo/narray)
Warming up --------------------------------------
V * F (1) 123.890k i/100ms
V.dot(V) (1) 122.505k i/100ms
NA * F (1) 37.836k i/100ms
NA * NA (1) 59.097k i/100ms
Calculating -------------------------------------
V * F (1) 1.730M (± 2.3%) i/s - 8.672M in 5.015293s
V.dot(V) (1) 1.731M (± 2.3%) i/s - 8.698M in 5.028631s
NA * F (1) 399.584k (± 2.8%) i/s - 2.005M in 5.022543s
NA * NA (1) 668.977k (± 2.4%) i/s - 3.369M in 5.038234s
@colstrom
colstrom / results.txt
Created July 20, 2018 18:22
Ruby Vector Benchmarks (matrix vs nmatrix vs numo/narray)
Warming up --------------------------------------
V * F (2) 112.620k i/100ms
V.dot(V) (2) 99.728k i/100ms
NA * F (2) 37.539k i/100ms
NA * NA (2) 58.776k i/100ms
NM(C) * F (2) 17.457k i/100ms
NM(C) * NM(C) (2) 17.103k i/100ms
NM(R) * F (2) 17.334k i/100ms
NM(R) * NM(R) (2) 16.528k i/100ms
NM(A) * F (2) 17.521k i/100ms
#! /usr/bin/env ksh
# -*- shell-script -*-
function add-kernel-boot-parameter
{
perl -p -i -e 's/^(GRUB_CMDLINE_LINUX=)\"(?!.*'"${*}"')(.+)\"$/\1\"\2 '"${*}"'\"/' /etc/default/grub
}
# Usage
## add-kernel-boot-parameter cgroup_enable=memory
@colstrom
colstrom / z85
Created September 27, 2017 00:24
#! /usr/bin/env ruby
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
#! /bin/sh
# -*- shell-script -*-
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Copyright (c) 2017 SUSE LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#! /bin/sh
# -*- shell-script -*-
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Copyright (c) 2017 SUSE LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#! /bin/sh
# -*- shell-script -*-
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Copyright (c) 2017 SUSE LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights