This guide explains how to automate an Elgato Key Light to turn on when OBS Studio opens and off when it closes, using macOS's launchd
.
- Elgato Key Light connected to the same network as your Mac.
- OBS Studio installed on your Mac.
#!/bin/sh | |
# Usage Instructions | |
# - Open Opal and login to AWS. | |
# - Copy content with environment variables and place it to ~/.aws/opal-config.txt | |
# - Make the script executable: chmod +x update-config.sh | |
# - The script will place the credentials to ~/.aws/config | |
config_file="$HOME/.aws/opal-config.txt" | |
aws_config_file="$HOME/.aws/config" |
# Open rails console `rails c` and run the command: | |
ActiveRecord::Base.descendants.map(&:name).each { |name| puts name } | |
# Alternatively, list classes that extend ActiveRecord::Base or any other class the application might use as a base model | |
ObjectSpace.each_object(Class).select { |klass| klass < ActiveRecord::Base }.map(&:name).sort | |
# For docker-based apps | |
docker exec -it [your_container_name] rails runner "ActiveRecord::Base.descendants.each { |model| puts model.name }" |
#!/usr/bin/env ruby | |
require 'digest' | |
require 'fileutils' | |
# Function to calculate the checksum for a directory | |
def calculate_checksum(directory_path, excluded_directories = []) | |
checksum = Digest::SHA256.new | |
Dir[File.join(directory_path, '**', '**/*')].each do |file| |
function ListNode(val, next) { | |
this.val = (val === undefined ? 0 : val); | |
this.next = (next === undefined ? null : next); | |
} | |
const addTwoNumbers = (l1, l2) => { | |
let carry = 0; | |
let result = new ListNode(-1) | |
let dummy = result; |
class LruCache { | |
constructor(capacity) { | |
this.capacity = capacity; | |
this.map = new Map(); | |
} | |
get(key) { | |
if(this.map.has(key)) { | |
let val = this.map.get(key); | |
this.map.delete(key); |
package main | |
import "fmt" | |
func main() { | |
var a = [][]int{ | |
{0, 0, 1, 1, 0}, | |
{0, 0, 1, 1, 0}, | |
{1, 0, 1, 0, 0}, | |
{1, 0, 1, 0, 0}, |
bluetoothctl | |
power on | |
discoverable on | |
pairable on | |
scan on |
#!/bin/bash | |
# This script downloads photo of the day from nationalgeographic.com and set it as desktop wallpaper. | |
# Applicable for Ubuntu KDE 18.04 | |
# Permission to copy, modify, and distribute is granted under GPLv3 | |
# Last Revised 7 Mar 2019 | |
# | |
# Initial installation: | |
# Place the script into /usr/local/bin/ng_image_skin | |
# Run it to pull image and create symlink to it which will be lcocated at ~/Picture/Wallpapers/wp_image | |
# Set desktop image manually that pointed to ~/Picture/Wallpapers/wp_image |
#!/bin/bash | |
# | |
# Install linux kernel 4.19 | |
# | |
# To check last available dep's visit https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/ | |
# | |
## | |
rm -rf linux-*; |