Skip to content

Instantly share code, notes, and snippets.

View AlexHunterCodes's full-sized avatar

Alex Hunter AlexHunterCodes

View GitHub Profile
@wipash
wipash / Create-VM-cloud-init.ps1
Last active December 15, 2023 21:39
Create Linux VM on Hyper-V with cloud-init
<#
Create Unix VM's.
PREREQUISITES:
- A VM that has been installed with an OS that supports cloud-init
- cloud-init is installed on the vm
How it works:
- Asks for a bunch of parameters
- Creates a disk from parent vhdx for speed
@frgomes
frgomes / rollback-reboot
Last active October 5, 2022 22:30
etckeeper - rollback and reboot in case of not committed changes
#!/bin/bash
sleep 300
[[ -d /etc/.git ]] && cd /etc && \
[[ $(git status --short | wc -l) -gt 0 ]] && \
git stash && \
logger etckeeper-roolback: reverted /etc to a previous state && \
sync; sync; sync && \
reboot
@sboettcher
sboettcher / FF57+RoomyBookmarksToolbar.md
Last active February 26, 2024 07:10
Firefox Quantum Roomy Bookmarks Toolbar

Firefox Config

Before adding the userChrome.css, you must enable loading it in the Firefox config (Firefox 69+):

  • In Firefox, browse to about:config (accept the warning prompt)
  • search for toolkit.legacyUserProfileCustomizations.stylesheets
  • double click the entry so it says true

Profile Folder

Here is how to find your Firefox profile folder:

  • Windows Default: %APPDATA%\Mozilla\Firefox\Profiles\xxxxxxxx.default\
  • Ubuntu Default (apt): ~/.mozilla/firefox/xxxxxxxx.default/
@gbaman
gbaman / HowToOTGFast.md
Last active May 1, 2024 08:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@cjdaniel
cjdaniel / dscovr-epic-desktop
Last active February 4, 2016 15:25 — forked from quinncomendant/dscovr-epic-desktop
This is an OS X command-line script that downloads the latest DSCOVR:EPIC <http://epic.gsfc.nasa.gov/> image and sets it as your desktop picture. Prerequisites: requires installing Homebrew <http://brew.sh/> and then the jshon tool (`brew install jshon`). Then you can run the command manually, or add it to your crontab.
#!/usr/bin/env bash
download_directory="$HOME/Pictures/Wallpapers/epic-earth";
apiurl="http://epic.gsfc.nasa.gov/api/images.php";
curl -s "$apiurl" | jshon -a -e image -u | while read image; do
destfile="$download_directory/$image.jpg";
mkdir -p "$download_directory";
if [[ -n "$image" && ! -f "$destfile" ]]; then
echo "New 🌍 ! $image.jpg";
curl -so "$destfile" "http://epic.gsfc.nasa.gov/epic-archive/jpg/$image.jpg";
ln -sf "$destfile" "$download_directory/latest.jpg";
@AlexHunterCodes
AlexHunterCodes / dundeemakerspace-linux-setup.sh
Last active November 10, 2015 00:21 — forked from grantcodes/dundeemakerspace-linux-setup.sh
The setup script for Dundee MakerSpace standard Lubuntu install
#! /bin/bash
# Add PPAs {
#
# chrome
#
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@quinncomendant
quinncomendant / dscovr-epic-desktop
Last active September 13, 2018 22:14
This is an OS X command-line script that downloads the latest DSCOVR:EPIC <http://epic.gsfc.nasa.gov/> image and sets it as your desktop picture. Prerequisites: requires installing Homebrew <http://brew.sh/> and then the jshon tool (`brew install jshon`). Then you can run the command manually, or add it to your crontab.
#!/usr/bin/env bash
download_directory="$HOME/Desktop/_dl/epic-earth";
apiurl="http://epic.gsfc.nasa.gov/api/images.php";
curl -s "$apiurl" | jshon -a -e image -u | while read image; do
destfile="$download_directory/$image.jpg";
mkdir -p "$download_directory";
if [[ -n "$image" && ! -f "$destfile" ]]; then
echo "New 🌍 ! $image.jpg";
curl -so "$destfile" "http://epic.gsfc.nasa.gov/epic-archive/jpg/$image.jpg";
ln -sf "$destfile" "$download_directory/latest.jpg";
@grantcodes
grantcodes / dundeemakerspace-linux-setup.sh
Last active November 10, 2015 00:04
The setup script for Dundee MakerSpace standard Lubuntu install
#! /bin/bash
# Add PPAs {
#
# chrome
#
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'