Skip to content

Instantly share code, notes, and snippets.

View alismx's full-sized avatar
👻

Alis Akers alismx

👻
View GitHub Profile
### Keybase proof
I hereby claim:
* I am alismx on github.
* I am alismxwll (https://keybase.io/alismxwll) on keybase.
* I have a public key ASBsdpZnOphGCBP595QPS3T1B-jLjyhaSPVTkxeS6dPZFAo
To claim this, I am signing this object:
@alismx
alismx / markdown.md
Last active June 13, 2023 17:10
Hidden content in markdown

Demo

Hidden Content

My hidden text

```bash
echo "code block"
@alismx
alismx / lock.sh
Created April 8, 2023 20:14
This creates a lock based on the existence of a file
#!/bin/bash
LOCK_FILE="/var/lock/s3cmd.lock"
# Check if another instance is already running
if [[ -e $LOCK_FILE ]]; then
echo "Another instance of the script is already running. Exiting..."
exit 1
else
touch $LOCK_FILE
@alismx
alismx / s3cmd_sync.sh
Last active April 8, 2023 20:08
This is a script to sync to s3 compatible tools (AWS S3, Digital Ocean Spaces)
# Add these variables to your environment or define them in the script
# export BUCKET_URL=s3://your-bucket-name/path-to-files/
# export LOCAL_DIR=/path/to/local/dir/
#!/bin/bash
function file_sync() {
local operation=$1
local source=$2
local destination=$3
@alismx
alismx / python_fake_data.py
Last active April 7, 2023 20:29
Python script to generate fake data
# `pip install faker`
# OR
# specify fake in your requirements.txt file
# then run `pip install -r requirements.txt`
#!/usr/bin/python3
from faker import Faker
import csv
fake = Faker()
@alismx
alismx / gradle_liquibase_actions.sh
Last active April 7, 2023 20:33
Script to handle some liquibase commands related to checksums and rollbacks
#!/bin/bash
# Pick and set one of these environmet variables
tag="$LIQUIBASE_ROLLBACK_TAG"
count="$LIQUIBASE_ROLLBACK_COUNT"
clear="$LIQUIBASE_CLEAR_CHECKSUMS"
if [ "${clear}" = "true" ]; then
echo "Clearing checksums..."
gradle liquibaseClearCheckSums
@alismx
alismx / fun_terminal_art.sh
Last active April 7, 2023 20:33
I put this in my profile so when I open a new tab I get some random ascii ¯\_(ツ)_/¯
function generate_ascii_art() {
local chars=("@" "#" "%" "*" "+" "-" "=", "¯\_(ツ)_/¯")
local num_chars=${#chars[@]}
local rows=$(($RANDOM % 10 + 25))
local cols=$(($RANDOM % 10 + 100))
for ((i=0; i<$rows; i++)); do
for ((j=0; j<$cols; j++)); do
local char_idx=$(($RANDOM % $num_chars))
printf "%s" "${chars[$char_idx]}"
done
@alismx
alismx / whatisonport.sh
Last active April 7, 2023 20:34
Bash function to check what is running on a specified port.
# load into your path and run `whatisonport 5432`
whatisonport() {
echo "lsof results - "
echo "$(sudo lsof -i :$1)"
echo " "
echo "fuser results - "
echo "$(sudo fuser $1/tcp)"
echo " "
echo "netstat results - "
echo "$(sudo netstat -ltnp | grep -w :$1)"
@alismx
alismx / gh-workflow-terraform-checks.yml
Last active October 24, 2022 01:48
GitHub workflow to run format, validation, and plan checks against Terraform configuration.
name: Terraform Checks
on:
workflow_dispatch:
pull_request:
branches:
- "**"
defaults:
run:
@alismx
alismx / gh-action-set-swap-space.yml
Last active October 24, 2022 01:50
GitHub action and workflow to set swap space. It feels hacky. Use it if you are running into memory issues on large builds.
name: 'Set Swap Space'
description: Used to set swap
inputs:
swap-size-gb:
description: 'Swap space to create, in Gigabytes.'
required: false
default: '10'
runs:
using: "composite"
steps: