From: Ian Kelling Date: Sat, 19 Apr 2025 08:12:20 +0000 (-0400) Subject: generally simple improvements and fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=6e8ce366de8e8ed5b362efe7c14a3afa74520ebf;p=distro-setup generally simple improvements and fixes --- diff --git a/brc b/brc index da736c4..43aaadb 100644 --- a/brc +++ b/brc @@ -2046,54 +2046,6 @@ go-github-install() { } -## 2024: I'm using gh instead of hub, but leaving this just in case. -## I tried the github cli tool (gh) and it seems easier than -## I remember hub. -## -## hub predated github's 2020 official cli tool gh. -## more info at -## https://raw.githubusercontent.com/cli/cli/trunk/docs/gh-vs-hub.md -# get latest hub and run it -# main command to use: -# hub pull-request --no-edit -# --no-edit means to use the first commit\'s message as the pull request message. -# If that fails, try doing -# hub pull-request --no-edit -b UPSTREAM_OWNER:branch -# where branch is usually master. it does the pr against your current branch. -# -# On first use, you input username/pass and it gets an oath token so you dont have to repeat -# it\'s at ~/.config/hub -hub() { - local up uptar updir p re - # example https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz - up=$(wget -q -O- https://api.github.com/repos/github/hub/releases/latest | jq -r .assets[].browser_download_url | grep linux-amd64) - re='[[:space:]]' - if [[ ! $up || $up =~ $re ]]; then - echo "failed to get good update url. got: $up" - fi - uptar=${up##*/} - updir=${uptar%.tgz} - if [[ ! -e /a/opt/$updir ]]; then - rm -rf /a/opt/hub-linux-amd64* - wget -P /a/opt $up - tar -C /a/opt -zxf /a/opt/$uptar - rm -f /a/opt/$uptar - fi - if ! which hub &>/dev/null; then - sudo /a/opt/$updir/install - fi - - # save token across computers - if [[ ! -L ~/.config/hub ]]; then - if [[ -e ~/.config/hub ]]; then - mv ~/.config/hub /p/c/subdir_files/.config/ - fi - if [[ -e /p/c/subdir_files/.config/hub ]]; then - conflink - fi - fi - command hub "$@" -} # git alias i() { git "$@"; } diff --git a/brc2 b/brc2 index c750016..0c6745e 100644 --- a/brc2 +++ b/brc2 @@ -2113,6 +2113,8 @@ hiup() { done root_hosts+=(cmc) + work_hosts=(10.8.0.97 10.8.0.99) + while read -r ip host mac opts; do if [[ $ip == *#* || ! $host ]]; then continue; fi @@ -2145,7 +2147,7 @@ hiup() { else nonvpn_ips[$host]=$ip fi - if [[ $host == librestation03 ]]; then + if [[ $host == librestation0[13] ]]; then work_hosts+=($host ${host}wg) elif $root; then # note: the reason we have b8.nz suffix here but not for non_root @@ -2312,6 +2314,9 @@ EOF b8_ip=$(dig +short b8.nz @iankelling.org | tail -1) # if our dynamic ip updates broke, set manually, eg: #b8_ip=72.74.193.xxx + if [[ ! $b8_ip ]]; then + b8_ip=$(curl --connect-timeout 10 -s4 https://iankelling.org/cgi/pubip) + fi if [[ ! $b8_ip ]]; then echo "$0: error: got empty b8.nz ip. returning 1" return 1 @@ -4141,7 +4146,7 @@ rep() { break fi done - paths="/p/c/ /p/profanity-config/ /b/bash_unpublished/ /c/ /f/s/fsf/ /f/backup-scripts/ /f/gluestick/" + paths="/p/c/ /p/bin/ /p/profanity-config/ /b/bash_unpublished/ /c/ /f/s/fsf/ /f/backup-scripts/ /f/gluestick/" find $paths -not \( -name .svn -prune -o -name .git -prune \ -o -name .hg -prune -o -name .editor-backups -prune \ -o -name .undo-tree-history -prune \) 2>/dev/null | grep -iP --color=auto -- "$*" ||: @@ -4807,6 +4812,16 @@ webp-anim-array() { fi } + +# usage: pass encoded string on stdin +url-decode() { + python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()));" +} + +osimain() { + i push && i push gh main + } + export BASEFILE_DIR=/a/bin/fai-basefiles #export ANDROID_HOME=/a/opt/android-home diff --git a/brc3 b/brc3 index 289ee99..559d08d 100644 --- a/brc3 +++ b/brc3 @@ -126,7 +126,3 @@ schroot-cleanup() { # regex="("$'\n'"|^)$string("$'\n'"|$)" -# usage: pass encoded string on stdin -url-decode() { - python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()));" -} diff --git a/disabled/hub b/disabled/hub new file mode 100644 index 0000000..25cea8e --- /dev/null +++ b/disabled/hub @@ -0,0 +1,50 @@ +# removed from brc + +## 2024: I'm using gh instead of hub, but leaving this just in case. +## I tried the github cli tool (gh) and it seems easier than +## I remember hub. +## +## hub predated github's 2020 official cli tool gh. +## more info at +## https://raw.githubusercontent.com/cli/cli/trunk/docs/gh-vs-hub.md +# get latest hub and run it +# main command to use: +# hub pull-request --no-edit +# --no-edit means to use the first commit\'s message as the pull request message. +# If that fails, try doing +# hub pull-request --no-edit -b UPSTREAM_OWNER:branch +# where branch is usually master. it does the pr against your current branch. +# +# On first use, you input username/pass and it gets an oath token so you dont have to repeat +# it\'s at ~/.config/hub +hub() { + local up uptar updir p re + # example https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz + up=$(wget -q -O- https://api.github.com/repos/github/hub/releases/latest | jq -r .assets[].browser_download_url | grep linux-amd64) + re='[[:space:]]' + if [[ ! $up || $up =~ $re ]]; then + echo "failed to get good update url. got: $up" + fi + uptar=${up##*/} + updir=${uptar%.tgz} + if [[ ! -e /a/opt/$updir ]]; then + rm -rf /a/opt/hub-linux-amd64* + wget -P /a/opt $up + tar -C /a/opt -zxf /a/opt/$uptar + rm -f /a/opt/$uptar + fi + if ! which hub &>/dev/null; then + sudo /a/opt/$updir/install + fi + + # save token across computers + if [[ ! -L ~/.config/hub ]]; then + if [[ -e ~/.config/hub ]]; then + mv ~/.config/hub /p/c/subdir_files/.config/ + fi + if [[ -e /p/c/subdir_files/.config/hub ]]; then + conflink + fi + fi + command hub "$@" +} diff --git a/distro-end b/distro-end index 10c0de0..79a75bd 100755 --- a/distro-end +++ b/distro-end @@ -90,7 +90,7 @@ Package: $pkg Description: $pkg-dummy EOF equivs-build $pkg - sudo dpkg -i /tmp/user/1000/${pkg}_${ver}_all.deb + sudo dpkg -i /tmp/user/$EUID/${pkg}_${ver}_all.deb cd rm -r "$tmpdir" } @@ -591,8 +591,72 @@ esac #### desktop stuff ### system76 things ### + +# sy was working without this, but consistently got kernel freezes within a day of being on. +# +# First, it repeats this for hours: +# Apr 12 21:25:28 sy kernel: BUG: Bad rss-counter state mm:000000003f3d390c type:MM_ANONPAGES val:-1 +# Apr 12 21:25:28 sy kernel: BUG: Bad rss-counter state mm:000000003f3d390c type:MM_SHMEMPAGES val:1 +# +# Then many kernel freeze messages +# Apr 12 22:40:24 sy kernel: watchdog: BUG: soft lockup - CPU#6 stuck for 1467s! [system-status:2059] +# Apr 12 22:40:24 sy kernel: Modules linked in: ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_tcpudp nft_compat nf_tables wireguard curve25519_x86_64 libchacha20poly1305 chacha_x86_64 poly1305_x86_64 libcurve25519_generic libchacha ip6_udp_tunnel udp_tunnel ccm cmac algif_hash algif_skcipher af_alg snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic qrtr bnep binfmt_misc snd_sof_pci_intel_cnl intel_uncore_frequency intel_uncore_frequency_common snd_sof_intel_hda_common soundwire_intel snd_sof_intel_hda_mlink soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof iwlmvm(OE) snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi intel_tcc_cooling soundwire_generic_allocation soundwire_bus x86_pkg_temp_thermal intel_powerclamp coretemp snd_soc_core mac80211(OE) cmdlinepart snd_compress ac97_bus kvm_intel snd_pcm_dmaengine spi_nor nls_iso8859_1 intel_rapl_msr mtd libarc4 snd_hda_intel uvcvideo snd_intel_dspcfg i915 videobuf2_vmalloc kvm snd_intel_sdw_acpi uvc +# Apr 12 22:40:24 sy kernel: videobuf2_memops snd_hda_codec btusb videobuf2_v4l2 btrtl iwlwifi(OE) processor_thermal_device_pci_legacy processor_thermal_device irqbypass btintel processor_thermal_wt_hint snd_hda_core processor_thermal_rfim processor_thermal_rapl drm_buddy snd_hwdep btbcm rapl videodev btmtk videobuf2_common intel_rapl_common mc bluetooth snd_pcm ttm processor_thermal_wt_req cfg80211(OE) ecdh_generic intel_cstate processor_thermal_power_floor snd_timer ecc drm_display_helper snd i2c_i801 spi_intel_pci cec spi_intel iwlwifi_compat(OE) soundcore i2c_smbus processor_thermal_mbox int340x_thermal_zone rc_core intel_soc_dts_iosf intel_pch_thermal intel_pmc_core i2c_algo_bit intel_vsec pmt_telemetry intel_hid pmt_class sparse_keymap system76_acpi joydev input_leds mac_hid serio_raw sch_fq_codel nfsd usbhid parport_pc auth_rpcgss ppdev nfs_acl lp lockd parport grace efi_pstore sunrpc nfnetlink dmi_sysfs ip_tables x_tables autofs4 btrfs blake2b_generic dm_crypt raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor +# Apr 12 22:40:24 sy kernel: async_tx xor raid6_pq libcrc32c raid1 raid0 hid_multitouch hid_generic 8250_dw rtsx_pci_sdmmc nvme nvme_core crct10dif_pclmul crc32_pclmul polyval_clmulni intel_lpss_pci polyval_generic ghash_clmulni_intel sha256_ssse3 rtsx_pci psmouse sha1_ssse3 intel_lpss nvme_auth xhci_pci i2c_hid_acpi idma64 xhci_pci_renesas i2c_hid hid video wmi pinctrl_cannonlake aesni_intel crypto_simd cryptd +# Apr 12 22:40:24 sy kernel: CPU: 6 PID: 2059 Comm: system-status Tainted: G D W OEL 6.8.0-57-generic #59trisquel35 +# Apr 12 22:40:24 sy kernel: Hardware name: System76 Lemur Pro/Lemur Pro, BIOS 2023-08-18_a8dd6c2 08/18/2023 +# Apr 12 22:40:24 sy kernel: RIP: 0010:native_queued_spin_lock_slowpath+0x83/0x300 +# Apr 12 22:40:24 sy kernel: Code: 00 00 f0 0f ba 2b 08 0f 92 c2 8b 03 0f b6 d2 c1 e2 08 30 e4 09 d0 3d ff 00 00 00 77 61 85 c0 74 10 0f b6 03 84 c0 74 09 f3 90 <0f> b6 03 84 c0 75 f7 b8 01 00 00 00 66 89 03 5b 41 5c 41 5d 41 5e +# Apr 12 22:40:24 sy kernel: RSP: 0018:ffffbf0c80d17a80 EFLAGS: 00000202 +# Apr 12 22:40:24 sy kernel: RAX: 0000000000000001 RBX: fffff58f444330a8 RCX: 000fffffffe00000 +# Apr 12 22:40:24 sy kernel: RDX: 0000000000000000 RSI: 0000000000000001 RDI: fffff58f444330a8 +# Apr 12 22:40:24 sy kernel: RBP: ffffbf0c80d17aa8 R08: 0000000000000000 R09: 0000000000000000 +# Apr 12 22:40:24 sy kernel: R10: 000060b7a94fd000 R11: 0000000000000000 R12: ffff9ac2675baa48 +# Apr 12 22:40:24 sy kernel: R13: 000060b7a9320000 R14: ffffbf0c80d17b68 R15: ffff9ac250cc2900 +# Apr 12 22:40:24 sy kernel: FS: 0000000000000000(0000) GS:ffff9acb9d300000(0000) knlGS:0000000000000000 +# Apr 12 22:40:24 sy kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +# Apr 12 22:40:24 sy kernel: CR2: 000073f5239deb48 CR3: 000000010939c006 CR4: 00000000003706f0 +# Apr 12 22:40:24 sy kernel: Call Trace: +# Apr 12 22:40:24 sy kernel: +# Apr 12 22:40:24 sy kernel: ? show_regs+0x6d/0x80 +# Apr 12 22:40:24 sy kernel: ? watchdog_timer_fn+0x206/0x290 +# Apr 12 22:40:24 sy kernel: ? __pfx_watchdog_timer_fn+0x10/0x10 +# Apr 12 22:40:24 sy kernel: ? __hrtimer_run_queues+0x10f/0x2a0 +# Apr 12 22:40:24 sy kernel: ? clockevents_program_event+0xbe/0x150 +# Apr 12 22:40:24 sy kernel: ? hrtimer_interrupt+0xf6/0x250 +# Apr 12 22:40:24 sy kernel: ? __sysvec_apic_timer_interrupt+0x4e/0x120 +# Apr 12 22:40:24 sy kernel: ? sysvec_apic_timer_interrupt+0x8d/0xd0 +# Apr 12 22:40:24 sy kernel: +# Apr 12 22:40:24 sy kernel: +# Apr 12 22:40:24 sy kernel: ? asm_sysvec_apic_timer_interrupt+0x1b/0x20 +# Apr 12 22:40:24 sy kernel: ? native_queued_spin_lock_slowpath+0x83/0x300 +# Apr 12 22:40:24 sy kernel: _raw_spin_lock+0x3f/0x60 +# Apr 12 22:40:24 sy kernel: __pte_offset_map_lock+0xa3/0x130 +# Apr 12 22:40:24 sy kernel: zap_pte_range+0x6b/0xcc0 +# Apr 12 22:40:24 sy kernel: zap_pmd_range.isra.0+0x121/0x280 +# Apr 12 22:40:24 sy kernel: ? prb_read+0xa5/0x190 +# Apr 12 22:40:24 sy kernel: unmap_page_range+0x2c6/0x4f0 +# Apr 12 22:40:24 sy kernel: unmap_single_vma+0x89/0xf0 +# Apr 12 22:40:24 sy kernel: unmap_vmas+0xb5/0x190 +# Apr 12 22:40:24 sy kernel: exit_mmap+0x10a/0x3e0 +# Apr 12 22:40:24 sy kernel: __mmput+0x41/0x140 +# Apr 12 22:40:24 sy kernel: mmput+0x31/0x40 +# Apr 12 22:40:24 sy kernel: exit_mm+0xbe/0x130 +# Apr 12 22:40:24 sy kernel: do_exit+0x27b/0x530 +# Apr 12 22:40:24 sy kernel: make_task_dead+0x80/0x140 +# Apr 12 22:40:24 sy kernel: rewind_stack_and_make_dead+0x17/0x20 +# Apr 12 22:40:24 sy kernel: RIP: 0033:0x73f5236ad7cd +# Apr 12 22:40:24 sy kernel: Code: Unable to access opcode bytes at 0x73f5236ad7a3. +# Apr 12 22:40:24 sy kernel: RSP: 002b:00007fffc2d20de0 EFLAGS: 00010246 +# Apr 12 22:40:24 sy kernel: RAX: 000060b7a9350b10 RBX: 0000000000000100 RCX: 0000000000000000 +# Apr 12 22:40:24 sy kernel: RDX: 000060b7a9320010 RSI: 0000000000000000 RDI: 000000000000001f +# Apr 12 22:40:24 sy kernel: RBP: 00007fffc2d20e10 R08: 0000000000000008 R09: 0000000000000190 +# Apr 12 22:40:24 sy kernel: R10: 0000000000000008 R11: 000060b7850a0240 R12: 000000000000000f +# Apr 12 22:40:24 sy kernel: R13: ffffffffffffffc0 R14: 0000000000000073 R15: 0000000000000000 +# Apr 12 22:40:24 sy kernel: + case $HOSTNAME in - bo|so) # sy| sy doesnt seem to really need this. + bo|so|sy) # note, i stored the initial popos packages at /a/bin/data/popos-pkgs if [[ ! -e /etc/apt/sources.list.d/system76.list ]]; then # https://blog.zackad.dev/en/2017/08/17/add-ppa-simple-way.html @@ -2193,6 +2257,14 @@ case $codename_compat in ;; esac +case $HOSTNAME in + frodo) + systemctl enable btrbkrust.timer + systemctl enable btrbkr.timer + ;; + esac + + hiup /p/c/distro-extra diff --git a/gitslink b/gitslink index 6edbae2..be4abbe 100755 --- a/gitslink +++ b/gitslink @@ -61,6 +61,7 @@ lnf -v /p/bin/* /a/exe cd /a/exe if (( ${#existing[@]} )); then echo run manually: + echo cd /a/exe fi for f in ${!existing[@]}; do echo rm -fv $f diff --git a/machine_specific/frodo/filesystem/etc/btrbk/rust.conf b/machine_specific/frodo/filesystem/etc/btrbk/rust.conf index 9c47db0..7199baf 100644 --- a/machine_specific/frodo/filesystem/etc/btrbk/rust.conf +++ b/machine_specific/frodo/filesystem/etc/btrbk/rust.conf @@ -15,5 +15,6 @@ target_preserve_min 2d rate_limit no volume /mnt/rbackup +subvolume ar subvolume d subvolume roverflow diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer index 4e73b09..66af876 100644 --- a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer @@ -2,7 +2,7 @@ Description=Btrbk rust timer [Timer] -OnCalendar=*-*-* 05:00:00 America/New_York +OnCalendar=*-*-* 07:00:00 America/New_York [Install] WantedBy=timers.target diff --git a/subdir_files/.config/gh/config.yml b/subdir_files/.config/gh/config.yml deleted file mode 100644 index b8f811d..0000000 --- a/subdir_files/.config/gh/config.yml +++ /dev/null @@ -1,17 +0,0 @@ -# The current version of the config schema -version: 1 -# What protocol to use when performing git operations. Supported values: ssh, https -git_protocol: ssh -# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment. -editor: -# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled -prompt: enabled -# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager. -pager: -# Aliases allow you to create nicknames for gh commands -aliases: - co: pr checkout -# The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport. -http_unix_socket: -# What web browser gh should use when opening URLs. If blank, will refer to environment. -browser: diff --git a/subdir_files/.config/gh/hosts.yml b/subdir_files/.config/gh/hosts.yml deleted file mode 100644 index cf2f603..0000000 --- a/subdir_files/.config/gh/hosts.yml +++ /dev/null @@ -1,5 +0,0 @@ -github.com: - git_protocol: ssh - users: - ian-kelling: - user: ian-kelling diff --git a/subdir_files/.config/mpv/scripts/iank-like.lua b/subdir_files/.config/mpv/scripts/iank-like1.lua similarity index 78% rename from subdir_files/.config/mpv/scripts/iank-like.lua rename to subdir_files/.config/mpv/scripts/iank-like1.lua index 2796de8..83d5331 100644 --- a/subdir_files/.config/mpv/scripts/iank-like.lua +++ b/subdir_files/.config/mpv/scripts/iank-like1.lua @@ -1,5 +1,5 @@ -local log_file = "/t/mpvlike.log" - +-- mark for folder 4 +local like1_file = "/t/mpvlike1.log" mp.add_key_binding("v", "write_filename", function() local filepath = mp.get_property("path") -- Convert to absolute path if it's not already @@ -9,7 +9,7 @@ mp.add_key_binding("v", "write_filename", function() filepath = working_dir .. "/" .. filepath end - local file = io.open(log_file, "a") -- Open the file in append mode + local file = io.open(like1_file, "a") -- Open the file in append mode file:write(filepath .. "\n") -- Write the filename with a newline file:close() end diff --git a/subdir_files/.config/mpv/scripts/iank-like2.lua b/subdir_files/.config/mpv/scripts/iank-like2.lua new file mode 100644 index 0000000..ba1160c --- /dev/null +++ b/subdir_files/.config/mpv/scripts/iank-like2.lua @@ -0,0 +1,16 @@ +-- mark for folder 3 +local like2_file = "/t/mpvlike2.log" +mp.add_key_binding("x", "write_filename", function() + local filepath = mp.get_property("path") + -- Convert to absolute path if it's not already + if filepath and not filepath:match("^/") and not filepath:match("^%a:") then + local working_dir = mp.get_property("working-directory") + if working_dir then + filepath = working_dir .. "/" .. filepath + end + + local file = io.open(like2_file, "a") -- Open the file in append mode + file:write(filepath .. "\n") -- Write the filename with a newline + file:close() + end +end) diff --git a/subdir_files/.config/mpv/scripts/iank-like3.lua b/subdir_files/.config/mpv/scripts/iank-like3.lua new file mode 100644 index 0000000..7008d37 --- /dev/null +++ b/subdir_files/.config/mpv/scripts/iank-like3.lua @@ -0,0 +1,16 @@ +-- mark for deletion +local like3_file = "/t/mpvlike3.log" +mp.add_key_binding("d", "write_filename", function() + local filepath = mp.get_property("path") + -- Convert to absolute path if it's not already + if filepath and not filepath:match("^/") and not filepath:match("^%a:") then + local working_dir = mp.get_property("working-directory") + if working_dir then + filepath = working_dir .. "/" .. filepath + end + + local file = io.open(like3_file, "a") -- Open the file in append mode + file:write(filepath .. "\n") -- Write the filename with a newline + file:close() + end +end) diff --git a/subdir_files/.config/mpv/scripts/playlistmanager.lua b/subdir_files/.config/mpv/scripts/playlistmanager.lua index 8908986..3a3027c 100644 --- a/subdir_files/.config/mpv/scripts/playlistmanager.lua +++ b/subdir_files/.config/mpv/scripts/playlistmanager.lua @@ -27,7 +27,7 @@ local settings = { -- extra functionality keys key_sortplaylist = "", - key_shuffleplaylist = "", + key_shuffleplaylist = "r", key_reverseplaylist = "", key_loadfiles = "", key_saveplaylist = "",