Skip to content

Instantly share code, notes, and snippets.

@Justinzobel
Justinzobel / gist:e40f0cbfee1b2454f28b54f61d0d3506
Created July 19, 2019 06:29
How to switch audio output from a terminal on Linux
Assumes you're using PulseAudio (fairly safe bet).
Find audio devices:
$ pactl list sinks | grep "Name: "
Name: alsa_output.pci-0000_01_00.1.hdmi-stereo
Name: alsa_output.usb-Corsair_Components__Inc._Corsair_Vengeance_1500-00.analog-stereo
Name: alsa_output.pci-0000_00_1f.3.analog-stereo
Copy the name of the sink you want into the variable devicename below and save as a bash script.
This can now be used with a hot-key to switch audio on the fly without opening anything.
@Justinzobel
Justinzobel / gist:382cb56a89979c658ca6588e57c40679
Last active September 30, 2019 01:35
Get all Github user or organisations clone URLs
https clone URL:
GHUSER=USERNAME; curl "https://api.github.com/users/$GHUSER/repos?per_page=100" | grep clone_url | cut -d "\"" -f 4
SSH clone URL:
GHUSER=USERNAME; curl "https://api.github.com/users/$GHUSER/repos?per_page=100" | grep ssh_url | cut -d "\"" -f 4
@Justinzobel
Justinzobel / gist:ce58f27a00fbb33b9ef163360f240eeb
Last active October 6, 2019 03:46
systemd-boot loader entries creation script (used on elementary OS 5.0)
#!/bin/bash
#
# This is a simple custom kernel hook to populate the systemd-boot entries
# whenever kernels are added or removed during an update.
#
distroid=$(cat /etc/lsb-release | grep DISTRIB_ID | cut -d "=" -f 2)
distroname=$(cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | cut -d "\"" -f 2)
# The name of your root partition
partition=$(cat /etc/fstab | grep "/ was on" | cut -d " " -f 5)
@Justinzobel
Justinzobel / gist:1ebf21a1d01b3d0a3a98af75a8bb6be3
Created November 21, 2019 23:54
Disney+ (Disney Plus) Linux Lutris Wine Google Chrome
How to watch Disney+ on Linux with Chrome via Wine and Lutris
Download the .exe installer for Chrome for Windows from https://www.google.com/chrome/?platform=win64
Add a new Game in Lutris using the + in the toolbar
Name it whatever you want
Set runner to Wine
In Game Options tab set executable to the downloaded .exe
Run it, let it install.
It WILL take a long time to install and finish, have patience.
To install texture packs for Minecraft snap open up ~/snap/mc-installer/current/.minecraft/resourcepacks (zip)
#!/bin/bash
mkdir -p OpenOffice/data
tar xf Apache_OpenOffice_*_Linux_x86-64_install-deb_en-US.tar.gz
mv en-US/DEBS/*.deb OpenOffice/
cd OpenOffice/
for i in $(ls -1 openoffice*)
do
mkdir Deb-${i}
mv ${i} Deb-${i}/
pushd Deb-${i} > /dev/null
Tint2 Nord Themed Panel Config
Tint2: https://gitlab.com/o9000/tint2
Nord Palette: https://www.nordtheme.com
#---- Generated by tint2conf 2641 ----
# See https://gitlab.com/o9000/tint2/wikis/Configure for
# full documentation of the configuration options.
#-------------------------------------
# Backgrounds
App: https://github.com/aristocratos/bashtop
#Bashtop theme with nord palette (https://www.nordtheme.com)
#by Justin Zobel <justin.zobel@gmail.com>
# Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal: "#RRGGBB", "#BW" or "0-255 0-255 0-255"
# example for white: "#ffffff", "#ff" or "255 255 255".
# All graphs and meters can be gradients
# For single color graphs leave "mid" and "end" variable empty.
alsa-lib-devel
attr-devel
audiofile-devel
black-hole-solver-devel
check-devel
cmark-devel
cups-devel
cyrus-sasl-devel
dbus-glib-devel
dialog
To get mediawiki page names from MySQL use:
use db_name;
select page_id,cast(page_title as CHAR) from page;