User Tools

Site Tools


scraps


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scraps [2023/02/28 20:35] – [Build LinuxPTP on Alpine] millerjsscraps [2025/05/29 12:40] (current) – [Anydesk Debian Setup] millerjs
Line 3: Line 3:
 Bits and pieces I want to be able to grab quickly. This page will change frequently. Bits and pieces I want to be able to grab quickly. This page will change frequently.
  
 +===== GNSS Related =====
 +==== PowerRename bulk NRCAN-PPP Results ====
 +Rename ''001_syif136m_full_output.zip'' to ''syif136m_full_output_rapid.zip''
 +
 +
 +Regular Expression: ''^(.{4})(.*)$''
 +Replace with: ''$2_rapid$3''
 +
 +{{::screenshot_2025-05-22_140358.png|}}
 +===== Anydesk Debian Setup =====
 +1) Confirm X (not wayland!)
 +
 +- Run ''loginctl'' to show current session IDs.
 +
 +- Check the session types: ''loginctl show-session <SESSION_ID> -p Type''
 +
 +2) Add anydesk deb repository: https://deb.anydesk.com/howto.html
 +<code>
 +# Add the AnyDesk GPG key
 +sudo apt update
 +sudo apt install ca-certificates curl apt-transport-https
 +sudo install -m 0755 -d /etc/apt/keyrings
 +sudo curl -fsSL https://keys.anydesk.com/repos/DEB-GPG-KEY -o /etc/apt/keyrings/keys.anydesk.com.asc
 +sudo chmod a+r /etc/apt/keyrings/keys.anydesk.com.asc
 +
 +# Add the AnyDesk apt repository
 +echo "deb [signed-by=/etc/apt/keyrings/keys.anydesk.com.asc] https://deb.anydesk.com all main" | sudo tee /etc/apt/sources.list.d/anydesk-stable.list > /dev/null
 +
 +# Update apt caches and install the AnyDesk client
 +sudo apt update
 +sudo apt install anydesk
 +</code>
 +
 +3) set password for unattended access: ''sudo su; echo awesomepassword | anydesk --set-password''
 +
 +4) Get ID: ''sudo su; anydesk --get-id''
 +
 +https://support.anydesk.com/knowledge/command-line-interface-for-linux
 ===== Disable power button shutdown ===== ===== Disable power button shutdown =====
  
Line 9: Line 47:
 uncomment HandPowerKey, set to ignore uncomment HandPowerKey, set to ignore
  
 +===== Get & Set date w/ epoch time =====
 +
 +Get from good machine:
 +
 +<code>date +%s</code>
 +
 +
 +Set on another:
 +<code>date -s '@1705865491'</code>
 ===== Image and Compress Disk ===== ===== Image and Compress Disk =====
 <code> <code>
Line 42: Line 89:
 </code> </code>
  
-===== Quick Pi ID =====+===== cycle systemd logs ===== 
 +<code>sudo journalctl --rotate ; sudo journalctl --vacuum-time=1s</code> 
 + 
 +==== show systemd logs from boot ==== 
 +<code>sudo journalctl -b</code> 
 + 
 +===== Raspberry Pi ===== 
 +==== Quick Pi ID ====
  
 Easy way to get a quick visual indicator to ID a Pi you're remoted into: Easy way to get a quick visual indicator to ID a Pi you're remoted into:
Line 60: Line 114:
 </code> </code>
  
-===== Raspberry Pi Heartbeat ===== +==== Heartbeat LED ===
 set in config.txt set in config.txt
  
Line 69: Line 122:
 </code> </code>
  
 +==== Grow partition on first boot ====
 +Add to the end of /boot/cmdline.txt
 +
 +<code>
 +quiet init=/usr/lib/raspi-config/init_resize.sh
 +</code>
 ===== chronyc tracking ===== ===== chronyc tracking =====
  
Line 161: Line 220:
  
 <code>make ; make install</code> <code>make ; make install</code>
 +
 +===== Cycle Chrony Logs =====
 +<code>
 +#!/bin/bash
 +# chrony log rotation
 +
 +cd /var/log/chrony
 +
 +mv measurements.log measurements.$(date +"%Y%m%d").log
 +mv statistics.log statistics.$(date +"%Y%m%d").log
 +mv tracking.log tracking.$(date +"%Y%m%d").log
 +
 +sync
 +
 +chronyc cyclelogs
 +</code>
 +
 +===== chrony.conf ptp as pps refclock =====
 +<code>
 +server time-a.nist.gov
 +server time-a-wwv.nist.gov
 +
 +refclock SHM 0 poll 3 refid GPS
 +refclock PHC /dev/ptp0:extpps:nocrossts:pin=0 width 0.1 refid PHC pps
 +
 +logdir /var/log/chrony
 +log statistics tracking measurements
 +
 +driftfile /var/lib/chrony/chrony.drift
 +
 +dumpdir /etc/chrony/dump
 +
 +rtcsync
 +
 +allow
 +cmdallow
 +</code>
 +
 +===== Set NIC to promiscuous mode at boot =====
 +Using systemd:
 +
 +`/etc/systemd/system/promisc-eth0.service`
 +
 +<code>
 +[Unit]
 +Description=Control promiscuous mode for interface eth0
 +After=network.target
 +
 +[Service]
 +Type=oneshot
 +ExecStart=/usr/bin/ip link set eth0 promisc on
 +ExecStop=/usr/bin/ip link set eth0 promisc off
 +RemainAfterExit=yes
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +===== Proxmox =====
 +==== re-number VM ====
 +
 +1) shut down VM
 +2) rename the storage
 +<code>zfs rename pool1/vms/vm-112-disk-0 pool1/vms/vm-1001-disk-0</code>
 +3) rename the configuration file
 +<code>
 +export vgNAME=vg-images newVMID=173 oldVMID=175 ;  \
 +sed -i "s/$oldVMID/$newVMID/g" /etc/pve/qemu-server/$oldVMID.conf; mv /etc/pve/qemu-server/$oldVMID.conf /etc/pve/qemu-server/$newVMID.conf; \
 +unset vgNAME newVMID oldVMID;
 +</code>
scraps.1677616556.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki