Skip to content

Instantly share code, notes, and snippets.

View pcgeek86's full-sized avatar
🍺
🥓

Trevor Sullivan pcgeek86

🍺
🥓
View GitHub Profile
@pcgeek86
pcgeek86 / cheatsheet.ps1
Last active April 16, 2024 14:56
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
@pcgeek86
pcgeek86 / Car Manufacturers.json
Last active April 1, 2024 04:17
Plain-text list of major car manufacturers
[
"Abarth",
"Alfa Romeo",
"Aston Martin",
"Audi",
"Bentley",
"BMW",
"Bugatti",
"Cadillac",
"Chevrolet",
@pcgeek86
pcgeek86 / gist:a1fd9d26f8ad46b51adf9513f67b95f2
Last active March 9, 2024 18:11
Install & test Selenium with Firefox / Gecko driver on headless Ubuntu 18.04 LTS server
sudo apt update
sudo apt install firefox python3-pip xvfb x11-utils --yes
sudo -H pip3 install bpython selenium
export DISPLAY=:2
Xvfb $DISPLAY -ac &
export GECKO_DRIVER_VERSION='v0.24.0'
wget https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz
tar -xvzf geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz
@pcgeek86
pcgeek86 / install_go_pi.sh
Last active February 24, 2024 19:35 — forked from random-robbie/install_go_pi.sh
Install Go Lang on Raspberry Pi
cd $HOME
FileName='go1.13.4.linux-armv6l.tar.gz'
wget https://dl.google.com/go/$FileName
sudo tar -C /usr/local -xvf $FileName
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
@pcgeek86
pcgeek86 / webp_animation_to_gif.py
Last active February 11, 2024 22:18
Convert an animated .webp file to GIF with Python
#!/usr/bin/env python3
# Trevor Sullivan <trevor@trevorsullivan.net>
# https://trevorsullivan.net
# https://twitter.com/pcgeek86
# IMPORTANT: Install the webp Python package, using the following command:
# pip3 install --user webp
# Import the webp package
@pcgeek86
pcgeek86 / powershell-ansi-color.ps1
Created September 14, 2019 22:06
Apply 24-bit colors to your text using PowerShell and ANSI escape sequences
while ($true) {
$Red = Get-Random -SetSeed (Get-Date).Ticks.ToString().Substring(10,8) -Maximum 255
$Green = Get-Random -SetSeed (Get-Date).Ticks.ToString().Substring(10,8) -Maximum 255
$Blue = Get-Random -SetSeed (Get-Date).Ticks.ToString().Substring(10,8) -Maximum 255
Write-Host -Object ("$([char]27)[38;2;{0};{1};{2}mtrevor" -f $Red, $Green, $Blue)
}
@pcgeek86
pcgeek86 / paas_list.md
Last active January 26, 2024 13:53
Heroku Platform as a Service (PaaS) Alternatives with Docker Container Hosting

Open Source

  • Porter - Kubernetes powered PaaS that runs in your own cloud
  • Open Function - cloud-native open-source FaaS (Function as a Service) platform. website
  • CapRover - easy to use app/database deployment & web server manager
  • Tsuru - Open source and extensible Platform as a Service (PaaS) website
  • Kubero - free and self-hosted Heroku PaaS alternative for Kubernetes that implements GitOps
  • Dokku - docker-powered PaaS that helps you build and manage the lifecycle of applications
  • Piku - tiniest PaaS you've ever seen. Allows you to do git push deployments to your own servers.
@pcgeek86
pcgeek86 / rust-videos.md
Last active September 17, 2023 06:54
Free Rust programming tutorial videos 📺
@pcgeek86
pcgeek86 / rust-stdin.rs
Last active September 4, 2023 20:17
Rust Cheatsheet Examples 🦀
// This example shows how to prompt a user for input
// and convert the results to a Rust String type.
fn main() {
let buffer = &mut String::from("");
std::io::stdin().read_line(buffer).unwrap();
let input = buffer.replace("\n", "");
println!("{}no-new-line", input);
}
@pcgeek86
pcgeek86 / linode-images.txt
Last active March 15, 2023 14:58
List of Linode virtual machine images, to use with Terraform CLI, as of March 2023
linode/almalinux8
linode/almalinux9
linode/alpine3.13
linode/alpine3.14
linode/alpine3.15
linode/alpine3.16
linode/alpine3.17
linode/arch
linode/centos7
linode/centos-stream8