Skip to content

Instantly share code, notes, and snippets.

smooker@shd3 ~/src/rtl-wmbus/build $ rtl_sdr -f 868.95M -g 44 -p 51 -s 1.6e6 - | ./rtl_wmbus
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Sampling at 1600000 S/s.
Tuned to 868950000 Hz.
Tuner gain set to 43.90 dB.
@smooker
smooker / build.sh
Last active March 7, 2024 12:14
TensorFlow build from source on Gentoo
#!/bin/bash
mkdir ~/src/tf
cd ~/src/tf
git clone --recursive https://github.com/tensorflow/tensorflow.git
git clone --recursive https://github.com/bazelbuild/bazel.git #not needed. there is baselisk in portage
### THIS HAS TO BE CLEANED
emerge dev-build/bazelisk
postup() {
ewarn "postup entry for interface ${IFACE}"
# This function could be used, for example, to register with a
# dynamic DNS service. Another possibility would be to
# send/receive mail once the interface is brought up.
# /etc/init.d/named restart
# if [ "${IFACE}"="eth1.3" ]
# then
# sysctl net.ipv6.conf.eth1.3.disable_ipv6=1
@smooker
smooker / gist:0474c46e66b6c49e702f2c81d69ed196
Last active May 27, 2024 08:37
TF 2.17 bazel androiud build
#!/bin/bash
bazel build -c opt --cxxopt=--std=c++17 --config=android_arm64 --fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a --define=android_dexmerger_tool=d8_dexmerger --define=android_incremental_dexing_tool=d8_dexbuilder --define=xnn_enable_arm_i8mm=false --define=xnn_enable_avx512amx=false --define=xnn_enable_avxvnni=false --verbose_failures //tensorflow/lite/java:tensorflow-lite
diff --git a/net/slirp.c b/net/slirp.c
index eb9a456ed..85ae4308b 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -970,6 +970,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
fprintf(f,
"[global]\n"
"private dir=%s\n"
+ "min protocol=NT1\n"
"interfaces=127.0.0.1\n"
diff --git a/net/slirp.c b/net/slirp.c
index 85ae430..0f7c1aa 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -1004,8 +1004,8 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
);
fclose(f);
- smb_cmdline = g_strdup_printf("%s -l %s -s %s",
- CONFIG_SMBD_COMMAND, s->smb_dir, smb_conf);
#!/usr/bin/perl
use List::MoreUtils qw(uniq);
use Sort::Key::Natural qw( natsort );
use strict;
use warnings;
die "Usage: $0 [LINE LIST]\n" if @ARGV != 1;
my $input = $ARGV[0];
#!/usr/bin/perl
use strict;
use warnings;
use bigint;
my $a1 = $ARGV[0];
if ($a1 =~ m/0x/) {
$a1 = hex($a1);
}
# Bluepill ttyACMTarg
# and run udevadm control --reload-rules
# udevadm trigger
# disconnect and connect again
ACTION!="add|change", GOTO="bluepill_rules_end"
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="5740", MODE="0666", GROUP="plugdev", TAG+="uaccess"
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="5740", MODE="0666", GROUP="plugdev", TAG+="uaccess"
ACTION=="add", KERNEL=="ttyACM*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", SYMLINK+="ttyACMTarg"
ACTION=="add", KERNEL=="ttyACM*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", SYMLINK+="ttyACMTarg%E{ID_SERIAL_SHORT}"
LABEL="bluepill_rules_end"
@smooker
smooker / xfce_displays_clean.pl
Created April 4, 2026 17:24
XFCE4 displays cleanup + backdrop tool (--recreate for one-shot fix)
#!/usr/bin/perl
# xfce_displays_clean.pl - Parse, clean and apply XFCE4 displays.xml
# + Set wallpaper/color on all connected monitors
# NO EXTERNAL DEPENDENCIES - pure Perl 5 core only
# Usage: ./xfce_displays_clean.pl [displays.xml]
use strict;
use warnings;
use File::Copy;
use POSIX qw(strftime);