Skip to content

Instantly share code, notes, and snippets.

View cmj's full-sized avatar
💭
📠

cmj cmj

💭
📠
View GitHub Profile
@cmj
cmj / headset_battery.sh
Last active April 18, 2021 16:39
Desktop notify for bluetooth headset battery levels.
#!/bin/bash
# libnotify script to display bluetooth battery level with corresponding Adwaita
# battery iconset
# https://github.com/TheWeirdDev/Bluetooth_Headset_Battery_Level
# Battery level for 11:11:22:33:A3:1E is 40%
# example output: https://i.imgur.com/DH6Vd0V.png
src=$(bluetooth_battery.py $(bluetoothctl info | awk '/^Device/ {print $2}'))
dev=$(bluetoothctl info | sed -n '/Name/s/.*: //p')
@cmj
cmj / nvbright.sh
Created March 8, 2022 03:37
nvidia brightness control
#!/bin/bash
# nvidia brightness control
nvrc=~/.nvidia-settings-rc
# increments
brightness=.075
contrast=.05
gamma=.04
@cmj
cmj / pollen-history.sh
Created April 1, 2022 14:55
pollen index history
#!/bin/bash
# pollen index history
#
# needs pysparklines, lolcat
# pip install pysparklines
zip=98101
cols=$(tput cols) # number of days, or column width of terminal
#EXTM3U
#EXTINF:0,1plus1
#https://1plus1-rakuten.amagi.tv/playlist.m3u8
#EXTINF:0,24hours Movies
https://muxip-24hoursmovies-klowdtv.amagi.tv/playlist.m3u8
#EXTINF:0,AccuWeather
https://amg00684-accuweatherinc-accuweather-stirr-69yvl.amagi.tv/playlist.m3u8
#EXTINF:0,Action Hollywood Movies
https://actionhollywood-klowdtv.amagi.tv/playlist.m3u8
#EXTINF:0,Agora TV
#!/usr/bin/perl -w
# a suite of text filters to annoy people :D
#
# author: cj_ <cjones@insub.org>
#
# "If used sparingly, and in good taste, ASCII art generally
# is very well-received !"
# -- Some Sucker
#
@cmj
cmj / smoke_animation.sh
Last active November 26, 2022 16:09
Convert HRRR smoke images to mp4
#!/bin/bash
# Create animation from HRRR NW current smoke graphics.
# Considerably more accurate than with stitching forecasts.
#
# Domains available: full,NW,NC,NE,SW,SC,SE,GreatLakes,EastCO,SEA-POR,CentralCA,CHI-DET,NYC-BOS,DCArea,SouthFL,ATL,SouthCA,VortexSE
# Fields: int,sfc,1000ft,6000ft
domain=NW
field=int
start=2022-09-12 # 2022-08-21 <- oldest available date as of 2022-09-11
@cmj
cmj / colormaps.patch
Last active September 22, 2022 00:55
GQRX colormaps patch (magma, inferno, grape)
diff -ruN a/src/qtgui/dockfft.cpp b/src/qtgui/dockfft.cpp
--- a/src/qtgui/dockfft.cpp 2022-09-21 10:35:05.641001733 -0700
+++ b/src/qtgui/dockfft.cpp 2022-09-21 10:39:14.142288880 -0700
@@ -70,6 +70,9 @@
ui->cmapComboBox->addItem(tr("Viridis"), "viridis");
ui->cmapComboBox->addItem(tr("Google Turbo"), "turbo");
ui->cmapComboBox->addItem(tr("Plasma"), "plasma");
+ ui->cmapComboBox->addItem(tr("Magma"), "magma");
+ ui->cmapComboBox->addItem(tr("Inferno"), "inferno");
+ ui->cmapComboBox->addItem(tr("Grape"), "grape");
@cmj
cmj / imgur_convert.sh
Created September 28, 2022 14:15
Drop every other frame with ffmpeg
#!/bin/bash
# Drop every other frame in a 2 minute clip to meet
# imgur 1 minute maximum upload length requirements
ffmpeg -y -i $1 -vf select='not(mod(n\,2)),setpts=0.5*PTS' -r 30 sn-$(date '+%Y-%m-%d_%H:00-%S').mp4
@cmj
cmj / beaches.m3u8
Last active September 29, 2022 13:48
Surfline beach cams playlist.
#EXTINF:0,US - CA - LA - Chart House
https://cams.cdn-surfline.com/cdn-wc/wc-charthouse/playlist.m3u8
#EXTINF:0,US - CA - LA - County Line
https://cams.cdn-surfline.com/cdn-wc/wc-countylinebeach/playlist.m3u8
#EXTINF:0,US - CA - LA - County Line Overview
https://cams.cdn-surfline.com/cdn-wc/wc-countylineov/playlist.m3u8
#EXTINF:0,US - CA - LA - El Porto Close-Up
https://cams.cdn-surfline.com/cdn-wc/wc-elportoclose/playlist.m3u8
#EXTINF:0,US - CA - LA - El Porto North, Close Up
https://cams.cdn-surfline.com/cdn-wc/wc-elportonorth/playlist.m3u8
@cmj
cmj / hrrr-48.sh
Last active October 16, 2022 16:53
HRRR smoke animation forecast
#!/bin/bash
# Create animation from HRRR smoke FORECAST from runs at 12z. Overlay local TZ timestamp.
# Domains available: full,NW,NC,NE,SW,SC,SE,GreatLakes,EastCO,SEA-POR,CentralCA,CHI-DET,NYC-BOS,DCArea,SouthFL,ATL,SouthCA,VortexSE
# Fields: int,sfc,1000ft,6000ft
domain=SEA-POR
field=int
today=$(date '+%Y%m%d')