Skip to content

Instantly share code, notes, and snippets.

View alismx's full-sized avatar
👻

Alis Akers alismx

👻
View GitHub Profile
@alismx
alismx / gh-workflow-dependabot-create-issue.yml
Last active October 24, 2022 01:59
GitHub workflow to create an issue as when Dependabot opens a PR.
name: Dependabot Create Issue
on:
pull_request:
types: [opened, reopened]
jobs:
issue:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
@alismx
alismx / gh-workflow-dependabot-close-issue.yml
Last active October 24, 2022 01:58
GitHub workflow to close issues as Dependabot PRs are closed. It searches GitHub issues based on labels and title strings.
name: Dependabot Close Issue
on:
pull_request:
types: [closed]
jobs:
issue:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
@alismx
alismx / gh-workflow-build-docker-image.yml
Last active October 24, 2022 01:56
GitHub workflow to build and push images to a docker registry.
name: Build docker image
on:
push:
branches:
- main
paths:
- ""
env:
@alismx
alismx / gh-workflow-lhci-autorun.yml
Last active October 24, 2022 01:56
GitHub workflow to run lighthouse (performance, accessibility, best practices, SEO, PWA scanning) and upload results as artifacts.
# https://github.com/GoogleChrome/lighthouse-ci
name: "Lighthouse Audit"
on:
workflow_dispatch:
pull_request:
branches:
- "**"
jobs:
lhci:
name: Lighthouse
@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:
@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 / 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 / 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 / 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 / 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()