Compare commits

...

2 Commits

Author SHA1 Message Date
Dionysus 42ab8f31f9
Fixed swap szie 2024-02-16 15:40:01 -05:00
Dionysus 3ce4b3977e
Fixed 2024-02-16 15:00:55 -05:00
5 changed files with 45 additions and 10 deletions

View File

@ -2,7 +2,6 @@
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export GOPATH=$HOME/dev/go
export GPG_TTY=$(tty)
export PATH=$HOME/.local/bin:$PATH

8
incus
View File

@ -1,8 +0,0 @@
xbps-install incus incus-client
ln -s /etc/sv/incus /var/service
ln -s /etc/sv/incus-user /var/service
sv up incus
sv up incus-user
xbps-install runit-iptables

27
scripts/motd.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
cat super.txt
DISTRO_VERSION=$(cat /etc/os-release | grep PRETTY_NAME | cut -d= -f2 | tr -d '"')
ARCH=$(uname -m)
CPU_NAME=$(lscpu | grep "Model name" | cut -d: -f2 | sed -e 's/^[[:space:]]*//')
CPU_COUNT=$(lscpu | grep "Socket(s):" | cut -d: -f2 | sed -e 's/^[[:space:]]*//')
THREAD_COUNT=$(lscpu | grep -E '^Socket\(s\)|^Core\(s\) per socket|^Thread\(s\) per core' | awk '{print $NF}' | tr '\n' ' ' | awk '{print $1 * $2 * $3}')
TOTAL_RAM=$(free | grep Mem | awk '{printf "%.2f GB\n", $2/1024/1024}')
DISK_USAGE=$(df -h "$(pwd)" | awk 'NR==2 {print $3"B / "$2"B"}')
CPU_INFO="${CPU_COUNT}x ${CPU_NAME} with ${THREAD_COUNT} threads each"
DARK_GREY='\033[0;90m'
CYAN='\033[0;36m'
NO_COLOR='\033[0m'
SEP="${DARK_GREY}${NO_COLOR}"
echo ""
echo "┏┓┳┳┏┓┏┓┳┓ ${CYAN}Hostname${NO_COLOR} ${DARK_GREY}${NO_COLOR} $(cat /etc/hostname)"
echo "┗┓┃┃┃┃┣ ┣┫ ${CYAN}Build${NO_COLOR} ${DARK_GREY}${NO_COLOR} $DISTRO_VERSION ($ARCH)"
echo "┗┛┗┛┣┛┗┛┛┗ ${CYAN}CPU${NO_COLOR} ${DARK_GREY}${NO_COLOR} $CPU_INFO"
echo "┳┓┏┓┏┳┓┏┓ ${CYAN}RAM${NO_COLOR} ${DARK_GREY}${NO_COLOR} $TOTAL_RAM"
echo "┃┃┣ ┃ ┗┓ ${CYAN}DISK${NO_COLOR} ${DARK_GREY}${NO_COLOR} $DISK_USAGE"
echo "┛┗┗┛ ┻ ┗┛ ${CYAN}IP${NO_COLOR} ${DARK_GREY}${NO_COLOR} $(curl -s https://4.icanhazip.com)"
echo ""

16
scripts/super.txt Normal file
View File

@ -0,0 +1,16 @@
  
    
          
          
        
        
    
      
        
    
      
      
    
    
  
 

3
vps
View File

@ -78,7 +78,8 @@ setup_chroot() {
echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >> /etc/fstab
touch /swapfile
dd if=/dev/zero of=/swapfile bs=1M count=$(($SWAP_SIZE_GB * 1024)) status=progress
COUNT=$(($SWAP_SIZE_GB * 1024))
dd if=/dev/zero of=/swapfile bs=1M count=${COUNT} status=progress
chmod 0600 /swapfile
mkswap /swapfile && swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab