Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
usage() {
echo "
USAGE
./sh-kebab.sh [path] [--dry-run] [--skip-dirs] [--copy-files]
@eliranmal
eliranmal / pr-slack.js
Created July 23, 2026 18:46
generates a slack formatted message with your current open github PRs
#!/usr/bin/env node
const p = require('child_process');
const resolveTitle = pr => {
const prTitle = pr.title.replace(/OCMUI-\d+: /, '');
// <url|text> is link notation in slack messages
// (but it only works if you disable rich formatting!)
@eliranmal
eliranmal / setup-roles.sh
Created July 23, 2026 18:44
convenient utility to set up roles for openshift ROSA clusters
#!/usr/bin/env bash
usage() {
printf "%s" "
usage: $0 [-h|--help]
sets up ocm, user and account roles for you, so you don't have to. you're welcome.
here's what it does:
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const child_process = require('child_process');
const defaults = {
outputPath: 'terms',
sourceRepoPath: '.',
@eliranmal
eliranmal / gitlab-mr-links-check.md
Last active March 16, 2022 12:03
a how-to on checking for broken links on GitLab merge requests
@eliranmal
eliranmal / check-links.sh
Last active March 21, 2022 18:58
takes a list of links as input, and checks each for a successful response
@eliranmal
eliranmal / redhat-bash-prompt.md
Last active December 13, 2021 05:21
customize your prompt line to match your fedora

redhat bash prompt

customize your prompt line to match your fedora

how to

  • add this somewhere in your .bash_profile (or .bashrc)
@eliranmal
eliranmal / git-fork-update.sh
Created June 17, 2019 12:40
politely updates a fork repository from the upstream repository, by excluding merge commits so they will not appear on pull-requests to the upstream.
git fetch upstream
git checkout master
git rebase upstream/master
git push -f origin master
@eliranmal
eliranmal / compname.sh
Created June 6, 2019 20:37
changes the computer/host name in all relevant entries of the scutil
#!/usr/bin/env bash
function main() {
validate "$@"
set_name "$@"
if [[ "$2" == '-p' ]]; then
update_policy
fi
}
#
# a one-liner to get raw content from github enterprise, relying on basic authentication.
# eliminates the need to create an access token and incorporate it in the url.
#
#
# fill in the blanks:
#
# USER your login user name for authentication (you'll be prompted for password on the terminal)
# GHE_DOMAIN the github enterprise custom domain