Skip to content

Instantly share code, notes, and snippets.

@kepstin
kepstin / configuration.yml
Last active April 15, 2024 04:10
Home Assistant EWMA template sensor
- trigger:
- id: state_changed
platform: state
entity_id: sensor.147334558305449_indoor_temperature
to: null
- id: time_pattern
platform: time_pattern
minutes: "/1"
action:
variables:
@kepstin
kepstin / gist:584acf83708cb228be66833003695410
Last active January 7, 2020 23:17
nm is broken with lto objects
Using the following example C file:
int foo;
int bar = 0;
And compiling the file normally, with gcc -c -o test.o test.c, the nm output looks like this:
0000000000000000 B bar
0000000000000004 C foo
And with gcc -fno-common -c -o test.o test.c:
use std::ops::{Shr,Neg};
use std::marker::Sized;
trait ShrCeil<Rhs=Self>
{
type Output;
fn shr_ceil(self, rhs: Rhs) -> Self::Output;
}
@kepstin
kepstin / dmesg
Created March 22, 2019 04:37
mai dmesg linux kernel 5.0.0
[ 0.000000] Linux version 5.0.0-gentoo (root@mai) (gcc version 8.3.0 (Gentoo 8.3.0 p1.0)) #1 Fri Mar 8 16:06:09 EST 2019
[ 0.000000] x86/fpu: x87 FPU will use FSAVE
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003ffeffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000003fff0000-0x000000003fff7fff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000003fff8000-0x000000003fffffff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x00000000fffe0000-0x00000000ffffffff] reserved
<?xml version="1.0"?>
<ThermalConfiguration>
<Platform>
<Name>Thinkpad T440p</Name>
<UUID>*</UUID>
<ProductName>*</ProductName>
<Preference>QUIET</Preference><!-- if set to PERFORMANCE, the rapl throttling won't be used -->
<CoolingDevices>
<CoolingDevice>
<Type>rapl_controller</Type>
Authentication-Results: mx.google.com; dkim=neutral (body hash did not
verify) header.i=@kepstin.ca; spf=pass (google.com: best guess record for
domain of exherbo-dev-bounces+exherbo-dev=kepstin.ca@lists.exherbo.org
designates 185.38.172.64 as permitted sender)
smtp.mailfrom=exherbo-dev-bounces+exherbo-dev=kepstin.ca@lists.exherbo.org;
dmarc=fail (p=REJECT dis=NONE) header.from=kepstin.ca

Keybase proof

I hereby claim:

  • I am kepstin on github.
  • I am kepstin (https://keybase.io/kepstin) on keybase.
  • I have a public key ASD0l-qXvzkZ09Y172zL3um2MS5T2qZGMHWB-wp17IhJ4Ao

To claim this, I am signing this object:

#!/bin/bash
hostname="$(hostname -f)"
redis-cli info | tr -d '\015' | while IFS=: read key value
do
case "$key" in
'#'*|'') ;;
*)
echo "$hostname" "redis.$key" "$value"
;;
esac
#!/bin/sh
# Calvin's simple traffic shaper script
# Currently set up to handle traffic shaping on mb gateway
# Note that the ingress and egress rates are hardcoded in the commands below.
set -e
IFACE=$1
if [ -z "$IFACE" ]; then
echo "Usage: $0 <iface>"
ffmpeg -i /var/www/html/ffmpeg_open.mp4 -i /var/www/html/"$filename".mp4 -i /var/www/html/ffmpeg_close.mp4 -filter_complex concat=n=3:v=1:a=1 -acodec aac -vcodec libx264 -movflags +faststart -strict -2 -f mp4 output.mp4