Skip to content

Instantly share code, notes, and snippets.

@qpwo
qpwo / image_loop.sh
Created March 3, 2021 04:51
macos shell script to take screenshot and webcam photo every two minutes to track how you spend your computer time
while :
do screencapture ~/screenshots/$(date +%y%m%d%H%M%S)-screen.png;
imagesnap -w 1 ~/screenshots/$(date +%y%m%d%H%M%S)-cam.jpg;
sleep 120;
done
@janaz
janaz / collectd-speedtest.sh
Created September 12, 2020 12:50
Speedtest script for collectd-exec plugin
#!/bin/sh
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
INTERVAL="${COLLECTD_INTERVAL:-3600}"
while true; do
result="$(speedtest --csv)"
upload="$(echo "$result" | cut -d, -f8)"
download="$(echo "$result" | cut -d, -f7)"
echo "PUTVAL \"$HOSTNAME/speedtest/upload\" interval=$INTERVAL N:$upload"
echo "PUTVAL \"$HOSTNAME/speedtest/download\" interval=$INTERVAL N:$download"
@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active July 8, 2024 05:24
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@thewellington
thewellington / removeOffice2011.sh
Created February 20, 2014 17:45
Removes Office 2011 for our Office 265 Migration #mac #office
#!/bin/bash
#
# Uninstall Office for Mac 2011 per http://support.microsoft.com/kb/2398768
#
# by bwellington@fulcrum.net
# Remove Office 2011
rm -Rf /Applications/Microsoft\ Office\ 2011
@sway
sway / fontawesome.sty
Created July 12, 2012 23:14
FontAwesome mapping for XeLaTeX
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX
% Author: Honza Ustohal <honza@egoistic.biz>
%
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter
% This might be reworked into a full blown package in the near future
%
% Prerequisite:
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX
%
% Usage: