Skip to content

Instantly share code, notes, and snippets.

View TomerFi's full-sized avatar
🎩
Hellooo! la la laaaa..

Tomer Figenblat TomerFi

🎩
Hellooo! la la laaaa..
View GitHub Profile
@TomerFi
TomerFi / git-smudge-clean-filter.sh
Last active June 15, 2024 12:45
Git smudge-clean script for using as filter for mutiple reducted values for various file types in various repositories.
#!/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 / run_idea.sh
Created February 19, 2023 08:48
run idea as a process
# 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
#!/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 / serverless-framework-knative-ocp.md
Last active November 27, 2022 18:20
Serverless Framework in a Knative-OpenShift Environment

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 / LICENSE
Created November 27, 2022 16:49
My Gists 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 / 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
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
# 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 / Dockerfile
Last active August 14, 2020 11:20
My ultimate development environment 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 \