Skip to content

Instantly share code, notes, and snippets.

@steelbrain
steelbrain / git-post-pr.sh
Created August 16, 2017 20:55
git-post-pr
#!/bin/bash
# Usage:
# git-post-pr
# Description:
# Deletes local branch (doesn't force so you won't lose local if not pushed remotely)
# Fetches remote so local remote branch is deleted
# Switches to master
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
@steelbrain
steelbrain / git-c
Last active August 23, 2017 05:10
Fancy git commit
#!/bin/bash
# Author: Steel Brain <i@steelbrain.me>
# Name: Git Commit
# Steps:
# - Check if jq is installed or not (need it for parsing package.json)
# - Shows unstaged files
# - Shows staged files
# - Confirms the user they want to proceed
# - Execute the build step and check in any files it modifies
@steelbrain
steelbrain / index.js
Created August 24, 2018 13:10
iTerm2 Color Profile Printer
// Usage: node index.js
// Requires: npm install rgb-hex xml2json
// Requires color profile to be placed as Profile.itermcolors
// in same directory
const fs = require('fs')
const path = require('path')
const rgbHex = require('rgb-hex')
const { toJson } = require('xml2json')
@steelbrain
steelbrain / music_metadata.js
Last active December 1, 2018 06:35
Song metadata filling with ffmpeg node script
#!/usr/bin/env node
// Usage:
// $ cd dir/to/music
// $ node ../../music_metadata.js
// Files format must be:
// [Artist] - [Song Title].{oga,m4a}
const fs = require('fs')
const os = require('os')
@steelbrain
steelbrain / One-Dark.itermcolors
Last active April 20, 2020 03:26
One Dark Iterm scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@steelbrain
steelbrain / README.md
Last active August 14, 2020 05:07
OLED Brightness Daemon

OLED Brightness Daemon

I'm using this for my Razer Blade 17 Pro 2020 to keep the brightness slider in Ubuntu GNOME up to date with the actual brightness of the display.

It's not pretty but it works. Remember to add this to your startup (gnome-session-properties).

License

Licensed under MIT. Use however.

@steelbrain
steelbrain / cygwin-mirror-speed.py
Created October 8, 2020 16:10 — forked from ushkinaz/cygwin-mirror-speed.py
Tests speed of http mirrors of cygwin
#!/usr/bin/env python3
"""
Tests http mirrors of cygwin
"""
import random
import time
from urllib.request import urlopen
import sys
__author__ = 'Dmitry Sidorenko'
@steelbrain
steelbrain / mariadb_repo_setup
Last active February 25, 2022 22:18
Package installation scripts
#!/usr/bin/env bash
# shellcheck disable=2016 disable=1091 disable=2059
version="2022-02-08"
# Notes:
# 2022-02-08 - Adjust repo pinning for Ubuntu/Debian, update MariaDB to 10.7
# 2022-01-31 - Verify that server version is valid
# 2022-01-18 - Add aarch64 RHEL/SLES repositories
# 2021-12-10 - Update keyring URL
@steelbrain
steelbrain / questions.md
Created August 4, 2022 06:04 — forked from marolsi/questions.md
Relationship Compatibility

Questions to help you consider if a partner is right for you. Be sure to take a step back from your reasons for swaying one way or another, and answer as honestly as possible!

Questions

  1. Do you feel physically attracted to this person?
  2. Do you look forward to spending time with them?
  3. Do you feel like you don’t have to hold back who you are around them?
  4. Do you like the part of yourself that they bring out?
  5. Do you have evidence that your current lifestyles are compatible?
  6. What goals and dreams are important to you in your life? Are they compatible with this person’s goals and dreams?
  7. Do you have any principles that guide your decisions in life? If so, are you confident that they share or at least respect these?
@steelbrain
steelbrain / bridge-diff-subnet.sh
Created June 11, 2023 02:14 — forked from glenselle/bridge-diff-subnet.sh
Raspberry PI4 Wifi to Eth Bridge
#!/usr/bin/env bash
set -e
[ $EUID -ne 0 ] && echo "run as root" >&2 && exit 1
apt-get update && apt install -y dnsmasq
# Create a directory where we will store our `iptables` forwarding rules.
mkdir -p /etc/iptables