From 42b27ff1cc0851dd2c0d6993fe5a16775934c9f8 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 14 Aug 2024 10:35:57 -0400 Subject: [PATCH] minor host config changes --- brc | 5 +- brc2 | 7 + filesystem/usr/local/bin/abrowser-main | 23 ++ .../usr/share/applications/ffmain.desktop | 222 ++++++++++++++++++ i3-sway/common.conf | 6 +- .../etc/openvpn/client-config-hole/so | 2 +- .../etc/openvpn/client-config-hole/sy | 1 + .../systemd/system/openvpn-client-tr@.service | 4 +- .../systemd/system/openvpn-client-tr@.service | 36 +++ myx | 2 +- 10 files changed, 298 insertions(+), 10 deletions(-) create mode 100755 filesystem/usr/local/bin/abrowser-main create mode 100644 filesystem/usr/share/applications/ffmain.desktop create mode 100644 machine_specific/li/filesystem/etc/openvpn/client-config-hole/sy create mode 100644 machine_specific/sy/filesystem/etc/systemd/system/openvpn-client-tr@.service diff --git a/brc b/brc index 0398078..1ea144e 100644 --- a/brc +++ b/brc @@ -541,8 +541,7 @@ cl() { mapfile -t lines <"$cdirs" start=$(( ${#lines[@]} - 1 )) - # we have ~33 buttons as of this writing, so lets - # prune down the history every once in a while. + # prune the history every once in a while. if (( start > 500 )); then tac "$cdirs" | awk '!seen[$0]++' | head -n 200 | tac | sponge "$cdirs" || [[ $? == 141 ]] fi @@ -3605,7 +3604,7 @@ if $use_color && type -p tput &>/dev/null; then # Did that then modified things. # # default too light: - # ex=00;32y + # ex=00;32 # ln=01;36 # diff --git a/brc2 b/brc2 index dc58628..0c79983 100644 --- a/brc2 +++ b/brc2 @@ -5022,6 +5022,13 @@ spdx() { ( { printf "%s" "$pw" | xclip -selection clipboard && sleep 15 && echo " " | xclip -selection clipboard; } & ) } +ffmain() { + xdg-settings set default-web-browser ffmain.desktop +} +ffdefault() { + xdg-settings set default-web-browser firefox.desktop +} + export BASEFILE_DIR=/a/bin/fai-basefiles #export ANDROID_HOME=/a/opt/android-home diff --git a/filesystem/usr/local/bin/abrowser-main b/filesystem/usr/local/bin/abrowser-main new file mode 100755 index 0000000..ae1402e --- /dev/null +++ b/filesystem/usr/local/bin/abrowser-main @@ -0,0 +1,23 @@ +#!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to change +# to a recommended GPL license. + +# Copyright 2024 Ian Kelling + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +abrowser -P firefox-main-profile "$@" diff --git a/filesystem/usr/share/applications/ffmain.desktop b/filesystem/usr/share/applications/ffmain.desktop new file mode 100644 index 0000000..500de73 --- /dev/null +++ b/filesystem/usr/share/applications/ffmain.desktop @@ -0,0 +1,222 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox Web Browser main prifle +Name[ar]=متصفح الويب فَيَرفُكْس +Name[ast]=Restolador web Firefox +Name[bn]=ফায়ারফক্স ওয়েব ব্রাউজার +Name[ca]=Navegador web Firefox +Name[cs]=Firefox Webový prohlížeč +Name[da]=Firefox - internetbrowser +Name[el]=Περιηγητής Firefox +Name[es]=Navegador web Firefox +Name[et]=Firefoxi veebibrauser +Name[fa]=مرورگر اینترنتی Firefox +Name[fi]=Firefox-selain +Name[fr]=Navigateur Web Firefox +Name[gl]=Navegador web Firefox +Name[he]=דפדפן האינטרנט Firefox +Name[hr]=Firefox web preglednik +Name[hu]=Firefox webböngésző +Name[it]=Firefox Browser Web +Name[ja]=Firefox ウェブ・ブラウザ +Name[ko]=Firefox 웹 브라우저 +Name[ku]=Geroka torê Firefox +Name[lt]=Firefox interneto naršyklė +Name[nb]=Firefox Nettleser +Name[nl]=Firefox webbrowser +Name[nn]=Firefox Nettlesar +Name[no]=Firefox Nettleser +Name[pl]=Przeglądarka WWW Firefox +Name[pt]=Firefox Navegador Web +Name[pt_BR]=Navegador Web Firefox +Name[ro]=Firefox – Navigator Internet +Name[ru]=Веб-браузер Firefox +Name[sk]=Firefox - internetový prehliadač +Name[sl]=Firefox spletni brskalnik +Name[sv]=Firefox webbläsare +Name[tr]=Firefox Web Tarayıcısı +Name[ug]=Firefox توركۆرگۈ +Name[uk]=Веб-браузер Firefox +Name[vi]=Trình duyệt web Firefox +Name[zh_CN]=Firefox 网络浏览器 +Name[zh_TW]=Firefox 網路瀏覽器 +Comment=Browse the World Wide Web +Comment[ar]=تصفح الشبكة العنكبوتية العالمية +Comment[ast]=Restola pela Rede +Comment[bn]=ইন্টারনেট ব্রাউজ করুন +Comment[ca]=Navegueu per la web +Comment[cs]=Prohlížení stránek World Wide Webu +Comment[da]=Surf på internettet +Comment[de]=Im Internet surfen +Comment[el]=Μπορείτε να περιηγηθείτε στο διαδίκτυο (Web) +Comment[es]=Navegue por la web +Comment[et]=Lehitse veebi +Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید +Comment[fi]=Selaa Internetin WWW-sivuja +Comment[fr]=Naviguer sur le Web +Comment[gl]=Navegar pola rede +Comment[he]=גלישה ברחבי האינטרנט +Comment[hr]=Pretražite web +Comment[hu]=A világháló böngészése +Comment[it]=Esplora il web +Comment[ja]=ウェブを閲覧します +Comment[ko]=웹을 돌아 다닙니다 +Comment[ku]=Li torê bigere +Comment[lt]=Naršykite internete +Comment[nb]=Surf på nettet +Comment[nl]=Verken het internet +Comment[nn]=Surf på nettet +Comment[no]=Surf på nettet +Comment[pl]=Przeglądanie stron WWW +Comment[pt]=Navegue na Internet +Comment[pt_BR]=Navegue na Internet +Comment[ro]=Navigați pe Internet +Comment[ru]=Доступ в Интернет +Comment[sk]=Prehliadanie internetu +Comment[sl]=Brskajte po spletu +Comment[sv]=Surfa på webben +Comment[tr]=İnternet'te Gezinin +Comment[ug]=دۇنيادىكى توربەتلەرنى كۆرگىلى بولىدۇ +Comment[uk]=Перегляд сторінок Інтернету +Comment[vi]=Để duyệt các trang web +Comment[zh_CN]=浏览互联网 +Comment[zh_TW]=瀏覽網際網路 +GenericName=Web Browser +GenericName[ar]=متصفح ويب +GenericName[ast]=Restolador Web +GenericName[bn]=ওয়েব ব্রাউজার +GenericName[ca]=Navegador web +GenericName[cs]=Webový prohlížeč +GenericName[da]=Webbrowser +GenericName[el]=Περιηγητής διαδικτύου +GenericName[es]=Navegador web +GenericName[et]=Veebibrauser +GenericName[fa]=مرورگر اینترنتی +GenericName[fi]=WWW-selain +GenericName[fr]=Navigateur Web +GenericName[gl]=Navegador Web +GenericName[he]=דפדפן אינטרנט +GenericName[hr]=Web preglednik +GenericName[hu]=Webböngésző +GenericName[it]=Browser web +GenericName[ja]=ウェブ・ブラウザ +GenericName[ko]=웹 브라우저 +GenericName[ku]=Geroka torê +GenericName[lt]=Interneto naršyklė +GenericName[nb]=Nettleser +GenericName[nl]=Webbrowser +GenericName[nn]=Nettlesar +GenericName[no]=Nettleser +GenericName[pl]=Przeglądarka WWW +GenericName[pt]=Navegador Web +GenericName[pt_BR]=Navegador Web +GenericName[ro]=Navigator Internet +GenericName[ru]=Веб-браузер +GenericName[sk]=Internetový prehliadač +GenericName[sl]=Spletni brskalnik +GenericName[sv]=Webbläsare +GenericName[tr]=Web Tarayıcı +GenericName[ug]=توركۆرگۈ +GenericName[uk]=Веб-браузер +GenericName[vi]=Trình duyệt Web +GenericName[zh_CN]=网络浏览器 +GenericName[zh_TW]=網路瀏覽器 +Keywords=Internet;WWW;Browser;Web;Explorer +Keywords[ar]=انترنت;إنترنت;متصفح;ويب;وب +Keywords[ast]=Internet;WWW;Restolador;Web;Esplorador +Keywords[ca]=Internet;WWW;Navegador;Web;Explorador;Explorer +Keywords[cs]=Internet;WWW;Prohlížeč;Web;Explorer +Keywords[da]=Internet;Internettet;WWW;Browser;Browse;Web;Surf;Nettet +Keywords[de]=Internet;WWW;Browser;Web;Explorer;Webseite;Site;surfen;online;browsen +Keywords[el]=Internet;WWW;Browser;Web;Explorer;Διαδίκτυο;Περιηγητής;Firefox;Φιρεφοχ;Ιντερνετ +Keywords[es]=Explorador;Internet;WWW +Keywords[fi]=Internet;WWW;Browser;Web;Explorer;selain;Internet-selain;internetselain;verkkoselain;netti;surffaa +Keywords[fr]=Internet;WWW;Browser;Web;Explorer;Fureteur;Surfer;Navigateur +Keywords[he]=דפדפן;אינטרנט;רשת;אתרים;אתר;פיירפוקס;מוזילה; +Keywords[hr]=Internet;WWW;preglednik;Web +Keywords[hu]=Internet;WWW;Böngésző;Web;Háló;Net;Explorer +Keywords[it]=Internet;WWW;Browser;Web;Navigatore +Keywords[is]=Internet;WWW;Vafri;Vefur;Netvafri;Flakk +Keywords[ja]=Internet;WWW;Web;インターネット;ブラウザ;ウェブ;エクスプローラ +Keywords[nb]=Internett;WWW;Nettleser;Explorer;Web;Browser;Nettside +Keywords[nl]=Internet;WWW;Browser;Web;Explorer;Verkenner;Website;Surfen;Online +Keywords[pt]=Internet;WWW;Browser;Web;Explorador;Navegador +Keywords[pt_BR]=Internet;WWW;Browser;Web;Explorador;Navegador +Keywords[ru]=Internet;WWW;Browser;Web;Explorer;интернет;браузер;веб;файрфокс;огнелис +Keywords[sk]=Internet;WWW;Prehliadač;Web;Explorer +Keywords[sl]=Internet;WWW;Browser;Web;Explorer;Brskalnik;Splet +Keywords[tr]=İnternet;WWW;Tarayıcı;Web;Gezgin;Web sitesi;Site;sörf;çevrimiçi;tara +Keywords[uk]=Internet;WWW;Browser;Web;Explorer;Інтернет;мережа;переглядач;оглядач;браузер;веб;файрфокс;вогнелис;перегляд +Keywords[vi]=Internet;WWW;Browser;Web;Explorer;Trình duyệt;Trang web +Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer;网页;浏览;上网;火狐;Firefox;ff;互联网;网站; +Keywords[zh_TW]=Internet;WWW;Browser;Web;Explorer;網際網路;網路;瀏覽器;上網;網頁;火狐 +Exec=firefox -P firefox-main-profile %u +Terminal=false +X-MultipleArgs=false +Type=Application +Icon=firefox +Categories=GNOME;GTK;Network;WebBrowser; +MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; +StartupNotify=true +Actions=new-window;new-private-window; + +[Desktop Action new-window] +Name=Open a New Window +Name[ar]=افتح نافذة جديدة +Name[ast]=Abrir una ventana nueva +Name[bn]=Abrir una ventana nueva +Name[ca]=Obre una finestra nova +Name[cs]=Otevřít nové okno +Name[da]=Åbn et nyt vindue +Name[de]=Ein neues Fenster öffnen +Name[el]=Νέο παράθυρο +Name[es]=Abrir una ventana nueva +Name[fi]=Avaa uusi ikkuna +Name[fr]=Ouvrir une nouvelle fenêtre +Name[gl]=Abrir unha nova xanela +Name[he]=פתיחת חלון חדש +Name[hr]=Otvori novi prozor +Name[hu]=Új ablak nyitása +Name[it]=Apri una nuova finestra +Name[ja]=新しいウィンドウを開く +Name[ko]=새 창 열기 +Name[ku]=Paceyeke nû veke +Name[lt]=Atverti naują langą +Name[nb]=Åpne et nytt vindu +Name[nl]=Nieuw venster openen +Name[pt]=Abrir nova janela +Name[pt_BR]=Abrir nova janela +Name[ro]=Deschide o fereastră nouă +Name[ru]=Новое окно +Name[sk]=Otvoriť nové okno +Name[sl]=Odpri novo okno +Name[sv]=Öppna ett nytt fönster +Name[tr]=Yeni pencere aç +Name[ug]=يېڭى كۆزنەك ئېچىش +Name[uk]=Відкрити нове вікно +Name[vi]=Mở cửa sổ mới +Name[zh_CN]=新建窗口 +Name[zh_TW]=開啟新視窗 +Exec=firefox -P firefox-main-profile -new-window + +[Desktop Action new-private-window] +Name=Open a New Private Window +Name[ar]=افتح نافذة جديدة للتصفح الخاص +Name[ca]=Obre una finestra nova en mode d'incògnit +Name[cs]=Otevřít nové anonymní okno +Name[de]=Ein neues privates Fenster öffnen +Name[el]=Νέο ιδιωτικό παράθυρο +Name[es]=Abrir una ventana privada nueva +Name[fi]=Avaa uusi yksityinen ikkuna +Name[fr]=Ouvrir une nouvelle fenêtre de navigation privée +Name[he]=פתיחת חלון גלישה פרטית חדש +Name[hu]=Új privát ablak nyitása +Name[it]=Apri una nuova finestra anonima +Name[nb]=Åpne et nytt privat vindu +Name[ru]=Новое приватное окно +Name[sl]=Odpri novo okno zasebnega brskanja +Name[sv]=Öppna ett nytt privat fönster +Name[tr]=Yeni gizli pencere aç +Name[uk]=Відкрити нове вікно у потайливому режимі +Name[zh_TW]=開啟新隱私瀏覽視窗 +Exec=firefox -P firefox-main-profile -private-window diff --git a/i3-sway/common.conf b/i3-sway/common.conf index c66b238..dfb6015 100644 --- a/i3-sway/common.conf +++ b/i3-sway/common.conf @@ -21,7 +21,7 @@ set $mod Mod4 set $ex exec --no-startup-id bindsym $mod+2 $ex "i3-split-maybe"; exec "pavucontrol" -# calling without -no-remote makes this to be the instance that links +# calling without --new-instance makes this to be the instance that links # will open in from other applications. # unused. todo: consider binding this to some key on the right side of keyboard. #bindsym $mod+3 $ex "i3-split-maybe"; exec "abrowser" @@ -29,8 +29,8 @@ bindsym $mod+2 $ex "i3-split-maybe"; exec "pavucontrol" # so I figured out this is how to get output, but then # it suddenly started working again. #bindsym $mod+3 exec "abrowser 2>&1 >/tmp/l" -#bindsym $mod+3 exec "abrowser -no-remote -P sfw" -bindsym $mod+4 $ex "i3-abrowser -no-remote -P firefox-main-profile" +#bindsym $mod+3 exec "abrowser --new-instance -P sfw" +bindsym $mod+4 $ex "i3-abrowser --new-instance -P firefox-main-profile" bindsym $mod+5 $ex "/a/bin/ds/stream-interlude" bindsym $mod+6 $ex "i3-split-maybe"; exec "/usr/local/bin/start-tor-browser" bindsym $mod+7 $ex "/a/bin/ds/myx" diff --git a/machine_specific/li/filesystem/etc/openvpn/client-config-hole/so b/machine_specific/li/filesystem/etc/openvpn/client-config-hole/so index bfad767..0ba69f2 100644 --- a/machine_specific/li/filesystem/etc/openvpn/client-config-hole/so +++ b/machine_specific/li/filesystem/etc/openvpn/client-config-hole/so @@ -1 +1 @@ -ifconfig-push 10.5.5.7 255.255.255.0 +ifconfig-push 10.5.5.3 255.255.255.0 diff --git a/machine_specific/li/filesystem/etc/openvpn/client-config-hole/sy b/machine_specific/li/filesystem/etc/openvpn/client-config-hole/sy new file mode 100644 index 0000000..bfad767 --- /dev/null +++ b/machine_specific/li/filesystem/etc/openvpn/client-config-hole/sy @@ -0,0 +1 @@ +ifconfig-push 10.5.5.7 255.255.255.0 diff --git a/machine_specific/so/filesystem/etc/systemd/system/openvpn-client-tr@.service b/machine_specific/so/filesystem/etc/systemd/system/openvpn-client-tr@.service index f85639d..dae65d4 100644 --- a/machine_specific/so/filesystem/etc/systemd/system/openvpn-client-tr@.service +++ b/machine_specific/so/filesystem/etc/systemd/system/openvpn-client-tr@.service @@ -24,10 +24,10 @@ LimitNPROC=10 # we use .1 to make this be on a different network than kd, so that we can # talk to transmission on kd from remote host, and still use this # vpn. -ExecStartPre=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns -n 10.174.7 start %i +ExecStartPre=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns -n 10.174.3 start %i ExecStartPre=/sbin/iptables-restore /a/bin/distro-setup/transmission-firewall/netns.rules # allow wireguard network to connect -ExecStartPre=/usr/sbin/ip r add 10.8.0.0/24 via 10.174.7.1 dev veth1-client +ExecStartPre=/usr/sbin/ip r add 10.8.0.0/24 via 10.174.3.1 dev veth1-client ExecStopPost=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns stop %i PrivateNetwork=true BindReadOnlyPaths=/etc/tr-resolv:/run/systemd/resolve:norbind /etc/basic-nsswitch:/etc/resolved-nsswitch:norbind diff --git a/machine_specific/sy/filesystem/etc/systemd/system/openvpn-client-tr@.service b/machine_specific/sy/filesystem/etc/systemd/system/openvpn-client-tr@.service new file mode 100644 index 0000000..f85639d --- /dev/null +++ b/machine_specific/sy/filesystem/etc/systemd/system/openvpn-client-tr@.service @@ -0,0 +1,36 @@ +[Unit] +Description=OpenVPN tunnel for %I +After=syslog.target network-online.target +Wants=network-online.target +Documentation=man:openvpn(8) +Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage +Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO +Requires=iptables.service + +[Service] +Type=notify +RuntimeDirectory=openvpn-client +RuntimeDirectoryMode=0710 +WorkingDirectory=/etc/openvpn/client +ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client/%i.conf +# todo, try reenabling this from the default openvpn, +# it was disabled so we could do bind mounts as a command, +# but now systemd handles it +#CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE +LimitNPROC=10 +# DeviceAllow=/dev/null rw +# DeviceAllow=/dev/net/tun rw + +# we use .1 to make this be on a different network than kd, so that we can +# talk to transmission on kd from remote host, and still use this +# vpn. +ExecStartPre=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns -n 10.174.7 start %i +ExecStartPre=/sbin/iptables-restore /a/bin/distro-setup/transmission-firewall/netns.rules +# allow wireguard network to connect +ExecStartPre=/usr/sbin/ip r add 10.8.0.0/24 via 10.174.7.1 dev veth1-client +ExecStopPost=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns stop %i +PrivateNetwork=true +BindReadOnlyPaths=/etc/tr-resolv:/run/systemd/resolve:norbind /etc/basic-nsswitch:/etc/resolved-nsswitch:norbind + +[Install] +WantedBy=multi-user.target diff --git a/myx b/myx index d1cf563..ab7c156 100755 --- a/myx +++ b/myx @@ -108,8 +108,8 @@ if [[ $secondary_out ]]; then left_right_arg=--right-of # dp-1 moves from left to right sometimes, i just move it out of the # conditional and comment it as needed. +# [[ $secondary_out == DP-1 && $(edid card1-DP-1 ) == f3364bc6c1 ]] || \ if [[ $secondary_out == HDMI2 && $(edid card0-HDMI-A-2) == 192efbdcef ]] || \ - [[ $secondary_out == DP-1 && $(edid card1-DP-1 ) == f3364bc6c1 ]] || \ [[ $secondary_out == HDMI-1 && $(edid card1-HDMI-A-1 ) == 7c58f9ac1e ]] || \ [[ $secondary_out == DP-2 && $(edid card1-DP-2 ) == 0c35564b67 ]]; then left_right_arg=--left-of -- 2.30.2