Skip to content

Instantly share code, notes, and snippets.

View TomerFi's full-sized avatar
❄️
pr is coming

Tomer Figenblat TomerFi

❄️
pr is coming
  • Red Hat
  • Canada
View GitHub Profile
@TomerFi
TomerFi / run_idea.sh
Created February 19, 2023 08:48
run idea as a process
View run_idea.sh
# place this in .bashrc
function idea() {
ideapath="/opt/idea-IU-223.8617.56/bin/idea.sh"
logfile="$HOME/idea.log" # use /dev/null for no logs
if [ -z "$1" ]; then
( "$ideapath" > "$logfile" 2>&1 & ) 2> /dev/null
else
( "$ideapath" "$1" > "$logfile" 2>&1 & ) 2> /dev/null
fi
@TomerFi
TomerFi / collect_k8s_resources_by_expression.sh
Created November 27, 2022 20:05
Collect multiple K8S resources into YAML files based on a grep expression
View collect_k8s_resources_by_expression.sh
#!/bin/bash
set -e
set -u
set -o pipefail
######################################## DESCRIPTION #############################################################
## Use this script to collect multiple resources into YAML files. ##
## ##
## The mandatory '--exp' option takes a grep expression to match against all 'kind.group'. ##
@TomerFi
TomerFi / LICENSE
Created November 27, 2022 16:49
My Gists License
View LICENSE
ISC License
Copyright (c), Tomer Figenblat
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@TomerFi
TomerFi / serverless-framework-knative-ocp.md
Last active November 27, 2022 18:20
Serverless Framework in a Knative-OpenShift Environment
View serverless-framework-knative-ocp.md

Serverless Framework in a Knative-OpenShift Environment

The following are a recording of the steps performed for verifying the feasibility of [Serverless Framework][serverless-framework-site] in a [Knative][knative-docs]-based [OpenShift][openshift-site] environment.

Versions used

Serverless Framework 3.21.0
@TomerFi
TomerFi / get-forks-branches-commits-per-repository.js
Created August 18, 2022 09:08
Retrieving forks (including branches and commits) per repository using Node JS and GitHub's GraphQL API
View get-forks-branches-commits-per-repository.js
const { graphql } = require('@octokit/graphql');
// UPDATE the OWNER and the REPOSITORY constants
const OWNER = "Tomerfi";
const REPOSITORY = "aioswitcher";
// max 100 for all, for more - use pagination leveraging edges, pageInfo, and cursor.
const TOTAL_FORKS_TO_RETRIEVE = 100;
const TOTAL_BRANCHES_PER_FORK = 100;
const TOTAL_COMMITS_PER_BRANCH = 10; // be careful with this, you might exceed the maximum limit of 500,000 possible nodes.
@TomerFi
TomerFi / create-my-dicebear-avataaars-cmd.sh
Last active March 27, 2022 13:53
create-my-dicebear-avataaars-cmd
View create-my-dicebear-avataaars-cmd.sh
# https://avatars.dicebear.com/
# https://avatars.dicebear.com/styles/avataaars
dicebear create avataaars --format "png" --style "transparent" \
--top "shortFlat" --hairColor "blonde" --topChance 100 \
--accessoriesChance 0 \
--facialHair "beardMedium" --facialHairColor "blonde" --facialHairChance 100 \
--clothes "hoodie" --clothesColor "heather" \
--eyes "squint" --eyebrow "defaultNatural" \
--mouth "serious" --skin "pale"
@TomerFi
TomerFi / git-smudge-clean-filter.sh
Last active May 13, 2023 16:12
Git smudge-clean script for using as filter for mutiple reducted values for various file types in various repositories.
View git-smudge-clean-filter.sh
#!/bin/bash
#####################################################################################################
# This script is meant to be used as a global smudge-clean filter for removing sensitive data #
# from your commits. #
# #
# 1. Place this script in an acceisble path, i.e. ~/scripts/git-smudge-clean-filter.sh. #
# #
# 2. Populate the 'mapArr' using what you need hidden as the key, and the replacment as the value. #
# DO NOT use same values for multiple keys (this will work only in one direction). #
@TomerFi
TomerFi / Dockerfile
Last active August 14, 2020 11:20
My ultimate development environment Dockerfile.
View Dockerfile
# blog-post for this is here: https://dev.to/tomerfi/my-ultimate-development-dockerfile-4hg1
# Base image is python's image
FROM python:3.8.5
# Set shell with pipeline fail return
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Set environment variables
ENV SHELL=/bin/bash \
DOTNET_CLI_TELEMETRY_OPTOUT=true \