Skip to content

Instantly share code, notes, and snippets.

@anakuron
anakuron / gist:b46c37d4e70b87a2308a7ed0a7d99970
Last active August 20, 2023 11:16
home server setup steps
unifi install
https://community.ui.com/questions/UniFi-Installation-Scripts-or-UniFi-Easy-Update-Script-or-UniFi-Lets-Encrypt-or-UniFi-Easy-Encrypt-/ccbc7530-dd61-40a7-82ec-22b17f027776
home assistant
https://github.com/home-assistant/supervised-installer
Or you can create a fake systemd-resolved package using equivs which will satisfy the missing dependency.
Install equivs
sudo apt install equivs
@anakuron
anakuron / gist:f239330d0dcd894cc1a6faefc455b5ce
Last active August 10, 2023 20:28
mpd ledfx configuration
general packages:
sudo apt install pulsemixer screen
#
# installing LEDFX
#
sudo apt update && sudo apt upgrade -y
sudo apt install -y python3-pip pulseaudio portaudio19-dev git
python3 -m pip install --upgrade pip wheel setuptools
@anakuron
anakuron / config.txt
Created May 10, 2023 16:53
crtpi raspi4 naomi boot settings
#vcgencmd hdmi_cvt 640 480 60 4:3 0 0 0 60
#hdmi_timings=640 0 16 64 80 480 1 3 7 10 0 0 0 59 0 23500000 4
#stabiili mutta jitteriä
#hdmi_timings=640 0 16 64 80 480 1 3 7 11 0 0 0 62 0 25000000 4
hdmi_timings=640 0 16 64 80 480 1 3 7 10 0 0 0 61 0 24250000 4
#hdmi_timings=1280 0 32 128 160 480 1 3 2 15 0 0 2 61 0 48500000 3
#hdmi_timings=640 0 16 64 80 480 1 3 7 10 0 0 0 59 0 23750000 4
@anakuron
anakuron / gist:71ba4a61df29f6a80dd15e7bcc6838e6
Last active April 9, 2023 18:42
Retrochip tester avrdude flash in linux using leonardo as arduino isp
#set the fuses
# defaults L:0xf7 H:0xd7 E:0xff
# setting h-fuse as 0xd7 keeps configuration files, 0xdf will erase everything
# l-fuse as 0xff will use low power oscillator
avrdude -v -p atmega2560 -c stk500v1 -P /dev/ttyACM0 -U lfuse:w:0xff:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
#flashing
avrdude -v -p atmega2560 -c stk500v1 -P /dev/ttyACM0 -U flash:w:Chip-TesterPro-FW-v0.24.hex:i
#NOTES
@anakuron
anakuron / crontab
Created August 18, 2020 06:26
this will pick a number file randomly from the input folder and write it to output file
#this is a root crontab in /etc/crontab
30 * * * * root /opt/scripts/ssh-banner-switch.sh
@anakuron
anakuron / free-watchdog-mail.sh
Last active August 4, 2020 04:44
memory alert with mail
#!/bin/bash
# source script by Aaron Kili Kisinga / GNU GPL-3
# https://www.tecmint.com/shell-script-to-send-email-alert-when-memory-low/
subject="Memory alert"
from="change this"
to="change this"
memory="100"
free=$(free -mt | grep Mem | awk '{print $4}')
@anakuron
anakuron / df-watchdog.sh
Last active August 3, 2020 10:01
pushover log2ram watchdog alert
#!/bin/bash
free=$(df | grep log2ram | awk '{print $5}' | tr -d %)
if [[ "$free" -gt 90 ]]; then
ntfy -b pushover -o user_key YOURKEY send 'log2ram is over 90%'
fi
exit 0
@anakuron
anakuron / free-watchdog.sh
Last active October 9, 2023 16:47
pushover memory alert
#!/bin/bash
free=$(free -mt | grep Mem | awk '{print $4}')
if [[ "$free" -le 100 ]]; then
ntfy -b pushover -o user_key YOURKEY send 'memory is less than 100MB'
fi
exit 0
@anakuron
anakuron / ruuvidump
Created October 16, 2019 08:09
ruuvicollector dump
-- Logs begin at Thu 2019-02-14 18:11:59 +08, end at Wed 2019-10-16 15:51:48 +08. --
Oct 10 17:31:15 kosong systemd[1]: Started RuuviCollector.
Oct 10 17:31:21 kosong RuuviCollector[307]: 2019-10-10 17:31:21.058 DEBUG [Main] Starting scan with: [hcitool, lescan, --duplicates, --passive]
Oct 10 17:31:21 kosong RuuviCollector[307]: 2019-10-10 17:31:21.089 DEBUG [Main] Starting dump with: [hcidump, --raw]
Oct 10 17:31:21 kosong RuuviCollector[307]: 2019-10-10 17:31:21.111 INFO [Main] BLE listener started successfully, waiting for data...
Oct 10 17:31:21 kosong RuuviCollector[307]: If you don't get any data, check that you are able to run 'hcitool lescan' and 'hcidump --raw' without issues
Oct 10 17:31:26 kosong RuuviCollector[307]: 2019-10-10 17:31:26.415 ERROR [Main] Can't attach to device hci0. No such device(19): Check that your bluetooth adapter is enabled and working properly
Oct 10 17:31:26 kosong RuuviCollector[307]: 2019-10-10 17:31:26.495 INFO [Main] Unclean exit
Oct 10 17:31:26 kosong systemd[1]: ru
@anakuron
anakuron / syslog
Created October 16, 2019 07:20
raspberry pi 4 buster eth0: carrier lost logfile
This file has been truncated, but you can view the full file.
Oct 10 00:00:31 kosong rsyslogd: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="294" x-info="https://www.rsyslog.com"] rsyslogd was HUPed
Oct 10 00:00:31 kosong systemd[1]: logrotate.service: Succeeded.
Oct 10 00:00:31 kosong systemd[1]: Started Rotate log files.
Oct 10 00:00:31 kosong systemd[1]: man-db.service: Succeeded.
Oct 10 00:00:31 kosong systemd[1]: Started Daily man-db regeneration.
Oct 10 00:00:32 kosong influxd[300]: [httpd] 127.0.0.1 - ruuvi [10/Oct/2019:00:00:32 +0800] "POST /write?db=ruuvi&rp=autogen&precision=n&consistency=one HTTP/1.1" 204 0 "-" "okhttp/3.11.0" ec1d0204-eaad-11e9-8e7e-dca6321bb153 18683
Oct 10 00:00:38 kosong influxd[300]: [httpd] 127.0.0.1 - ruuvi [10/Oct/2019:00:00:38 +0800] "POST /write?db=ruuvi&rp=autogen&precision=n&consistency=one HTTP/1.1" 204 0 "-" "okhttp/3.11.0" efc53462-eaad-11e9-8e7f-dca6321bb153 10295
Oct 10 00:00:40 kosong influxd[300]: [httpd] 127.0.0.1 - telegraf [10/Oct/2019:00:00:40 +0800] "POST /write?db=telegraf HTTP/1.1" 204 0 "-" "Telegraf/1.12