Skip to content

Instantly share code, notes, and snippets.

View eat-sleep-code's full-sized avatar

<eat-sleep-code/> eat-sleep-code

View GitHub Profile
@eat-sleep-code
eat-sleep-code / pi-setup.sh
Created December 30, 2023 17:11
A few setup steps when setting up a Raspberry Pi OS desktop
# SETUP .bash_aliases FILE FIRST FOR UPDATE SHORTCUTS
cd ~
sudo apt install -y ca-certificates curl gnupg build-essential
# Install VS Code
cd ~
sudo apt install code
# Install .NET (Update version below)
@eat-sleep-code
eat-sleep-code / provision.bat
Last active July 19, 2023 18:01
Quickly Provision Common Software on a PC using Chocolatey
choco install googlechrome -y
choco install adobereader -y
choco install speedtest -y
choco install git -y
choco install vscode -y
choco install dotnet-sdk -y
choco install python -y
choco install nodejs -y
npm upgrade -g
@eat-sleep-code
eat-sleep-code / Remove Nessus Agent.sh
Created May 10, 2021 15:29
Script to remove Tenable Nessus Agent from macOS computers (works with Big Sur)
sudo rm -Rf /Library/NessusAgent
sudo rm -Rf /Library/LaunchDemons/com.tenablesecurity
sudo rm -Rf /Library/PreferencePanes/Nessus\ Agent\ Preferences.prefPane
sudo launchctl remove com.tenablesecurity.nessusagent
@eat-sleep-code
eat-sleep-code / Remove Sentinel.sh
Last active December 2, 2021 20:50
Script to remove Sentinel One from macOS computers (works with Big Sur and Monterey)
sudo launchctl remove com.sentinelone.sentineld-helper
sudo launchctl remove com.sentinelone.sentineld-updater
sudo launchctl remove com.sentinelone.sentineld
sudo launchctl remove com.sentinelone.sentineld-guard
sudo killall SentinelAgent
sudo rm -rf /Library/Extensions/Sentinel.kext
sudo rm -rf /Library/Extensions/Sentinel.kext/Contents
sudo rm -rf /Library/Extensions/Sentinel.kext/Contents/Info.plist
@eat-sleep-code
eat-sleep-code / .bash_aliases
Last active December 30, 2023 16:58
Bash aliases to handle common tasks on a Raspberry Pi
alias health='/bin/vcgencmd measure_temp; echo "----------"; free --mega; echo "----------"; df -Bm'
alias shutdown='sudo shutdown now'
alias update='sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean'
alias update-npm='sudo npm install npm -g && sudo npm update -g && sudo npm update'
#alias microscope='ffplay -f v4l2 -video_size 1280x720 -i /dev/video0'
@eat-sleep-code
eat-sleep-code / clear-yahoo-mail-inbox.js
Last active February 17, 2020 23:21
Clear Yahoo Mail Inbox
window.setInterval(function(){
var element = document.querySelector('[aria-label="Select message"]').click();
window.setTimeout(function(){},1000);
document.querySelector('[data-test-id="toolbar-delete"]').click();
window.setTimeout(function(){},1000);
}, 1000);
@eat-sleep-code
eat-sleep-code / toggle-dns.ps1
Last active August 15, 2020 04:35
Powershell Script to toggle DNS entries between CloudFlare and PiHole
if ((Get-DnsClientServerAddress -AddressFamily IPv4 -InterfaceAlias 'Ethernet').ServerAddresses -like '1.1.1.1') {
Set-DnsClientServerAddress -InterfaceAlias 'Ethernet' -ServerAddresses ('192.168.1.2');
Disable-NetAdapterBinding -Name Ethernet -ComponentID ms_tcpip6 -PassThru
}
else
{
Enable-NetAdapterBinding -Name Ethernet -ComponentID ms_tcpip6 -PassThru
Set-DnsClientServerAddress -InterfaceAlias 'Ethernet' -ServerAddresses ('1.1.1.1','1.0.0.1');
Set-DNSClientServerAddress -InterfaceAlias 'Ethernet' –ServerAddresses ('2606:4700:4700::1111','2606:4700:4700::1001');
}
@eat-sleep-code
eat-sleep-code / map-string-to-index.js
Last active August 15, 2020 04:35
Map String to Index
var mappingIndex = 0;
var mappingDictionary = [];
function MappingDictionary(stringToFind) {
output = 0;
var queryResult = mappingDictionary.filter(obj => Object.values(obj).some(val => val?val.toString().toLowerCase().includes(stringToFind):false))[0];
if (queryResult) {
output = queryResult["Key"];
}
else {
@eat-sleep-code
eat-sleep-code / publish.sh
Last active August 15, 2020 04:33
Shell script for performing build, commit, and deploy (alter as necessary)
#! /bin/sh -e
commitMessage="$1"
release="$2"
version=$(date +"v%Y.%m.%d.%H%M%S")
grunt
git add . -A
git commit -m "$version: $commitMessage"
git push -u origin development
@eat-sleep-code
eat-sleep-code / ubuntu-desktop-config.sh
Last active March 24, 2020 23:54
Script to automate some of the post-installation steps in Ubuntu / Debian. NOTE: Double-check version numbers, etc. before executing!
sudo apt-get update
sudo apt-get dist-upgrade
### if using some Dell Bluetooth modules...
# sudo touch /etc/udev/rules.d/97-hid2hci.rules
# sudo apt-get remove bluez
### if using Oracle VirtualBox...
# sudo apt-get install virtualbox-guest-x11
# sudo VBoxClient --clipboard