Skip to content

Instantly share code, notes, and snippets.

View Krellan's full-sized avatar

Josh Lehan Krellan

View GitHub Profile
@Krellan
Krellan / usbpower.pl
Last active October 7, 2022 22:53
This is a script that will reset a Linux USB serial tty device. Sometimes they get stuck with "unable to enable UART" error messages, this will help fix.
#!/usr/bin/perl -w
#
# USB Power
# Krellan
#
# This script will attempt to recover a misbehaving USB serial tty device,
# by unbinding/rebinding the USB hub(s) that are upstream from it.
# This should force the device to reset itself.
#
# Usage: usbpower.pl ttyUSB0
@Krellan
Krellan / gist:dda91f64d38761c32fbc
Created January 5, 2015 08:38
onename.io Verification
Verifying that +krellan is my openname (Bitcoin username). https://onename.io/krellan
@Krellan
Krellan / number-prefix-fixer.pl
Created February 25, 2015 21:47
Strip numeric prefix from NAME=VALUE file
#!/usr/bin/perl -w
my %keys;
while(<>)
{
chomp;
# Match NAME=VALUE (first equals sign is the separator)
if (/^([^=]+)[=](.*)$/)

Keybase proof

I hereby claim:

  • I am krellan on github.
  • I am krellan (https://keybase.io/krellan) on keybase.
  • I have a public key ASDraLIrKoycm0arqEXGMu-CRbE-OwlyrJvLSuqtVtVVuwo

To claim this, I am signing this object:

@Krellan
Krellan / preload-externalstorer.sh
Last active April 1, 2022 22:41
Preloading some content before running Redfish Validator
#!/bin/sh
CONFIG="./config/example.ini"
LOCATION=$(cat "$CONFIG" | grep '^ip = ' | cut '-d ' -f3-)
USERNAME=$(cat "$CONFIG" | grep '^username = ' | cut '-d ' -f3-)
USERNAME=$(cat "$CONFIG" | grep '^password = ' | cut '-d ' -f3-)
echo "First run:"
echo "ssh -L localhost:8000:localhost:80 root@your-bmc-hostname"
@Krellan
Krellan / run-test
Last active April 4, 2022 23:15
run-test
#!/bin/bash
# bmcweb run-test convenience script, similar to run-ci
# https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/52444
set -e
set -x
# Clean up after previous run
rm -rf builddir
@Krellan
Krellan / gist:e8769d8006742c693632f310c276b145
Created December 15, 2022 21:14
Testing phosphor-pid-control timing
Testing phosphor-pid-control timing
Defaults
### At 273984 us, tick fan: cycleCnt=0
### At 364276 us, tick fan: cycleCnt=100
### At 464234 us, tick fan: cycleCnt=200
### At 564362 us, tick fan: cycleCnt=300
### At 664430 us, tick fan: cycleCnt=400
root@mybmc:~# systemctl stop smbios-mdrv2.service
root@mybmc:~# /usr/bin/smbiosmdrv2app
<6> SMBIOS VERSION - 3.2
<3> Error in mapper method call - sd_bus_call: xyz.openbmc_project.Common.Error.ResourceNotFound: The resource is not found., SERVICE - /xyz/openbmc_project/software/bios_active, PATH - xyz.openbmc_project.Software.Version
<6> VERSION INFO - BIOS - 999999999.20230717.21107-0
<6> SMBIOS gRPC server: Start
<6> Claimed gRPC address: [::]:10166
<6> Starting thread: 0
<6> Started thread: 0
@Krellan
Krellan / AfterMutex.txt
Last active July 22, 2023 08:14
Adding mutex for stderr logging
<6> Started test at 0 us
<6> Hello from line 0 of thread 1 at 1710 us
<6> Hello from line 1 of thread 1 at 3682 us
<6> Hello from line 2 of thread 1 at 3966 us
<6> Hello from line 3 of thread 1 at 4068 us
<6> Hello from line 4 of thread 1 at 4405 us
<6> Hello from line 5 of thread 1 at 4543 us
<6> Hello from line 6 of thread 1 at 4806 us
<6> Hello from line 7 of thread 1 at 4938 us
<6> Hello from line 8 of thread 1 at 5022 us
@Krellan
Krellan / gist:6930bc2ed1ac16b93afcc3a12c02e545
Last active September 22, 2023 04:03
Testing MDRV2 with more than one instance at the same time
# Testing
# https://gerrit.openbmc.org/c/openbmc/smbios-mdr/+/66559
Sep 21 15:52:32 mymachine.example.com smbiosmdrv2app[14561]: SMBIOS data file path: /var/lib/smbios/smbios2
Sep 21 15:52:32 mymachine.example.com smbiosmdrv2app[14561]: SMBIOS control object: /xyz/openbmc_project/Smbios/MDR_V2
Sep 21 15:52:32 mymachine.example.com smbiosmdrv2app[14561]: SMBIOS inventory path: /xyz/openbmc_project/inventory/system
Sep 21 15:52:35 mymachine.example.com smbiosmdrv2app[14561]: SMBIOS data file path: /var/lib/smbios/smbios-remote-host-1
Sep 21 15:52:35 mymachine.example.com smbiosmdrv2app[14561]: SMBIOS control object: /xyz/openbmc_project/Smbios/system1
Sep 21 15:52:35 mymachine.example.com smbiosmdrv2app[14561]: SMBIOS inventory path: /xyz/openbmc_project/inventory/system/board/myplatform/system1