Skip to content

Instantly share code, notes, and snippets.

@gartnera
gartnera / click_notification.scpt
Created April 21, 2024 20:52
applescript to activate/raise the first notifcation on macos sonoma
tell application "System Events"
-- this is a custom keyboard shortcut for command + control + left arrow (Mission Control -> Show Notification Center)
keystroke (ASCII character 28) using {control down, command down}
end tell
tell application "System Events"
set _first_notification to group 1 of UI element 1 of scroll area 1 of group 1 of window "Notification Center" of application process "NotificationCenter"
-- this activates the notification group
click _first_notification
-- this actually follows the notification
@gartnera
gartnera / clpeak
Last active December 17, 2022 06:36
7900XT Linux Benchmarks. AMD Ryzen 7 7700X CPU. 32GB RAM. Ubuntu 22.04 userspace.
root@rocm22:~/clpeak/build# ./clpeak -d 0
Platform: AMD Accelerated Parallel Processing
Device: gfx1100
Driver version : 3513.0 (HSA1.1,LC) (Linux x64)
Compute units : 42
Clock frequency : 3125 MHz
Global memory bandwidth (GBPS)
float : 615.87
@gartnera
gartnera / tcp-forward.service
Created January 14, 2017 21:32
systemd service to forward traffic from port 9000 to 9001. Useful for getting around NAT.
[Unit]
Description=Forward TCP from 9000 to 9001 (bidirectional)
After=network.target
[Service]
Type=simple
User=nobody
Group=nobody
ExecStart=/usr/bin/socat TCP-LISTEN:9000,reuseaddr,fork TCP-LISTEN:9001,reuseaddr
Restart=always
// ==UserScript==
// @name Mute preroll ads on twitch
// @namespace http://agartner.com
// @version 0.3
// @author Alex Gartner
// @match https://www.twitch.tv/*
// ==/UserScript==
let interval;
let didMute = false;
/*
Make sure your csv has these headers:
description,dateAcquired,dateSold,salesPrice,cost
Convert csv to json.
Paste the following code into the console.
Run fillAll with the json as an argument.
*/
@gartnera
gartnera / keybase.md
Created June 10, 2015 23:10
keybase.md

Keybase proof

I hereby claim:

  • I am gartnera on github.
  • I am agartner (https://keybase.io/agartner) on keybase.
  • I have a public key whose fingerprint is EC2B 1BF4 932E CB24 D466 21C1 129E C26A 66FE F453

To claim this, I am signing this object:

// ==UserScript==
// @name vmware open console in new tab
// @namespace http://agartner.com
// @version 0.2
// @description opens vmrc console in new tab rather than window. also forces html5 console if html5 = true. forces external if externalConsle = true
// @match https://vcloud.ialab.us/cloud/org/*
// @copyright 2014-2017, Alex Gartner
// ==/UserScript==
unsafeWindow.openPopoutConsole = function(vmName, vmId, vAppName, vmDevicesAvailable, buttonLabels, miscLabels, confirmationLabels, isVmrc) {
@gartnera
gartnera / cloudflare_ddns.sh
Last active November 11, 2017 22:10
A script to update a cloudflare DNS record with your current IP
#!/bin/bash
auth_email='YOUR_EMAIL'
auth_key='YOUR_API_KEY'
zone_id='YOUR_ZONE_ID'
#you must create the record before using this script
record_id='YOUR_RECORD_ID'
host_name='YOUR_HOST_NAME'
@gartnera
gartnera / deleteGarbage.js
Created May 18, 2017 04:10
Delete garbage posts from a facebook messenger conversation
const fs = require("fs");
const login = require("facebook-chat-api");
login({appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8'))}, (err, api) => {
if(err) return console.error(err);
api.setOptions({selfListen: true});
api.listen((err, event) => {
if(err) return console.error(err);
@gartnera
gartnera / gist:9869e5094cb39bf9e616
Last active September 24, 2016 22:10
2016 Mazda6 specs

#OS Version 51.00.350 #uname Linux cmu 3.0.35 #9 SMP PREEMPT Sat Oct 25 16:40:22 EDT 2014 armv7l GNU/Linux

#cpuinfo Processor : ARMv7 Processor rev 10 (v7l) processor : 0 BogoMIPS : 1699.02