Skip to content

Instantly share code, notes, and snippets.

View rawsyntax's full-sized avatar

Eric Himmelreich rawsyntax

View GitHub Profile
@rawsyntax
rawsyntax / ocm-service-log-gist.md
Created May 15, 2026 16:23
AMS service-log client: why the local openapi-generator snapshot is the wrong default

AMS service-log client: why the local openapi-generator snapshot is the wrong default

Don't vendor generated OpenAPI clients when the SDK already has the types

Was reviewing a merge request in uhc-account-manager (AMS) today — OCM-24913 — that removes a dependency on gitlab.cee.redhat.com/service/ocm-service-log and replaces it with a locally vendored OpenAPI snapshot + code generation. The motivation is legit: gitlab.cee.redhat.com is behind the Red Hat VPN, and Konflux CI runs on a public cluster that can't reach it. So the module has to go.

The fix they landed: fetch the OpenAPI spec from the live API (https://api.openshift.com/api/service_logs/v1/openapi), run openapi-generator-cli against it, commit the output into pkg/client/uhc/service_log/openapi/, and provide a Makefile to refresh it periodically. ~40 generated files, a .travis.yml nobody will ever run, a git_push.sh that will never be executed, and a drift risk every tim

@rawsyntax
rawsyntax / rsync-retry.sh
Created October 26, 2011 20:20 — forked from jmar71n/rsync-retry.sh
Runs rsync, retrying on errors up to a maximum number of tries.
#!/bin/bash
### ABOUT: See: http://gist.github.com/366269
### Runs rsync, retrying on errors up to a maximum number of tries.
### On failure script waits for internect connection to come back up by pinging google.com before continuing.
###
### Usage: $ ./rsync-retry.sh source destination
### Example: $ ./rsync-retry.sh user@server.example.com:~/* ~/destination/path/
###
### INPORTANT:
#!/bin/bash
# I use this script, then also create an alias, for example:
# mkdir -p /Users/eric/Downloads/tv && rsync-retry.sh zarovich@tapir.feralhosting.com:~/torrents/eric/bitmetv/ /Users/eric/Downloads/tv
### ABOUT: See: http://gist.github.com/366269
### Runs rsync, retrying on errors up to a maximum number of tries.
### On failure script waits for internect connection to come back up by pinging google.com before continuing.
###
### Usage: $ ./rsync-retry.sh source destination
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
@rawsyntax
rawsyntax / magit-commit-template.el
Last active January 5, 2019 15:41
magit commit hook template
;; TODO: pull author initials from (user-full-name)
(setq author-initials "EH")
(defun set-pivotal-story-id (id)
"sets current pivotal tracker story id"
(interactive "spivotal-story-id:")
(progn
(setq pivotal-story-id id)))
@rawsyntax
rawsyntax / install_elixir.md
Created December 11, 2018 15:54 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

@rawsyntax
rawsyntax / bash-history.sh
Created November 1, 2011 16:21
on removing commands from history
# say we start with an empty bash command history
bash-3.2$ history
1 history
# enter a command that requires a password
bash-3.2$ sudo rm -i some_file
Password:
# accidentally ^C and type your password
# into the prompt and hit enter
@rawsyntax
rawsyntax / term-mode-key-bindings.el
Last active March 15, 2018 20:20
multi-term key bindings
(add-hook 'term-mode-hook
(lambda ()
(add-to-list 'term-bind-key-alist '("M-[" . multi-term-prev))
(add-to-list 'term-bind-key-alist '("M-]" . multi-term-next))))
@rawsyntax
rawsyntax / apply_this.sh
Created February 21, 2018 13:12 — forked from RobinDaugherty/apply_this.sh
Fix Pow's nack so that better_errors works on ruby 2.1+
curl -L https://gist.githubusercontent.com/RobinDaugherty/2731f20d303e6506d451384df2189210/raw/b52e6231170b3dce39633db29634dc892751910f/pow_better_errors_fix.patch |
patch ~/Library/Application\ Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb

Keybase proof

I hereby claim:

To claim this, I am signing this object: