Tuesday, December 11, 2018

No post in awhile. Real life has been keeping me jumping. Things are good. I'm on an athletic program in Colorado Springs. Peace, love, and lots of Oo-Ah!

Friday, September 28, 2018

Funky cursor size in kubuntu

Not sure why, but my kubuntu has a mouse cursor that is sometimes way too big or small and it jumps around.

To fix this, I navigated to /home/[Your User Name] and created a file called
".Xdefaults" (without quotes).

Then I added a single line as follows and saved the file:

Xcursor.size: 24
 
Problem solved. 

Monday, September 24, 2018

Routing packets across the internet, or across different subnets in a LAN is done using a routing table.

On Linux systems this is handled by the kernel and is configured by file(s) corresponding to each network intrerface stored in /etc/sysconfig/network-scripts directory.

For example if your interface name is enp7s1 the path would look like this:  /etc/sysconfig/network-scripts/route-enp7s1.

Each interface has at least one route called the default route, which translates to a network address of 0.0.0.0 with a subnet mask of 0.0.0.0 or the entire tcp/ip address range including the "internet" (publicly routable addresses) and the private IP ranges:

192.168.0.0 - 192.168.255.255 (65,536 IP addresses) noted as 192.168.0.0/16 (255.255.0.0)
172.16.0.0 - 172.31.255.255 (1,048,576 IP addresses) noted as 172.16.0.0/12 (255.240.0.0)
10.0.0.0 - 10.255.255.255 (16,777,216 IP addresses) noted as 10.0.0.0/8 (255.0.0.0)

Most of the time these ranges are broken up into smaller subnets especially for the private ranges. for example 192.168.0.0/24 (255.255.255.0) is extremely common for home and SOHO networks.

Additional routes may be present, typically at least one for the local network, be that a subnet of the publicly routed address space or a subnet of one of the private address spaces. Also, if the machine is acting as a router itself one route for each subnet is present, for example:

$ sudo route -n
Kernel IP routing table
Destination     Gateway             Genmask         Flags  Metric Ref    Use   Iface
0.0.0.0            192.168.0.254     0.0.0.0             UG    100       0        0      enp7s1
192.168.0.0    0.0.0.0                 255.255.255.0 U       100       0        0      enp7s1

Here we have the default route 0.0.0.0 along with a gateway (for addresses not in the local subnet), this is typically used for routing packets across the internet through an ISP connection on that interface.

And then the second route is being used here for the private IP space of the local network.

A more complicated example:

$ sudo route -n
Kernel IP routing table
Destination         Gateway             Genmask               Flags    Metric Ref    Use     Iface
10.1.0.0             0.0.0.0                  255.255.0.0           U          0      0            0        eth0
192.168.0.0         0.0.0.0                255.255.255.0       U          0      0            0        eth1
192.168.25.0       0.0.0.0                255.255.255.0       U          0      0            0        eth2
0.0.0.0                 192.168.1.25      0.0.0.0                   UG       0      0            0        eth0

Here we have four interfaces connected to different subnets in both the 10.1.0.0 and 192.168.0.0 ranges. The file basically looks at the range for a match to the destination range 10.1.0.0 range up to 10.0.255.254 (mask 255.255.0.0) then try the next until we reach the default route, which forwards any unmatched subnets to the gateway at 192.168.1.25 via eth0.

It's important to note that if you are using the machine to bridge multiple subnets on different interfaces and forward those packets between ranges ip forwarding must be enabled. Otherwise the machine itself will be able to reach all the destinations in the routing table, however machines connected to it with the intent that it will bridge/route for them will not.


Thursday, September 20, 2018

Netplan has significantly changed the way we adjust networking on ubuntu server.

An example of changing from dhcp (default) to static IP address:

sudo nano /etc/netplan/01-netcfg.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   ens33:
     dhcp4: no
     dhcp6: no
     addresses: [192.168.0.222/24]
     gateway4: 192.168.0.1
     nameservers:
       addresses: [192.168.0.1]

sudo netplan apply
Webmin is a powerful web based control panel for linux servers, to install on Ubuntu 18.04 and variants:

$ sudo apt install wget

$ wget -qO- http://www.webmin.com/jcameron-key.asc | sudo apt-key add
$ sudo add-apt-repository "deb http://download.webmin.com/download/repository sarge contrib"
$ sudo apt update

$ sudo apt -y install webmin

Tuesday, September 18, 2018

Transferring files to a linux or other unix bsd etc machine from windows without setting up ftp or samba is easy.

Just make sure ssh and either scp or sftp or both are installed and use winscp: https://winscp.net/eng/download.php.
Some common bus speeds:

USB 2.0 60MB/s   - 480 Mb/s
USB 3.0 640MB/s - 5 Gb/s

32 bit PCI 33Mhz 125 MB/s   - 1 Gb/s
PCI Express 2.0    500 MB/s   - 4 Gb/s per lane
PCI Express 3.0    985 MB/s  - 7.88 Gb/s per lane

SATA      150MB/s - 1.2 Gb/s
SATA 2   300MB/s - 2.4 Gb/s
SATA 3   600MB/s - 4.8 Gb/s