Skip to content

Instantly share code, notes, and snippets.

@gnyman
gnyman / Battery Test — Chrome.scpt
Created Jan 18, 2021 — forked from gruber/Battery Test — Chrome.scpt
A simple test to load a series of web pages in Chrome on MacOS repeatedly until the battery runs out.
View Battery Test — Chrome.scpt
on run
set imessage_id to "" -- leave blank to skip sending periodic iMessage progress updates, put your iMessage ID here to get updates as the script runs
set delay_seconds to 5 -- Don't set to 0, it runs too fast. 0.75 is a good setting for "go fast".
set computer_name to do shell script "scutil --get ComputerName"
set os_version to do shell script "sw_vers -productVersion"
set os_build to do shell script "sw_vers -buildVersion"
set _uptime to do shell script "uptime"
set url_list to {"http://techmeme.com", "http://www.consumerreports.org/laptops/macbook-pros-fail-to-earn-consumer-reports-recommendation/", "https://twitter.com/panzer/status/812367550734401536", "http://www.politico.com/story/2016/12/foreign-travelers-social-media-232930", "http://www.macworld.com/article/3153384/gaming/nintendo-plans-to-release-2-or-3-mobile-games-a-year-after-super-mario-runs-success.html", "http://www.wsj.com/articles/cyber-experts-cite-link-between-dnc-hacks-and-aggression-against-uk
@gnyman
gnyman / Battery Test — Safari.scpt
Created Jan 18, 2021 — forked from gruber/Battery Test — Safari.scpt
A simple test to load a series of web pages in Safari repeatedly until the battery runs out.
View Battery Test — Safari.scpt
on run
set imessage_id to "" -- leave blank to skip sending periodic iMessage progress updates, put your iMessage ID here to get updates as the script runs
set delay_seconds to 5 -- Don't set to 0, it runs too fast. 0.75 is a good setting for "go fast".
set computer_name to do shell script "scutil --get ComputerName"
set os_version to do shell script "sw_vers -productVersion"
set os_build to do shell script "sw_vers -buildVersion"
set _uptime to do shell script "uptime"
set url_list to {"http://techmeme.com", "http://www.consumerreports.org/laptops/macbook-pros-fail-to-earn-consumer-reports-recommendation/", "https://twitter.com/panzer/status/812367550734401536", "http://www.politico.com/story/2016/12/foreign-travelers-social-media-232930", "http://www.macworld.com/article/3153384/gaming/nintendo-plans-to-release-2-or-3-mobile-games-a-year-after-super-mario-runs-success.html", "http://www.wsj.com/articles/cyber-experts-cite-link-between-dnc-hacks-and-aggression-against-uk
@gnyman
gnyman / main.go
Last active Oct 15, 2020
minmal slack bot which adds emoji's to messages that matches
View main.go
package main
import (
"strings"
"github.com/shomali11/slacker"
"github.com/slack-go/slack"
)
func main() {
View gist:521bb6054ea3393df3f462c7153e9a3a
This contains lots of senseitive information and I clicked the wrong button. Oops.
@gnyman
gnyman / test_logcheck.sh
Created Nov 13, 2019
A test script to accompany the mini_logcheck.sh
View test_logcheck.sh
#!/bin/sh
# Copyright (C) 2011 Glen Pitt-Pladdy
# Copyright (C) 2019 Gabriel Nyman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
View mini_logcheck.sh
#!/bin/sh
# Copyright (C) 2011 Glen Pitt-Pladdy
# Copyright (C) 2019 Gabriel Nyman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@gnyman
gnyman / ibeacon.lua
Last active May 22, 2019
wireshark iBeacon parser
View ibeacon.lua
-- A better iBeacon parser
-- Wireshark has the capability to parse iBeacons but that parser shows the
-- wrong UUID and does not show TX
-- This is a quick hack to create a iBeacon parser which shows
-- the same UUID as my Android and iPhone test devices
--
-- To use this, place this file in ~/.wireshark/plugins and then open WireShark
-- and view a iBeacon BLE packet. Expand until Manufacturer Specific then
-- right click and choose, Decode As.. Set the field to BT EIR/AD Manufacturer
-- Company ID and the decoder to IBEACON-2
View keybase.md

Keybase proof

I hereby claim:

  • I am gnyman on github.
  • I am gnyman (https://keybase.io/gnyman) on keybase.
  • I have a public key whose fingerprint is 344E C84D C794 0196 C670 6298 A229 866A 2B45 52C3

To claim this, I am signing this object: