Skip to content

Instantly share code, notes, and snippets.

View andrewodri's full-sized avatar
😍

Andrew Odri andrewodri

😍
View GitHub Profile
@andrewodri
andrewodri / launch.json
Created September 12, 2023 23:30
VSCode task to close an external Terminal on macOS when debugging in Node
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "npm-run-build",
"group": "build",
"type": "shell",
"hide": false,
@andrewodri
andrewodri / bytes.sql
Created May 23, 2023 17:45
Convert SQLite TEXT to underlying binary representation of unicode data as INTEGER
WITH RECURSIVE bytes(i, byte) AS (
VALUES(1, 0)
UNION ALL
SELECT i + 1, (
WITH code_points(code_point) AS (
VALUES(0)
UNION ALL
SELECT (UNICODE(
SUBSTR('hey', i * -1, 1)
) << (i - 1) * 8) FROM code_points LIMIT 2
@andrewodri
andrewodri / obs-virtualcamera.sh
Created October 3, 2022 14:47
Fix for OBS Virtual Camera with common apps
#!/bin/sh -e
sudo codesign --remove-signature /Applications/Discord.app/Contents/Frameworks/Discord\ Helper\ \(GPU\).app /Applications/Discord.app/Contents/Frameworks/Discord\ Helper\ \(Plugin\).app /Applications/Discord.app/Contents/Frameworks/Discord\ Helper\ \(Renderer\).app /Applications/Discord.app/Contents/Frameworks/Discord\ Helper.app
@andrewodri
andrewodri / settings.json
Last active January 5, 2022 16:21
VSCode settings for darker Dark+ theme
{
"editor.tabSize": 2,
"editor.detectIndentation": false,
"editor.useTabStops": false,
"workbench.startupEditor": "none",
"workbench.colorCustomizations": {
"[*Dark+*]": {
"sideBar.background": "#0F0F0F",
"editor.background": "#070707",
"editorGroupHeader.tabsBackground": "#0F0F0F",
@andrewodri
andrewodri / README.md
Created December 17, 2021 23:14
Roku TV power on/off via macOS shortcuts

Follow the steps below for each script: (i.e. Power on, and power off)

  1. Open Automator
  2. Create a new Quick Action
  3. Add "Run Shell Script" to the workflow
  4. Select "no input" in "any application"
  5. Paste one of the scripts below (minus the shebang line) into the shell script window
  6. Set DEVICE_HOSTNAME to the value of the Roku TVs hostname
  7. Select "/bin/sh" as the shell
  8. Test your automation
@andrewodri
andrewodri / reset.sh
Created December 1, 2021 21:31
OpenWRT sledgehammer USB rebinding
#!/bin/sh
for i in /sys/bus/pci/drivers/[uoex]hci_hcd/*:*; do
[ -e "$i" ] || continue
echo "${i##*/}" > "${i%/*}/unbind"
echo "${i##*/}" > "${i%/*}/bind"
done
@andrewodri
andrewodri / version.sh
Last active January 10, 2022 16:44
Container daemon/utility version dumper for Debian
#!/bin/bash
printf '\033[0;32m%-20s\033[0m%s\n' '[containerd]' "$(containerd --version)"
printf '\033[0;32m%-20s\033[0m%s\n' '[docker]' "$(docker --version)"
printf '\033[0;32m%-20s\033[0m%s\n' '[kubelet]' "$(kubelet --version)"
printf '\033[0;32m%-20s\033[0m%s\n' '[kubeadm]' "$(kubeadm version --output short)"
printf '\033[0;32m%-20s\033[0m%s\n' '[kubectl]' "$(kubectl version --short | tr '\n' ' ')"
printf '\033[0;32m%-20s\033[0m%s\n\n' '[helm]' "$(helm version --short)"
@andrewodri
andrewodri / remove-signature.sh
Last active December 24, 2021 19:19
Allow WhatsApp Desktop to access OBS virtual camera by removing signatures
#!/bin/bash
cat > entitlements.xml << EOM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
@andrewodri
andrewodri / README.md
Created July 1, 2021 15:04
Enhanced XProtect imagineering

XProtect is the behind-the-scenes, developer opted-in version of Windows Defender from what I can tell. Wouldn't it be nice if it was as well throught out and integrated as Defender?

This is kind of a brain and internet dump of random XProtect facts that could be helpful in building a bit of control, UI, definition updates and regular scans that leverage XProtect as it's core.

@andrewodri
andrewodri / convert.sh
Created April 29, 2021 14:02
Create morphed animated GIF with delay at beginning and end
#!/bin/bash
brew install imagemagick
convert -delay 5 001.jpg 002.png -morph 20 -loop 0 gif:- | convert - \
\( -clone 1 -set delay 300 \) -swap 1 +delete \
\( +clone -set delay 500 \) +swap +delete \
output.gif