Notes: Linux





Random notes for Linux. Primarily for my own reference.

Scripting

# Change Dir to Script Dir
cd "$(dirname "$0")"

Personal Utilities

echo "Deepseek API Key:"
read key_deepseek
cd ~
mkdir bin
cd bin
curl https://zyedidia.github.io/eget.sh | sh
echo "1" | ./eget -a static.tar.gz zyedidia/micro
./eget sigoden/aichat
cd ~
cat << EOF >> .bashrc
export PATH=$PATH:~/bin
export EDITOR=micro
alias s="aichat -e"
alias l="ls -la"
alias e="micro"
EOF
mkdir -p ~/.config/aichat/
cat << EOF > ~/.config/aichat/config.yaml
# see https://github.com/sigoden/aichat/blob/main/config.example.yaml
model: deepseek:deepseek-chat
clients:
- type: openai-compatible
  name: deepseek
  api_base: https://api.deepseek.com
  api_key: $key_deepseek
EOF
exec bash

(My) Ideal Debian VM Setup

Serial Access

# Enable serial console
systemctl enable serial-getty@ttyS0.service

General

timedatectl set-timezone America/New_York
apt update
apt upgrade -y
# Enable automatic upgrades
apt install unattended-upgrades apt-listchanges sudo curl git -y
echo "Unattended-Upgrade::Automatic-Reboot-WithUsers "true";" > /etc/apt/apt.conf.d/52unattended-upgrades-local

With Docker

curl -fsSL https://get.docker.com | sh
apt install -y docker-compose
docker run --detach --name watchtower --restart unless-stopped --volume /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower

With SMB Share

#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=l
apt install cifs-utils -y
echo "Linux username: "
read linux_username
echo "SMB Username: "
read smb_username
echo "SMB Password: "
read smb_password
mkdir /media/share
printf "username=$smb_username\npassword=$smb_password" > /root/sharecreds.txt
printf "\n//10.10.10.4/home /media/share cifs credentials=/root/sharecreds.txt,uid=$linux_username,gid=$linux_username,file_mode=0770,dir_mode=0770,noperm 0 0\n" >> /etc/fstab
systemctl daemon-reload
adduser $linux_username
echo "*/1 *  * * *  mount -a" | crontab - # Hack
mount -a


Comments are currently disabled.


Enable Comments

By enabling comments, you agree to allow this website to connect to Cusdis and to the Cusdis Privacy Policy.