Skip to content

Instantly share code, notes, and snippets.

View shafi-codez's full-sized avatar

shafi shafi-codez

View GitHub Profile
@shafi-codez
shafi-codez / gist:e625aa5ec8e2f4554aca2967ed3079ff
Last active August 24, 2017 05:51 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@shafi-codez
shafi-codez / tryout.sh
Created April 10, 2018 07:02
Session 1 : Awesomeness in bash
# How to check if the disk is full or not ?
df -h
# Filter files from disk
find . -type f -name "*config.xml"
# Parsing command outputs using jq tool
brew install jq
sfdx force:config:list --json | jq '.'
@shafi-codez
shafi-codez / git-repo-migrate.sh
Last active August 2, 2019 18:48
Migration from our repo to new repo
# EXISTING_REPO_NAME=plugins_extractor
git clone ssh://<token>@git-codecommit.us-west-2.amazonaws.com/v1/repos/${EXISTING_REPO_NAME}
cd ${EXISTING_REPO_NAME}
for remote in `git branch -r | grep -v master `; do git checkout --track $remote ; done
git remote -v
git remote rm origin
# ORG_URL = "soma.salesforce"
# Ensure this new repo is created.