Skip to content

Instantly share code, notes, and snippets.

View ismet55555's full-sized avatar
💥
This n' That

Ismet Handzic ismet55555

💥
This n' That
View GitHub Profile
@ismet55555
ismet55555 / rsync_parallel.sh
Last active April 4, 2024 04:11
Sync a source directory to a target directory
#!/bin/bash
##############################################################################
# This script recursively syncs a source directory to a target directory.
# This script can run prallel with multiple processes for speed.
# It will:
# - Skip existing files
# - Copy file and its metadata
# - Delete empty directories in target directory
#
@ismet55555
ismet55555 / grub
Last active February 4, 2023 18:15
Skipping GRUB boot menu entirely
##########################################################################
#
# This is the GRUB startup manu configuration file used to customize
# the GRUB menu
#
# This file: /etc/default/grub
# After file update, run the following:
# sudo update-grub
#
# For full documentation of the options in this file, see:
@ismet55555
ismet55555 / git_sync_upstream.sh
Last active January 27, 2023 14:17
Sync with upstream
#!/bin/bash
UPSTREAM_SOURCE="https://github.com/XXXXXXXXX/XXXXXXXXXX.git"
KEEP_THIS="path/to/file/or/dir"
# Check if upstream remote is defined
if ! git remote -v | grep -q upstream; then
git remote add upstream ${UPSTREAM_SOURCE}
echo "Successfully added 'upstream' to remotes: ${UPSTREAM_SOURCE}"
fi
@ismet55555
ismet55555 / teamviewer_client_setup.sh
Last active February 4, 2023 16:48
Setting up Teamviewer Client via Terminal
#!/bin/bash
###############################################################################
#
# This script downloads, installs, and sets teamviewer up
# via the Terminal.
# Note, that this installation is via .deb packages
# used on Debian-based systems such as Ubuntu
#
# More system architecture options:
@ismet55555
ismet55555 / 1Password_CLI.md
Created January 27, 2023 04:12
How to install, setup, and use 1Password CLI on Linux
@ismet55555
ismet55555 / repo_secret_cleaning.md
Last active September 23, 2022 23:21
Cleaning of secrets and sensitive information from git repository history

Git Repository Secret Cleaning

IMPORTANT: Be careful running these tools, git history will be changed

BFG Repo Cleaner

The BFG Repo Cleaner is a simpler, faster alternative to git-filter-branch for specifically cleansing bad data out of your Git repository history: Removing Crazy Big Files, Removing Passwords, Credentials & other Private data

  1. Close all pull requests on the git repo
@ismet55555
ismet55555 / tmux-install-upgrade.sh
Last active April 26, 2024 10:53
Install or Upgrade tmux
#!/bin/bash
set -o errexit
#################################################################
# Install/Upgrade tmux
#################################################################
#
# This script installs or updates tmux onto a Debian (ie Ubuntu),
# CentOS/RHEL, or MacOS platform. This script is based on:
@ismet55555
ismet55555 / Dockerfile
Last active June 2, 2021 21:30
Jenkins Server in Docker Container using Config as Code
##############################################################################
#
# Commands:
# docker build -t jenkins:jcasc .
# docker run --name jenkins \
# --rm -p 8080:8080 \
# --env JENKINS_ADMIN_ID=admin \
# --env JENKINS_ADMIN_PASSWORD=password \
# jenkins:jcasc
#
@ismet55555
ismet55555 / short_hash_a_directory.sh
Last active January 27, 2023 14:30
Get a shortened hash of a directory that has been zipped up
#!/bin/bash
DIRECTORY_PATH="some/path/dir"
LENGTH=10
zip --quiet --recurse-paths TEMP.zip \
${DIRECTORY_PATH} \
--exclude "**/<SOME SUB DIR>/*" "**/*.<SOME FILE EXTENSION>"
shasum -a 256 TEMP.zip \
#!/bin/bash
##############################################################################
#
# Usage:
# 1. Hardcode parameters and run the script
# 2. Pass parameters into script.
# Example: ./jenkins-generate-api-token.sh https://localhost:8080 test-token myid mypassword
#
# NOTE: For security purposes, maybe better to pass password with environmental variable