symlink the readme into the content
| |
workspace install script #
- folder with resources and an install script inside that copies all the config files
- maybe pull down from repos actually
- repos
- kanata
- i3
- .bashrc (remove sensitive data?)
- bashh (without ssh keys!!!)
thoughts #
- the ai chat interface is great. we all know that that is everyones preferred way to search. vector serch is king, ai is great for this. ai will hallucinate a response though if you just ask a model for an answer. so why don’t we just set up our intelligence in a way that the ai can return? return me the human written doc that talks about this.
- present the human written data first. why do we jump straight to summarizing the human written knowledge. we should not think the carefully crafted words of a human so lightly that we scrub it of all humanity by passing it through a neural network to make sanitized computer response. we should appreciate more the time people take to gather knowledge and pass it to the next person and pass it down in history. why would we risk a prediction model hallucination on such important information.
code snippets and notes #
daily #
| |
Using xrandr #
xrandr is the most common tool for managing displays in X11-based window managers like i3wm.
List connected displays #
xrandr
This shows all connected monitors and their current resolutions and refresh rates.
Set display resolution and position #
xrandr --output HDMI-1 --mode 1920x1080 --rate 60
#mirror
xrandr --output HDMI-2 --same-as eDP-1 --mode 1920x1080
#extend
xrandr --output HDMI-2 --mode 1920x1080 --pos 0x0 --output eDP-1 --mode 1920x1080 --pos 1920x0
bluetooth controls #
#### bluetooth controls
bluetoothctl power on bluetoothctl power off
bluetoothctl scan on bluetoothctl scan off
bluetoothctl pair <MAC_ADDRESS>
bluetoothctl connect <MAC_ADDRESS> bluetoothctl disconnect <MAC_ADDRESS>
bluetoothctl devices
To create a connection with the built-in utils, you can follow this slightly more manual process using bluetoothctl.
hcitool scan # to get the MAC address of your device
bluetoothctl
power on # in case the bluez controller power is off
agent on
scan on # wait for your device's address to show up here
scan off
trust MAC_ADDRESS
pair MAC_ADDRRESS
connect MAC_ADDRESS
sudo hcitool cc 94:23:6E:6F:23:9D
Device F8:73:DF:CF:A8:ED Beats Studio Pro
bluetoothctl
scan on
pair F8:73:DF:CF:A8:ED
trust F8:73:DF:CF:A8:ED
connect F8:73:DF:CF:A8:ED
bluetoothctl devices
bluetoothctl scan on
bluetoothctl pair F8:73:DF:CF:A8:ED
bluetoothctl trust F8:73:DF:CF:A8:ED
bluetoothctl connect F8:73:DF:CF:A8:ED
then quickly pair and connect with bluetoothctl
You can add keybindings to your `~/.config/i3/config` file for quick access:
bluetoothctl info F8:73:DF:CF:A8:ED
Toggle Bluetooth on/off #
bindsym $mod+b exec bluetoothctl power on bindsym $mod+shift+b exec bluetoothctl power off
#### WIFI
**List available networks:**
```bash
nmcli device wifi list
Connect to a network:
nmcli device wifi connect "<SSID>" password "<PASSWORD>"
Disconnect from a network:
nmcli device disconnect wlan0
Show connection status:
nmcli connection show
nmcli device status
Enable/disable WiFi:
nmcli radio wifi on
nmcli radio wifi off
Forget a saved network:
nmcli connection delete "<SSID>"
A terminal-based interface that’s easier than raw commands:
nmtui
beginner #
| |
| |
# remove report error dialog?
sudo rm /var/crash/*
json parser? #
jq
systemctl stop postgresql
edit .bashrc echo “hello from .bashrc”
disable double tap drag Ubuntu / pop* bash command
| |
| |
export PATH=$PATH:/home/user/bin
cp -r supastro ~/web-dev/calc
# Remove "string_to_remove" from all filenames
rename 's/string_to_remove//' *
# re runs previous command but in sudo mode
sudo!!
| |
| |
delete then watch a log file and print to console every 1s
| |
chmod +x myscript.sh
Setting up a VPS #
ssh-keygen
- update
sudo apt update
sudo apt upgrade
ls /var/run/reboot-required
reboot
# REAPEAT THESE STEPS AFTER REBOOT
- lock down vps
# check for logins over ssh
sudo tail -n 10 -f /var/log/auth.log
# check user, if 0 you are root
id
# disable password login
-
username #
# change password of current user, (root)
passwd
# create new user
adduser <name>
#add user to sudo group
usermod -aG sudo <name>
#check if use group worked
groups <name>
#create ssh key for new user, on extenal device
ssh-keygen
#add public key from laptop into authorized keys directory
~/.ssh/authorized_keys
# disable password login
## edit following files, find PassworAuthenication setting
/etc/ssh/ssh_config
/etc/ssh/ssh_config.d/
##cloud init?
sudo service ssh restart
# disable root login
#remove '#' comment in sshd_config
PermitRootLogin no
# network and firewall policy
# uncomplicated firewall (ufw)
# 22 for root, 80 http, 443 https?
sudo ufw allow 22 # Allow SSH
sudo ufw allow 80 # Allow HTTP
sudo ufw allow 443 # Allow HTTPS
sudo ufw status verbose
sudo ufw enable
# optional change ssh port to something else than 22 (for more security)
# you can lock down ports to specific ip addresses too
fail2ban
- blocks IP at firewall level if there are multiple failed attmepts
automatic upgrades
sudo apt install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
# check to see if it is running
sudo systemctl status unattended-upgrades
- a wizard should pop up, docs link
# the caddy docs assume you are using it as a command line, we will be installing caddy as a service
# install the systemd service
sudo service caddy status
# update caddy file with domain name
/etc/caddy/Caddyfile
sudo service caddy restart
sudo service caddy reload
/var/www/
# do not have the website folders editable by the server user group
change write access only to one user, not any servers
# changing owser of a directory
sudo chown tannerr:tannerr ttannerr.xyz/
# create a system link to perform a multifile pattern
ln -s /etc/caddy/sites-available/http-redirects /etc/caddy/sites-enabled/http-redirects
147.182.240.197
# send files over ssh
# specify files to send space separated, user login for ssh colon filepath
scp [<filename> <filename> <filename> ... ] <user>@<ip-address-or-domanin>:/path/to/directory
# send files using rsync (only transfers files that have changed)
rsync -azP $(pwd)/ <user>@<server-doman>:path/to/folder
# hide files from caddy
# insdie site code block
file_server {
hide .git
}
# handle error
# insdie site code block
handle_errors {
respond "{err.status_code} {err.status_text}"
}
there MUST be a space after the URL or IP before the {} in Caddyfile
# reverse proxy
# insdie site code block
reverse_proxy :3000
# servers in ~/hosts directory
# import configs from a folder
import conf.d/*.Caddyfile
## disable the config, add a '.disabled' on the end of the file name
# github can create ssh deploy keys for cloning repos
# create ssh key on server, create key for specific repo not your whole github account
# install node under regular user account not root so if the server is compromised they can have access to everything
#manage long running processes with pm2 (or systemd)
# pm2 works well with node apps
# virtual environment
python3 -m venv env
source env/bin/activate
deactivate
# save the packeages of a project into a file to share on github
pip freeze > requirements.txt
# install packes from file
pip install -r rquirements.txt
air
hetzner
Login:
K0639376625
Key:
cDWPmLd75tazZkkB
# add user to docker group to run commands without sudo
sudo usermod -a -G docker <user>
# you can build or compose on the production server but for larger apps you have a bulid server because it takes up a lot of compute resources
# docker compose addition
restart: always
# run in detached mode
docker compose up -d
# list services?
docker ps
syntax self host 101 notes #
openvpn wiregaurd https://en.wikipedia.org/wiki/Software_load_testing
process manager or systemd to restart web server if it crashes
- use systemd to write a process manager for webservers to be hosted a vps or homelab
pm2
scp can transer files between your vps and laptop
ssh_config
can be configured to specify username and port so you don’t have to say it everytime you ssh
you can specify a new ssh port in the config file
- you can set up to not need to specify the user name too
store ssh keys on yubikey and/or set up ssh keys on another machine? print it off
- PAM modules?
you can also set up 2fa?
we set up a new user and added that one to a group with sudo capabilities?? then we set up the ssh to the new user
Issues with DNS resolution Cloudflare TLS setting to FULL!!!
Networking notes #
| |
# after installing docker, add tannerr to the docker group
sudo usermod -a -G docker tannerr
opencode add editor env
| |
go, air, opencode
| |
alias’s
| |
| |
| |
# * * * * * echo hello >> /home/tannerr/hello.txt
# * * * * * /usr/bin/python3 /home/tannerr/data/integration/reports/sales_scorecard.py >> /home/tannerr/cron.log 2>&1
#0 8 * * 1 /usr/bin/python3 /home/tannerr/data/integration/reports/sales_scorecard.py >> /home/tannerr/cron.log 2>&1
0 6 * * 1 /usr/bin/python3 /home/tannerr/data/integration/reports/item_snapshot.py >> /home/tannerr/cron.log 2>&1
0 7 * * 1 /usr/bin/python3 /home/tannerr/data/integration/reports/contact_snapshot.py >> /home/tannerr/cron.log 2>&1
SERVER DOCKER COMMANDS #
data-app #
Local:
docker build . -t tannerrrr/data-app-image
docker push tannerrrr/data-app-image:latest
VPS:
docker pull tannerrrr/data-app-image
docker stop data-app && docker rm data-app && docker ps
docker run -d --name data-app -p 8080:8080 tannerrrr/data-app-image:latest
local all two:
sudo docker build . -t tannerrrr/data-app-image && sudo docker push tannerrrr/data-app-image:latest
vps all three:
docker pull tannerrrr/data-app-image && docker stop data-app && docker rm data-app && docker ps && docker run -d --name data-app -p 8080:8080 tannerrrr/data-app-image:latest
data-connect #
docker build --no-cache -t data-connect .
docker pull tannerrrr/data-connect:latest
docker run -d --rm --mount type=volume,src=integration-data,target=/integration/data --name data-connect -e NS_ID="[email protected]" -e NS_PW="" tannerrrr/data-connect:latest
adding website to /var/www #
- create new dir
| |
- change permissions
| |
- deploy from dev machine
| |
- configure caddy
pockist.com {
root * /var/www/pockist
file_server
header {
Cache-Control max-age=3600
}
}
- reload caddy config
| |
Disable Brave scrollable tabs #
brave://flags/#brave-change-active-tab-on-scroll-event
Change active tab on scroll event Change the active tab when scroll events occur on tab strip. – Linux #brave-change-active-tab-on-scroll-event
tap to click START trackpad settings #
NOTES #
Check out the xinput command.
xinput list
will give you a list of input devices; find the ID of the one which looks like a touchpad. Then do
xinput list-props <device id>
which should tell you what properties you can change for the input device. You should find one called something like Tapping Enabled and a number in parens after it (in my case, its libinput Tapping Enabled (276). Finally, run
xinput set-prop <device id> <property id> 1
, and tapping should work.
COMMANDS #
xinput list
xinput list-props <device id>
xinput set-prop <device id> <property id> 1
# natural scrolling
xinput set-prop 9 317 1
xinput set-prop 10 317 1
# tap to click
xinput set-prop 9 322 1
xinput set-prop 10 322 1
xinput set-prop 13 322 1
xinput set-prop 13 346 1
xinput set-prop 13 346 1
MOUSE SPEED #
xinput list
xinput list-props <device id>
xinput set-prop <device id> <property id> 1
the setting you are looking for is the Coordinate Transformation Matrix
You can use the default Value 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
and change the last value. You can do it like this:
ctmVal=3
xinput set-prop 12 "Coordinate Transformation Matrix" 1, 0, 0, 0, 1, 0, 0, 0, $ctmVal
xinput set-prop 10 190 1, 0, 0, 0, 1, 0, 0, 0, 3
the higher $ctmVal in this case, the slower the mouse speed
THEME NONSENSE START tried this but doesn’t work .config/gtk-3.0 or 4.0/settings.ini [Settings] gtk-application-prefer-dark-theme=true sudo apt install lxappearance sudo apt install adwaita-icon-theme gnome-themes-extra gsettings set org.gnome.desktop.interface gtk-theme “Adwaita-dark” non of this worked to change the default files/nautilus or calc or zed, the system theme was never changed THEME NONSENSE END
theme that actually worked? #
$HOME/.config/xdg-desktop-portal/portals.conf
with contents:
[preferred]
default=gtk;wlr
Trackpad scroll Edit /usr/share/X11/xorg.conf.d/40-libinput.conf Add there Option “NaturalScrolling” “True” like this: Section “InputClass” Identifier “libinput touchpad catchall” MatchIsTouchpad “on” MatchDevicePath “/dev/input/event*” Driver “libinput” Option “NaturalScrolling” “True” EndSection Trackpad scroll END