Skip to content

Instantly share code, notes, and snippets.

@DSchau
Last active September 1, 2020 02:21
Show Gist options
  • Save DSchau/26dcde9cd3936b583cdc1cb752323d1c to your computer and use it in GitHub Desktop.
Save DSchau/26dcde9cd3936b583cdc1cb752323d1c to your computer and use it in GitHub Desktop.
Ubuntu + HTPC Setup stuff
  1. Hold SHIFT at boot to enter recovery mode
  2. Select Ubuntu -> Recovery Mode
  3. Root
  4. mount -o rw,remount /
  5. Now edit etc/network/interfaces with correct gateway

(Note also, consider adding DHCP to /etc/network/interfaces) to test and then reset /etc/network/interfaces

iface ens160 inet dhcp

Be sure that if the gateway changes, that the static IP follows the same format (a la 192.168 as gateway means static IP needs to start with 192.168)

This is often caused by some issues with caching. You can first validate the problem with:

time dd if=/dev/zero of=/media/Movies bs=16k count=16384

and then monitor IO with

sudo iotop

you'll likely see write speeds in the 3-4Mb/s range.

To fix, check out this article specifically:

echo 3 > /proc/sys/vm/drop_caches

sysctl -w vm.highmem_is_dirtyable=1

and add to crontab with

sudo crontab -e
# clear buffers every 1 hour
0 * * * * sync; echo 3 | sudo tee /proc/sys/vm/drop_caches

First, follow and read this guide.

Then, we'll need to get a few values, specifically:

  1. netmask
  2. gateway

Gateway

netstat -rn # look for default

or on Linux

ip route | grep default
# default via 10.193.1.1 dev eth0 onlink
# important bit is via [..]

Netmask

This seems to change less frequently. Just use System Preferences.

  1. System Preferences
  2. Network
  3. Advanced
  4. TCP/IP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment