Skip to content

Instantly share code, notes, and snippets.

@stuartsoft
stuartsoft / rename-branch.sh
Last active June 27, 2020 03:04
Replaces 'master' branch with 'main' branch for all projects in a desired directory
#!/bin/bash
#usage: $ ./rename-branch.sh ~/yourProjectsDirectory
cd $1
folders=$(ls)
for f in $folders; do
cd $f
echo $f
git checkout -b main
git push --set-upstream origin main
git branch -d master
@stuartsoft
stuartsoft / gist:f6d9d9c7e89182687246682c048062f0
Last active November 26, 2020 04:50
Nvidia 440 drivers on Ubuntu 20.04 on Dell XPS
##Installing Ubuntu and getting the Nvidia Settings application to work
1) Install Ubuntu like normal. Select the option to install 3rd party drivers, and enter a secure boot password.
2) After install is complete, the machine will reboot. When the blue screen appears, select "Enroll MDK". Enroll the Cannonical Secure boot thingy. Then hit the option to reboot.
3) Once you're logged in to Ubuntu, open "Additional Drivers" and switch from the 440 metapackage driver to literally any other Nvidia driver.
Gotta do this because the Nvidia settings app appears to have problems after initial Ubuntu install
4) Reboot and open the grub menu. Select the advanced options, and boot using recovery mode. After unlocking disk encryption, hit the option for "Resume boot"
5) Once you're logged in again, open "Additional Drivers" and switch back to the original 440 driver that was originally selected.
6) Reboot
7) Logged in again, you should now be able to open the Nvidia Xserver settings and see a whole bunch of options o
import time
import gpiozero
fan = gpiozero.LED(14)
fan.off()
fanState = False
while True:
currentTemp = gpiozero.CPUTemperature().temperature
if fanState == 1 and currentTemp <= 40:
print("turning fan off")
1) Download appropriate .run file from Nvidia's website
https://www.nvidia.com/Download/index.aspx?lang=en-us
2) install gcc, make, and linux headers
sudo apt install linux-headers-$(uname -r) gcc make pkg-config libglvnd-dev
3) Sign out to the login screen and press Ctr Alt F3
4) Kill the desktop manager