Tasks - jasper-zanjani/dotfiles GitHub Wiki
- Set up SSH server on WSL
- Set custom resolution on a VM
- Bash scripting
- Diagnosing network problems
- Distros
- Samba
- X forwarding
Specify a custom resolution in a VM [github.io](https://stafwag.github.io/blog/blog/2018/04/22/high-screen-resolution-on-a-kvm-virtual-machine-with-qxl/ 'stafwag.github.io: "High screen resolution on a KVM virtual machine with QXL")
cvt 2560 1440
xrandr --newmode "2560x1440_60.00" 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync
xrandr --addmode Virtual-1 2560x1440_60.00
xrandr --output Virtual-1 --mode 2560x1440_60.0ssh -Y user@hostHave remote system use local computer {me.luna.edu}'s X display
export DISPLAY=me.luna.edu:0Install and configure Samba server [vitux.com][https://vitux.com/how-to-install-and-configure-samba-on-ubuntu/]
Install samba
sudo apt install sambaVerify the samba service smbd is running
sudo systemctl status smbdConfigure Samba
sudo mkdir /samba # Create a directory for the share
sudo chmod -R 0777 /samba
sudo chown -R nobody:nobody /samba # Remove ownershipOpen firewall rule
sudo firewall-cmd --permanent --add-service=samba
sudo firewall-cmd --reloadConfigure Samba config file at [/etc/samba/smb.conf][/etc/samba/smb.conf]
[samba-share]
comment = Samba on Ubuntu
path = /samba
read only = no
browsable = yes
Set up a Samba account for $USER
sudo smbpasswd -a $USERRestart Samba service [vitux.com][https://vitux.com/how-to-install-and-configure-samba-on-ubuntu/] tecmint.com
sudo systemctl restart smbd.serviceInstall and configure Samba as a client
sudo apt install smbclient Access samba share at $SHARE at server $HOST using user credential $USER
sudo smbclient //$HOST/$USER -U $USERThis will display the Samba CLI
smb: \>
Validating arguments [Sobell][Sobell]: 548
if [ $# != 2 ]
then
echo "..."
exit 1
fi[ -z "$1" ] && echo "..." && exit 1[coderwall.com][https://coderwall.com/p/kq9ghg/yakuake-scripting]
if [ ! -z "$2" ] ; then ...; fiPlaced in a while loop, if user responds with anything except "y" (the read command will read only the first letter) the loop will terminate [Cannon][CLKF]
read -p "Backup another server? (y/n)" -n 1
["$BACKUP_AGAIN"="y"] || breakTest from the inside out, starting with the loopback
- ping looback address, testing the TCP/IP stack
- ping the hardware interface
- ping another host on the network
- ping the gateway
- ping an IP address on the Internet
- ping a hostname on the Internet
Display contents of a random file
ls | sort -R | sed 1q | xargs catFind out which commands you use most often
history | awk '{print $2' | sort | uniq -c | sort -rn | headCount the number of occurrences of a string
| uniq -c | sort -Change hostname
sudo hostnamectl set-hostname newhostnameCheck kernel version linuxize.com
uname -srmhostnamectl | grep "Kernel"cat /proc/versionInspect available drives and partitions before/after inserting USB drive
lsblkMount ISO (if)to USB drive (of), with progress displayed
dd if=Downloads/archlinux-2018.03.01-x86_64.iso of=/dev/sdba status="progress"Reboot from the USB drive. If there are values displayed a UEFI system is required and a different installation sequence is needed.
ls /sys/firmware/efi/efivarsEnsure an Ethernet internet connection or wi-fi menu a valid Wi-Fi connection is present
timedatectl set-ntp trueBegin the process of partitioning the disk; enter the fdisk command prompt
fdisk /dev/sdbSet up ext4 filesystem on boot, root, and home partitions
mkfs.ext4 /dev/sdb1
mkfs.ext4 /dev/sdb3
mkfs.ext4 /dev/sdb4Make the swap partition a swap drive
mkswap /dev/sdb2
swapon /dev/sdb2Mount partitions
mount /dev/sdb3 /mnt
mkdir /mnt/home
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot
mount /dev/sdb4 /mnt/homeInstall Arch Linux on the directory provided with the packages base, base-devel (which includes sudo and other development tools), vim
pacstrap /mnt base base-devel vimMake an fstab file, taking all the drives mounted at that location, going off of UUIDs rather than the sd identifiers (which might change)
genfstab -U /mnt > /mnt/etc/fstabChange root to new Arch Linux installation
arch-chroot /mntInstall networkmanager which will allow Ethernet Internet connections upon reboot
pacman -S networkmanagerTell SystemD to start NetworkManager upon login
systemctl enable NetworkManagerInstall GRUB
pacman -S grubInstall GRUB as bootloader
grub-install --target=i386-pc /dev/sdbGenerate GRUB configuration
grub-mkconfig -o /boot/grub/grub.cfgSet password for root
passwdUncomment the two lines referring to US English
vim /etc/locale.genRead that file and set locale
locale-genSet LANG language variable
echo "LANG=en-US.UTF-8" > /etc/locale.confSet timezone by making localtime a link to the correct timezone (this command is all that is required when resetting timezone during travel)
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtimeWrite new hostname
echo archizard > /etc/hostnameReturn to USB shell
exitUnmount hard drive for safety
umount -R /mntReboot
reboot- Install
noto-fontsandttf-linux-libertinettf-inconsolata -
~/.config/fontconfig/fonts.confXML file that defines fonts as serif, monospace, etc
pacman -S xfce4
exec xfce4-sessionsudo pacman -S lightdm lightdm-gtk-greeter
sudo systemctl enable lightdm.service
- Ctrl+Alt+F2|F3|F4... bring up another TTY
- Alt+LeftArrow|RightArrow navigate to adjacent TTY