Skip to content

Instantly share code, notes, and snippets.

View brucebentley's full-sized avatar

Bruce Bentley brucebentley

View GitHub Profile
@brucebentley
brucebentley / install-asdf.sh
Last active November 28, 2023 22:02
Example script to install ASDF along with some common plugins & their latest versions.
#!/usr/bin/env bash
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Update Homebrew:
# - - - - - - - - - - - - - - - - - - - - - - - - -
brew update
# - - - - - - - - - - - - - - - - - - - - - - - - -
# Install asdf dependencies:
# - - - - - - - - - - - - - - - - - - - - - - - - -
@brucebentley
brucebentley / .DS_Store Files.applescript
Created August 20, 2020 13:10
Remove all .DS_Store files that currently exist & prevent them from being generated anymore.
# Clean All
do shell script "sudo find / -name ".DS_Store" -depth -exec rm {} \;"
# Restrict Generating
do shell script "defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE"
do shell script "defaults delete com.apple.desktopservices DSDontWriteNetworkStores"
@brucebentley
brucebentley / Reddit_Wallpaper_Scraper.py
Created June 24, 2020 01:47
A script that downloads r/wallpaper's hottest 100 images and cycles through them as a wallpaper! Please Note: All of the credentials are hidden. Refer to this post to set them up and get it working for yourself ( expected setup time: 5-10 mins ): https://www.storybench.org/how-to-scrape-reddit-with-python/
import praw
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
from urllib.parse import quote
import requests
import sys
import os
os.chdir("/Users/student/Desktop/Background_Images")
print("Navigated to directory...")
@brucebentley
brucebentley / custom-markdown-posts.css
Last active December 10, 2020 17:47
Custom CSS for local Markdown documentation generator.
.markdown-body {
font-family: 'proxima-nova', sans-serif;
font-style: normal;
font-weight: 400;
margin: 0 auto !important;
max-width: calc(100vw - 10%);
width: 100%;
}
@media (max-width: 1239px) {
.markdown-body {
jx create cluster aws \
--cluster-name=${USER}-jx-k8s.brucebentley.dev \
--default-admin-password="administrator" \
--default-environment-prefix="brucebentley" \
--domain="jenkins.brucebentley.dev" \
--environment-git-owner="brucebentley" \
--git-api-token="$GITHUB_TOKEN" \
--git-provider-url="https://github.com" \
--git-username="brucebentley" \
--kaniko=true \
@brucebentley
brucebentley / roll.ps1
Last active October 14, 2021 15:29
❤️ Rick Astley in your Terminal. ❤️
<#
.SYNOPSIS
This Function is designed to RickRoll a specified target(s).
.DESCRIPTION
This Function will RickRoll a specified target(s) by doing the following:
1. Connect to the specified remote computer(s)
2. Use Get-CimInstance to return the logged on user
3. Create a file containing:
a. The RickRoll expression to be run
b. Code to remove teh script after run
@brucebentley
brucebentley / get-image-urls.js
Last active May 20, 2023 04:28
Save images from chrome inspector/dev tools network tab
/**
* 1. Open up chrome dev tools ( Menu > More tools > Developer tools )
* 2. Go to network tab, refresh the page, wait for images to load
* Note: ( some sites you may have to scroll down to the images
* for them to start loading )
* 4. Right click on any entry in the network log, select:
* Copy > Copy All as HAR
* 5. Open up JS console and enter:
* var har = [paste]
* Note: ( pasting could take a while if there's a lot of requests )
@brucebentley
brucebentley / vpn-autostart.scpt
Last active March 2, 2020 09:37
Keep your VPN connected ( macOS )
on idle
tell application "System Events"
tell current location of network preferences
set VPNService to the service "vpn-bruce" -- Replace this with the name of your VPN connection.
if VPNService is not null then
if current configuration of VPNService is not connected then
connect VPNService
end if
end if
end tell
@brucebentley
brucebentley / update-rbenv-rubygems.sh
Created January 3, 2020 15:56
Update all of your Rubygems for each version of Ruby installed using rbenv.
#! /usr/bin/env bash
set -e
eval "$(rbenv init -)"
for version in `rbenv whence gem`; do
rbenv shell "$version"
echo "Updating rubygems for $version"
gem update --system --no-document --quiet

Keybase proof

I hereby claim:

  • I am brucebentley on github.
  • I am brucebentley (https://keybase.io/brucebentley) on keybase.
  • I have a public key ASAR7Dcb7TOYsqaZKsb_xIUikuMbKHJAPATdHzcNyMFXcgo

To claim this, I am signing this object: