Skip to content

Instantly share code, notes, and snippets.

@HackingGate
Last active February 23, 2024 23:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HackingGate/3dbcf2264ccf7dbb7465560ca1cf9edc to your computer and use it in GitHub Desktop.
Save HackingGate/3dbcf2264ccf7dbb7465560ca1cf9edc to your computer and use it in GitHub Desktop.
My Ubuntu Desktop Setup
# Make Ubuntu use local time (Fix Windows 10 dual boot different time issue)
timedatectl set-local-rtc 1 --adjust-system-clock
# Check current settings
timedatectl
# Install packages
sudo apt update
sudo apt upgrade -y
sudo apt install emacs vim curl wget git build-essential -y
# Install Tor
sudo sh -c 'echo "deb [arch=amd64] https://deb.torproject.org/torproject.org $(lsb_release -sc) main" >> /etc/apt/sources.list.d/tor-project.list'
# Download Keyring
# https://deb.torproject.org/torproject.org/pool/main/d/deb.torproject.org-keyring/
sudo apt install ~/Downloads/deb.torproject.org-keyring*.deb
sudo apt update
sudo apt install tor
tor --version
systemctl status tor
sudo apt install torbrowser-launcher
@HackingGate
Copy link
Author

HackingGate commented Mar 26, 2022

Wake-on-LAN (WoL)

UEFI BIOS

ASUS: https://www.asus.com/global/support/FAQ/1045950/

Ubuntu

https://help.ubuntu.com/community/WakeOnLan

Command:

sudo apt update
sudo apt install ethtool
sudo ethtool enp6s0

Output:

Settings for enp6s0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	                        2500baseT/Full 
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	                        2500baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Half 1000baseT/Full 
	Link partner advertised pause frame use: Symmetric
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: Unknown
	Supports Wake-on: pumbg
	Wake-on: d
	Link detected: yes

Enable WoL

sudo ethtool -s enp6s0 wol g

Check if settings applied

sudo ethtool enp6s0

Output:

Settings for enp6s0:
...
	Wake-on: g
...

Persist across reboots

sudo apt install ifupdown

Add the following to the bottom of /etc/network/interfaces

auto enp6s0
iface enp6s0 inet dhcp
        up ethtool -s enp6s0 wol g

Raspberry Pi (always on)

Get Mac address

ip neighbor show [IP_ADDRESS_OF_TARGET_PC]

Install wakeonlan

sudo apt install wakeonlan

Shutdown target PC. Try this command to boot it.

wakeonlan [MAC_ADDRESS_OF_TARGET_PC]

@HackingGate
Copy link
Author

HackingGate commented Apr 9, 2022

Mount SMB (samba)

Setup

sudo mkdir /mnt/Shared /mnt/Unlimited/
sudo apt install cifs-utils

Mount

sudo mount -t cifs -o username=hg //192.168.4.1/Shared /mnt/Shared/
sudo mount -t cifs -o username=hg //192.168.4.1/Unlimited /mnt/Unlimited/

Automount (add to /etc/fstab)

//192.168.4.1/Shared /mnt/Shared cifs username=hg 0 0
//192.168.4.1/Unlimited /mnt/Unlimited cifs username=hg 0 0

Auto Reconnection with autofs

sudo apt-get install autofs
sudo mount -a

@HackingGate
Copy link
Author

Reboot into Windows only for one time

Edit the /etc/default/grub and replace GRUB_DEFAULT=0 with GRUB_DEFAULT=saved

sudo update-grub
WINDOWS_TITLE=`grep -i "^menuentry 'Windows" /boot/grub/grub.cfg|head -n 1|cut -d"'" -f2`
echo "Rebooting into "$WINDOWS_TITLE""
sudo grub-reboot "$WINDOWS_TITLE"
sudo reboot

From: https://unix.stackexchange.com/a/112284/267632

@HackingGate
Copy link
Author

HackingGate commented Aug 27, 2022

ohmyzsh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

starship

FiraCode Nerd Font

mkdir ~/Downloads/FiraCode
cd ~/Downloads/FiraCode
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip
unzip FiraCode.zip
mkdir ~/.local/share/fonts
cp *.otf ~/.local/share/fonts
cd ..
rm -rf FiraCode

Install through snapcraft

sudo snap install starship

Setup your shell to use Starship

echo '
eval "$(starship init zsh)"
' >> ~/.zshrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment