Skip to content

Instantly share code, notes, and snippets.

View curiousercreative's full-sized avatar

Winston Hoy curiousercreative

View GitHub Profile
@curiousercreative
curiousercreative / netflix-random.js
Created November 27, 2016 18:47
This script will select a random movie from your Netflix list and play it
// Navigate to your "My List" page before running this in your web console
// Get a list of all titles
var movies = document.querySelectorAll(".slider-item");
// pick a random number between 0 and length
var random = Math.floor(Math.random() * movies.length);
// this is our movie
var movie = movies[random];
@curiousercreative
curiousercreative / system76-power-profile-default.sh
Last active April 28, 2022 12:47
Write a systemd service file to set profile after system76-power service starts and enable it
#!/usr/bin/env bash
# as superuser
sudo su
# write a systemd service file to set profile after system76-power service starts
cat <<EOF > /etc/systemd/system/system76-power-profile-default.service
[Unit]
Description=Set the profile profile at startup.
After=com.system76.PowerDaemon.service
@curiousercreative
curiousercreative / migrate-atom-deb-to-user-flatpak.sh
Created May 31, 2022 16:25
Rough script for migrating common settings from your .deb Atom to user-specific flatpak Atom (Pop!_OS 22.04 tested)
#! /bin/bash
# global config
cp -f ~/.atom/config.cson ~/.var/app/io.atom.Atom/data/
# keybindings
cp -f ~/.atom/keymap.cson ~/.var/app/io.atom.Atom/data/
# init script (maybe you defined some custom function and then bound to a key combo?)
cp -f ~/.atom/init.coffee ~/.var/app/io.atom.Atom/data/
# packages
cp -rf ~/.atom/packages ~/.var/app/io.atom.Atom/data/
@curiousercreative
curiousercreative / system76-power-graphics-power-default.service
Last active September 30, 2022 13:52
write a systemd service file to set graphics power off when integrated graphics mode after system76-power service starts
[Unit]
Description=Set the graphics power to off for integrated graphics during startup.
After=com.system76.PowerDaemon.service
[Service]
Type=simple
ExecStart=/bin/bash -c '[[ $(system76-power graphics) == 'integrated' ]] && system76-power graphics power off'
[Install]
WantedBy=default.target
#! /bin/bash
askYesNo() {
local answer=
while [ "$answer" != "y" ] && [ "$answer" != "n" ]; do
read -e -n 1 -p "$1 (y/n) " answer
done
if [ "$answer" != "y" ]; then
return 1
fi
@curiousercreative
curiousercreative / davinci-resolve-studio.desktop
Created January 9, 2023 16:14
Hybrid graphics laptop DaVinci Resolve desktop file
# ~/.local/share/applications/davinci-resolve-studio.desktop
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Exec=/bin/bash -c '__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia QT_DEVICE_PIXEL_RATIO=1 QT_AUTO_SCREEN_SCALE_FACTOR=true /opt/resolve/bin/resolve'
Icon=/opt/resolve/graphics/DV_Resolve.png
Name=DaVinci Resolve Studio
Terminal=false
MimeType=application/x-resolveproj;
Type=Application
@curiousercreative
curiousercreative / migrate-atom-to-pulsar.sh
Last active January 24, 2023 16:27
Rough migration guide for Atom to Pulsar on Linux
#! /usr/bin/env bash
# NOTE: This worked for my migration from Pop!_OS 22.04 Atom 1.63.1 which was installed with flatpak (user)
# First, download and install the deb package found here https://pulsar-edit.dev/download.html
# for flatpak Atom migration to Pulsar deb - copy configuration and packages
rsync -av ~/.var/app/io.atom.Atom/data/ ~/.pulsar/
# for deb Atom migration to Pulsar deb - copy configuration and packages
#rsync -av ~/.atom/ ~/.pulsar/
@curiousercreative
curiousercreative / main.sh
Last active February 27, 2023 15:34
Make a 2011 MacBook Pro with failing AMD dGPU run Pop!_OS 22.04
#! /usr/bin/env bash
# If the Pop! installer won't boot due to dGPU failure, remove the SATA SSD/HDD from the MacBook and install Pop! to it using a computer that will boot the installer
sudo su
# With Pop! installed and running as root
# disable AMD gpu drivers
cat << EOF > /etc/modprobe.d/blacklist-amd-dgpu.conf
blacklist radeon
@curiousercreative
curiousercreative / displays.sh
Created March 31, 2023 17:36
Script to configure displays using xrandr from an enumerated list
#! /usr/bin/env bash
# displays.sh single
# displays.sh stack
# displays.sh split
# displays.sh triple
case $1 in
single)
xrandr \