View current host name:
$ $hostnamectl status Static hostname: localhost.localdomain Transient hostname: kennedy.lan Icon name: computer-laptop Chassis: laptop Machine ID: xx Boot ID: xx Operating System: Fedora 30 (Workstation Edition) CPE OS Name: cpe:/o:fedoraproject:fedora:30 Kernel: Linux 5.1.3-surface Architecture: x86-64
Change the hostname to ‘kennedy.lan’:
hostnamectl set-hostname --static "kennedy.lan"
This feels very complicated. Much easier using /etc/rc.conf in FreeBSD.
I have tinkered with getting the recently released Fedora Linux version 30 to run on my Surface Book. The usual patch set by Jake Day only works for Ubuntu out of the box, so there is a bit of wood to chop. Luckily, someone has put a great guide up on Medium to follow. I am posting it here for future reference.
I’m very sad to see that the creator of Erlang, Joe Armstrong, has passed away. Erlang (Ericsson Language) is one of the pioneering languages in distributed computing, which was built by Ericsson for their carrier-grade telco switches. Erlang:
- Is a functional programming language in the spirit of Lisp, which means it is easy to scale in horizontally
- Fault tolerant, embracing the notion of “let it fail”. Failure is seen as part and parcel of any system
- Used garbage collection long before Java popularised it
- Highly available, making it possible to hot-swap parts of program code without bringing down the entire application
- Is both a language and runtime platform using the OTP (Open Telco Platform)
- Is one of the main influences of Akka, the Scala based actor implementation, which provides a highly scalable distributed compute platform
Joe Armstrong was a true innovator in his field and I am sad to see him pass away. You can read his seminal PhD thesis here and also hear him live on Software Engineering Radio here. The latter is more than 10 years old but still worth a listen for an introduction to Erlang and its interesting history from telco real-time system to open source innovator.
I have just upgraded (finally) from TPG ADSL2 internet to NBN using HFC infrastructure. My ISP is Internode.
Installation went pretty smooth. Technician visited today, drilled a few holes to install a new HFC outlet in our house, and pulled the (slightly odd) HFC coax cable trough the wall. He also handed me an NBN ‘modem’.
I use OPNsense (a FreeBSD based firewall) as my router and intended on using it for my NBN connection as well. Key things to note:
- Internode use PPPoE for their NBN HFC connections
- You need to configure it your PPPOE vlanid 2. This is critical, otherwise the connection will not work
I took the following steps in OPNsense to set it up. Note my interface is bge1 — you need to use the correct network interface which is connected to the LAN port of the NBN HFC modem.
- Interfaces – Other Types – VLAN = [ interface: bge1, tag: 2, PCP: 0 ]. Creates new interface bge1_vlanX.
- Interfaces – Point-to-Point – Devices = [ Iface: re0, Iface(s): bge1_vlanX ]. Fill in login/password here. Creates new interface pppoe0
- Interfaces – Assignments – WAN = pppoe0
- Interfaces – WAN – IPv4 Configuration Type = PPPoE
- Reboot. Check in Interfaces – WAN, that login/password been populated from pppoe0.
- Check Dashboard WAN and Gateway/WAN_PPPOE for populated IP addresses.
- Check Interfaces – Point-to-Point – Log file if you experience any errors.
Update: Thanks to ICBM on Whirlpool for inspiration and initial instructions.
I have installed Ubuntu 18.10 and needed to figure out how to install a postgres database server. Below are the steps. First we install the server components, then we check that the server is running using psql, and finally we change the default password for postgres to ‘securePassword’.
# Update package repo and install
sudo apt update
sudo apt install postgresql postgresql-contrib
# Check that database is running and that you can connect:
sudo -i -u postgres
# Exit and secure password of postgres user:
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'securePpassword';"
If you get the above error on Ubuntu or Debian, you need to install the right deb package via apt. This can be done with:
sudo apt-get install -y software-properties-common
Note – the above will only work with recent versions of Debian / Ubuntu and may vary with other versions.
Windows Subsystem for Linux (WSL) is a great way of running a Unix environment on a Windows machine. I tend to work on cases involving large scale data science, but am, like most corporate users, tied to a Windows machine. Having access to a fully-fledged Unix environment is key to productivity and work pleasure. In this guide I will show you how to install Anaconda on WSL from scratch.
Anaconda is the environment and package manager for Python. It enables you to install and manage the typical Python’esque data science tools such as TensorFlow and numpy. It is available as a Windows installer, but running anaconda from the Windows command line is clunky and doesn’t feel right (at least not after ~18 years of Unix muscle memory). For me, it helped installing conda inside of WSL in order to continue working with my favorite tools.
Step 1: enable WSL feature in Windows 10
First step is to install WSL itself if you haven’t already done so. Installation has two parts – first you enable the WSL in Windows 10, then you install your Linux distribution of choice, which plugs in to the WSL shell. WSL is responsible for translating the Linux (POSIX) syscalls into something the NT kernel can understand and vice versa.
Open powershell.exe and enable the WSL feature:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
This should take a while, so grab a cup of coffee.
Step 2: install Ubuntu
Once done, you can install Ubuntu in two ways: via the Microsoft Store or by running bash.exe. For the later, [ress Windows-key + R, enter ‘ bash.exe’ followed by enter. This will install the Ubuntu on top of WSL.
Step 3: download and install Anaconda
Once installed, open browser and go to https://www.anaconda.com/download/#linux
Pick 64-bit for Linux (not Windows). I prefer Python 3.7 as 2.7 is old, but you may need it for specific / good reasons.
Instead of downloading in the browser, right-click the button and select ‘copy link’. Go back to the terminal window and download the installer from the command line. We want to do this as it is easier than copying the file into your Linux home directory from your Windows downloads directory.
Resolving repo.continuum.io (repo.continuum.io)... 184.108.40.206, 220.127.116.11, 2606:4700::6810:120a, ...
Connecting to repo.continuum.io (repo.continuum.io)|18.104.22.168|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 684237703 (653M) [application/x-sh]
Saving to: 'Anaconda3-2018.12-Linux-x86_64.sh’
100%[===================================================================================================================================================================================================>] 684,237,703 19.5MB/s in 39s
2019-01-17 14:09:03 (16.6 MB/s) - 'Anaconda3-2018.12-Linux-x86_64.sh’ saved [684237703/684237703]
Make the file executable and run it:
chmod +x Anaconda3-2018.12-Linux-x86_64.sh
Some text will fly by. Grab another cup of coffee after you have answered a few questions. If you use bash, remember to key ‘yes’ to add conda to your path, so you can resolve the binary from within your path (usually inside ~/anaconda).
Step 4: create a new environment and install packages
Create a new environment and install your desired packages into it:
conda create -n newenv
conda activate newenv
conda install tensorflow
And you are done. Happy coding!