Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@glnds
glnds / less-cheatsheet.md
Last active April 19, 2024 15:15
Less Cheatsheet

Less Cheatsheet

less {filename}
Navigation
SPACE forward one window
b backward one window
d forward half window
@harryi3t
harryi3t / update-slack-status-on-lock-events
Created January 10, 2017 10:59
set the slack status as away on screen lock and back to active on screen unlock
#/bin/bash
TOKEN='put your token here. Get a new from https://api.slack.com/docs/oauth-test-tokens'
dbus-monitor --session type='signal',interface='com.canonical.Unity.Session' | while true
do
read x
if echo "$x" | grep -q Locked; then
echo "set yourself away at $(date)"
curl -X GET -H "Cache-Control: no-cache" "https://slack.com/api/users.setPresence?token=$TOKEN&presence=away"
@koenrh
koenrh / gcp-gpu-vm-hashcat.md
Last active February 4, 2024 18:37
Running Hashcat on Google Cloud's new GPU-based VMs

Running Hashcat on Google Cloud's GPU-based VMs

In February 2017, Google announced the availability GPU-based VMs. I spun up a few of these instances, and ran some benchmarks. Along the way, I wrote down the steps taken to provision these VM instances, and install relevant drivers.

Update April 2019: Updated instructions to use instances with the Tesla T4 GPUs.

@mill1000
mill1000 / README.md
Last active April 22, 2024 07:24
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@y-polek
y-polek / doze_mode_adb_commands.sh
Last active April 20, 2024 09:36
adb commands to test Doze mode
#! /bin/zsh
# Buttery powered state
adb shell dumpsys battery | grep powered
# Unplug battery
adb shell dumpsys battery unplug
# Reset battery
adb shell dumpsys battery reset
@mill1000
mill1000 / raspbianmonitor.sh
Created January 25, 2020 16:56
raspibanmonitor - Raspberry Pi 3 Monitor Script
#!/bin/bash
# Continuously queries RPi3 GPU for temperature, clock rates and throttled status
# Original from https://www.raspberrypi.org/forums/viewtopic.php?t=244320
echo -e "Time Temp CPU Core Health Vcore"
while true ; do
Temp=$(vcgencmd measure_temp | cut -f2 -d=)
Clockspeed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f",$2/1000000); }' )
Corespeed=$(vcgencmd measure_clock core | awk -F"=" '{printf ("%0.0f",$2/1000000); }' )
Health=$(vcgencmd get_throttled | awk -F"=" '{printf("0x%08x\n",$2)}')
CoreVolt=$(vcgencmd measure_volts | cut -f2 -d=)