WhyServices My Company
whysthatso

The site's publishing timeline, everything shows up here.

today-i-learned

SpinRite 6 on external Toshiba usb disk

Posted on February 21, 2021  //  howto hardware

After 827 days of running time my RaspiBlitz BTC lightning node refused to mount the external hard drive (Toshiba HDTB410EK3AA Canvio Basics, USB 3.0, 1TB). Smart errors of the weirdest kind. I remembered Gibson’s spammy advertisements during the Security Now! Podcast, praising SpinRite for recovery. As there was no physical damage / interaction that would have caused that i gave it a try.

After i bought the license, i downloaded the exe causing first problem, how to run on Linux? I have a Windows 7 laptop for such cases, so i executed the program and tried all the different options to create a bootable USB, finally succeeding by writing out the diskette spinrite.img to harddisk, then dd-ing it onto a usb flash drive:

dd if=/path/to/SpinRite.img conv=notrunc of=/dev/<your usb device, i.e. sda>

After rebooting the same laptop with the external USB disk attached, SpinRite started right away, and luckily for me, the drive was instantly recognized; no need for driver voodoo on the included FreeDOS distribution - that was my biggest concern. Probably the fact that the external disk is not a casing with some exotic usb-controller, but a disk with an integrated usb port helped a lot. A small downer was the unavailability of smart data for SpinRite - I don’t have a theory about that.

The first run failed with a program abort:

This is ongoing.

today-i-learned

run openvpn in client mode automatically after linux boot

Posted on January 15, 2021  //  Updated on February 21, 2021  //  networking vpn

Context: Remote raspberry pi model b rev1, all setup with raspberry os / raspbian.

the hardware specs are nothing much, but the machine is reliable, even when apparently half the ram chips are dead.

  1. Install openvpn from the distro’s repository
  2. Take the config file from the server you want to connect to - in my case an ovpn file generated by pivpn - and put it into the config folder /etc/openvpn/.
  3. if your vpn profile is password protected, add a textfile with the cleartext pass and reference it in your vpn profile file like so:
    askpass /etc/openvpn/passwordfilename
    
  4. make sure openvpn.service is started and enabled.
    systemctl enable openvpn && systemctl restart openvpn
    

ip a should show you the tunnel interface already.

NB: for the routing, make sure that your that your router has a static entry that sends all the traffic to the vpn subnet to the vpn server, but that is something that depends really on your own net topology.

link

Poor Millennials

PERMALINK
Posted on November 16, 2020  //  Updated on February 21, 2021  //  society

Generation Screwed

Why millennials are facing the scariest financial future of any generation since the Great Depression.

The Huffington Post

Some ideas here for social change, however, based on US analysis.

  • raise the minimum wage and tie it to inflation

  • roll back anti-union laws to give workers more leverage against companies that treat them as if they’re disposable

  • tilt the tax code away from the wealthy

  • attach benefits to work instead of jobs: For every hour you work, your boss chips in to a fund that pays out when you get sick, pregnant, old or fired. The fund follows you from job to job, and companies have to contribute to it whether you work there a day, a month or a year.

  • construction workers have an “hour bank” that fills up when they’re working and provides benefits even when they’re between jobs

  • Hollywood actors and technical staff have health and pension plans that follow them from movie to movie

  • in low employment / mid to high human resource areas launch a program that simply reimbursed employers for the wages they paid to eligible new hire

  • improve existing poverty fighting programs and handouts over basic income

link

Copenhagen’s New Public Spaces Are Modular and Can Float

PERMALINK
Posted on May 31, 2020  //  Updated on February 21, 2021  //  urban

Copenhagen’s New Public Spaces Are Modular and Can Float

Architects Marshall Blecher and Magnus Maarbjerg are on a mission to breathe new life into Copenhagen's old harbour. They're working on a floating archipelago that will introduce a new type of public space.

Pop-Up City

Architects Marshall Blecher and Magnus Maarbjerg are on a mission to breathe new life into Copenhagen’s old harbour. They’re working on a floating archipelago that will introduce a new type of public space.

Would be interesting to see something like this in Tallinn.

link

Exploring a Sustainable Urban Future in the Mountains of Catalonia

PERMALINK
Posted on April 4, 2020  //  Updated on February 21, 2021  //  urban finds

Exploring a Sustainable Urban Future in the Mountains of Catalonia

Why does the Institute for Advanced Architecture of Catalonia (IAAC), a world-leading university in the field of architecture, continue its research deep in the woods outside Barcelona?

Pop-Up City

Why does the Institute for Advanced Architecture of Catalonia (IAAC), a world-leading university in the field of architecture, continue its research deep in the woods outside Barcelona?

take

Sure, we should do studies

Posted on April 3, 2020  //  Updated on February 21, 2021  //  society

sure, we should do studies, and get more data, and have a full view of the …ah, there goes my dad, who is 74 with heart condition… data. we should also make sure that the we really only shut down the areas of the economy that are actually …ah, now my mom’s dead, cause she has worse chances than the new born with its mum who is 24 and also needs a respirator in a hospital with 15 places…affected by the pandemie. after all, we shouldn’t sacrifice the economy on the altar of public health …and now my grandmum is also dead, along with the 20 others in the nursery home where they still had ‘social visits’ to keep up the spirits.

you know what? who cares. some people (loose couple of scientists/doctors, a handful who have come out in the last couple of days, in a profession of what, maybe 10.000, 15.000 professionals, that just do the actual work?) just think they have eaten it with spoons, the wisdom of how to run a massively complex society of tens of millions of people.

but sure, i’m happy that they come out now and speak up, and ask the “really important questions, that yeah, actually, it makes so much sense when you think about it”. truly. it’s a right to spread your opinion, and i cherish that, really. it also helps me to figure out who i don’t care about when i need to focus on keeping my babies healthy, hope the best for my pensioner parents, and watch the images of stashed away coffins with actual dead people.

take

Pathogen Resistance

Posted on March 31, 2020  //  Updated on February 21, 2021  //  finds

we are not trapped in here with the coronavirus, the virus is trapped in here with us.

Look at it in this way maybe.

take

Starship Technologies makes redundancies to ‘streamline service’

Posted on March 29, 2020  //  Updated on February 21, 2021  //  tech

Robot delivery company Starship Technologies made a large number of redundancies last week after feeling the economic effects of the coronavirus pandemic, website DigiPRO reported.

A company uses an external crisis to restructure their business to the expense of its workers. That is nothing new. That is why other countries have made laws against that kind of behavior towards employees. How is this surprising?

link

This Furniture Is Bending the Rules of Shared Spaces

PERMALINK
Posted on February 2, 2020  //  Updated on February 21, 2021  //  design

This Furniture Is Bending the Rules of Shared Spaces

Studio Cutwork is redesigning the way we share our spaces with their flexible furniture that is based on an innovative fabrication method. Cutwork’s furniture designs are based on their signature metallic tubes that are being laser-cut to allow them to be bendable. This simple solution brings the production close to…

Pop-Up City

Cutwork’s furniture designs are based on their signature metallic tubes that are being laser-cut to allow them to be bendable. This simple solution brings the production close to the end-users and the furniture can be manufactured on demand eradicating additional costs of storage. If production locally is not an option, emissions from shipping are still kept low by flat-packing all pieces and assembling them on site. As the main material — steel — can be also easily recycled, Cutwork is about to become certified as offering all circular products.

today-i-learned

update gnubee debian jessie to buster, to bullseye

Posted on December 28, 2019  //  Updated on November 2, 2023  //  debian gnubee

Upgrade to stretch (Debian 9) and then buster (Debian 10)

To upgrade gnubee to stretch, put this in /etc/apt/sources.list:

deb http://httpredir.debian.org/debian stretch main
deb http://httpredir.debian.org/debian stretch-updates main
deb http://security.debian.org/ stretch/updates main

Then upgrade the packages:

apt update
apt full-upgrade
apt autoremove
reboot

To upgrade to buster, put this in /etc/apt/sources.list:

deb http://httpredir.debian.org/debian buster main
deb http://httpredir.debian.org/debian buster-updates main
deb http://security.debian.org/debian-security buster/updates main

and upgrade the packages:

apt update
apt full-upgrade
apt autoremove
reboot

Then to bullseye (Debian 11)

  1. Make sure the system is fully up to date
apt update
apt full-upgrade
apt autoremove
reboot
  1. Edit /etc/apt/sources.list
  • replace each instance of buster with bullseye
  • find the security line, replace buster/updates with bullseye-security
  • this is an example:
deb http://security.debian.org/ bullseye-security main contrib non-free
deb http://httpredir.debian.org/debian bullseye main contrib non-free
deb http://httpredir.debian.org/debian bullseye-updates main contrib non-free
  1. Again upgrade the system
apt update
apt full-upgrade
apt autoremove
reboot
today-i-learned

instant domain name for ipv6 device

Posted on December 22, 2019  //  Updated on November 2, 2023  //  networking

You can use IPv6address.has-a.name as a domain name for any of your computers, containers or VMs. The required format is 1234-5678-9abc-def0-1234-5678-9abc-def0.has-a.name. This is already a valid name and points to the IPv6 address 1234:5678:9abc:def0:1234:5678:9abc:def0. Alternatively you can also use the domain has-aaaa.name, which implies IPv6 stronger.

Both domains support IPv6 abbreviation using dashes, you can f.i. use 2a0a-e5c0–3.has-aaaa.name.

today-i-learned

Configure Ubuntu 18.04 with grub2 to activate serial console

Posted on December 16, 2019  //  Updated on November 2, 2023  //  ubuntu tty

Edit the file /etc/default/grub

  1. Change GRUB terminal to console and ttyS0. This will provide one GRUB to a monitor display and serial console.
  2. Change linux kernel console to tty1 and ttyS0. This setting will be taken over to userland, and there will be two login prompt for tty1 and ttyS0.
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
today-i-learned

Wireguard scenario workstation -> vpn gateway -> private network

Posted on July 25, 2019  //  howto vpn wireguard

I’ve moved a rather hacky tinc mesh vpn solution to wireguard, all set up through an ansible playbook. the topology is rather classic:

my workstation (laptop, changing network situation) connects as a ‘client’ to two wireguard ‘servers’ as vpn gateways which are publicly accessible bastion hosts, and who also are members of a private subnet to which they ought to give access. the specific nodes are cloud instances of each Hetzner cloud and Vultr cloud.

Hetzner recently started to provide private interfaces to their cloud instances, currently the private addresses seem to be given randomly when using the cli tool, but can be specified also via their website interface. Vultr has that service already longer, however, the private ip cannot be specified and is assigned at random.

the above used terms ‘client’ and ‘server’ are a bit anachronistic, as Wireguard does not make such a difference. the ‘servers’ merely do not get endpoints to their peers in their interface configuration, as they do not initiate connections.

Generally, when running a linux vpn gateway that connects two interfaces into different subnets (here wg0 is the wireguard interface, ens10 is the interface to the cloud provider’s virtual router and a self configured private subnet) one only needs to set /proc/sys/net/ipv4/ip_forward to 1 and /proc/sys/net/ipv6/conf/all/forwarding to 1 and be done with it. The nodes in the private subnet possibly need some way of receiving the necessary route back to that vpn gateway, via some routing protocol or static routing.

I was not able to set this up neither on Hetzner, nor on Vultr, and had to instead set up NAT on the gateway via iptables, as advised here in this tutorial, by the way a good reference on how to set up Wireguard: https://angristan.xyz/how-to-setup-vpn-server-wireguard-nat-ipv6/

My theory is that the virtual routers of the cloud providers are filtering this kind of traffic, as i can see the packets running through both the wireguard interface and the private subnet interface on the vpn gateway, but cannot see them at the final node’s interface. But i could be entirely wrong.

UPupdated: And here’s a quick follow up on the wireguard topic:

https://grh.am/2018/wireguard-setup-guide-for-ios/

today-i-learned

subtle changes in key format of key pairs generated with `ssh-keygen` on linux

Posted on July 11, 2019  //  Updated on July 25, 2019  //  cryptography cli

I just came across an unexpected ssh key subtlety you might have to consider while creating a drone ci deployment pipeline using drone’s ansible plugin.

Part of the pipeline includes deploying code to a remote host via ssh. I generated a new key pair with ssh-keygen. This created a key with openssh new format starting with:

-----BEGIN OPENSSH PRIVATE KEY-----

Apparently ansible does not like this format and on the “Gathering facts” step erred out with the message “Invalid key”. Googling that was not very successful, and I could not find that particular message in the ansible source, until i eventually found an unrelated closed issue on github which pointed me towards possible problems with key formats.

Eventually i generated a new key pair like so ssh-keygen -m PEM, the -m option setting the key format. The key then had the starting line

-----BEGIN RSA PRIVATE KEY-----

As far as i understand both keys are actually RSA keys, the latter’s PEM format being implied, whereas the former uses some new openssh format i was not previously aware of.

Earlier runs of ssh-keygen did produce keys in the PEM format and as i am running Archlinux with OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019

One of the rolling updates to my system probably brought along this unexpected change.

Hope that helps somebody.

today-i-learned

Compile Go on MIPS/MIPS32

Posted on February 27, 2019  //  Updated on July 25, 2019  //  mips cli gnubee

I’ve been trying to compile go programs on the gnubee which runs on the MIPS architecture.

Found this on github:

I have successfully cross compileed a go program into a mips32 binary with below command.

GOARCH=mips32 is for ar71xx, change to GOARCH=mips32le if it is ramips.

cd
git clone https://github.com/gomini/go-mips32.git
cd go-mips32/src
export GOOS=linux
export GOARCH=mips32
sudo mkdir /opt/mipsgo
./make.bash
cd ..
sudo cp -R * /opt/mipsgo
export GOROOT=/opt/mipsgo
export PATH=/opt/mipsgo/bin:$PATH
vi helloworld.go
go build helloworld.go

Source https://github.com/bettermanbao

today-i-learned

chroot and serial console to fix ubuntu distro upgrade gone wrong

Posted on September 20, 2018  //  Updated on July 25, 2019  //  tty apu2 ubuntu

I had to fix a do-distro-upgrade from 16.04 to 18.04 due to a severed ssh connection, and no screen running (apparently earlier distro upgrades used screen to prevent this kind of problem)

The machine as a PCengine apu2, so no video. Also, the root file system is sitting on a miniPCI ssd.

Eventually, my laptop and this chroot cheatsheet helped: https://aaronbonner.io/post/21103731114/chroot-into-a-broken-linux-install

  1. Mount the root filesystem device

     mount -t ext4 /dev/<device> /mnt/
    
  2. If there’s a different boot partition or anything else

     mount -t ext2 /dev/<device> /mnt/boot
    
  3. Mount special devices

     mount -t proc none /mnt/proc
     mount -o bind /dev /mnt/dev
     mount -o bind /sys /mnt/sys
    
  4. chroot

     chroot /mnt /bin/bash
     source /etc/profile
    

In order to help troubleshoot in the future, i followed this advice to get a systemd service unit for a constant shell on the serial port, but mine runs for some reason on S0: http://0pointer.de/blog/projects/serial-console.html

systemctl enable serial-getty@ttyS0.service
systemctl start serial-getty@ttyS0.service

It won’t help if systemd does not start, but otherwise it is online really early.

today-i-learned

Install and monitor skypool's Nimiq client via ansible playbook, systemd and ruby & cron

Posted on April 27, 2018  //  howto crypto currencies

INTRODUCTION

This is a short entry to document installation and monitoring of the skypool nimiq client. The Nimiq network is a decentralized payment network that runs in the browser and is installation-free.

Personally, i believe that the Litecoin and Ethereum projects have been so far able to generate a strong economy around them, however, projects like Nimiq definitely convince me in terms of usability and simplicity approach to the user.

CONTENT

I am considering Ubuntu 16.04 as base operating system.

The playbook does the following things:

  1. Install the necessary dependencies - ruby-dev for ruby 2.3, ruby gem package manage - unzip to handle the release file from github
  2. Create a specific user nimiq and a program directory /opt/nimiq
  3. Download and unpack the release file from github under a version-specific directory below the program directory
  4. Create skypool client configuration file according to your demands and with your wallet address
  5. Create a systemd unit file, start the skypool client as a service and enable restart on reboot
  6. Create a status checker that uses the skypool api to check the worker’s online/offline status
  7. Create a crontab entry for the root user to run the status checker every ten minutes

REMARKS

cron

The cron entry running every 10 minutes is a tradeoff on how brittle the online/offline check delay currently is experienced by me through the skypool site. Presumably skypool does not have a real heartbeat check towards the worker but assumes that the worker is online when it receives results from it, and subsequently assumes the worker to be offline if it does not (most pools in the cryptocurrency world work like that). That means in terms of perfect time period between checks, your mileage may vary.

systemd

The service runs currently under the user nimiq, hence a non-privileged user of the system. However, the systemd daemon used is the one from root. Hence only the root user can restart the nimiq service. For this reason, the cron entry is registered through the root user. If you want to be able to use the nimiq user to restart the nimiq service, you have to run a systemd daemon based on the nimiq user. I have successfully done that for another service playbook, and I might add this information in the future, if demand is voiced.

GIST

Find below the full gist as published on github. Full gist here.

today-i-learned

Installing Ubuntu per minimal image to PC engines APU2

Posted on May 17, 2017  //  howto apu2 ubuntu

This is the company: PCengines This is the device: APU2

Nullmodem setup

using putty

Check which com port, mine was set to ‘com4’

Get a usb to serial converter, install drivers. Some of those converters seem to have timing problems, but i did not encounter that.

I once tried lowest baud rate 9600 and that produced some nice screen carnival, but nothing really legible.

prepping usb stick

Download the usb prep tool ‘TinyCore USB Installer’ and run it against on usb, I’ve used an 8GB stick. Make sure it’s not the slowest.

To try out you can now boot into TINYCORE. So put this into the APU2’s usb port and boot up having the serial Nullmodem cable connected and the putty session open. Finished boot is indicated by an audible beep. This is good to check the serial connection which you should have established parallel to that.

If you want to keep the option of booting into TINYCORE open, backup the syslinux.config fom the USB’s root directory, as this one will be overwritten by the package content we are now downloading.

Download special Ubuntu package from pcengines, unpack and move the three files into the usb root folder / or :/ depending on your system.

Now plug in the usb into the apu2 and boot having the serial Nullmodem cable connected and the putty session open. You will see the setup menu, similar to this screen shot:

View Installation Setup Wizzard

The terminal setup process seems daunting at first, but it essentially is really analogues to the graphical Ubuntu installer. I found my way around by basically following the Easy Path(tm) of most of the suggestions of the installer, going automatically step by step through the menu. On some of the sub menus i was able to make some educated changes as i knew a bit of more details and i had a good idea where i want to go with this system, but this might not apply to you.

The one exception was the network configuration. Running the automatic network detection seems to have got the dhcpd info, but when I dropped into the busy box ash shell environment (one menu option Execute a shell in the main hierarchy at the beginning of the installation process), I had to run dhclient directly on the interface again. Checking via ip addr I now could verify the indeed applied values, and could ping any public server. With exit I dropped back into the installation menu. On a later second setup run this problem did not occur again.

I chose no automatic updates as i can see the cronjob using quite some resources. I’d rather manually schedule that for this particular system at them moment. Part of the minimum running service policy of mine for this instance.

I followed some tip regarding the bootloader installation, and it apparently solved my problem of an unfinished installation before. I lost the link, but it boiled down to manually enter the first partition of the setup target (pcie flash device in my case), so that was /dev/sdb1 as opposed to /dev/sdb. Again, this might be different for you.

Once that was done, and with a bit more patience i rebooted and eventually login via ssh could be established. I then halted the machine, physically unplugged the usb key and the console, and replugged power.

After about 45 sec ping answered and after than ssh came back online.

update

Publishing geekjobs.ee

Posted on May 14, 2017  //  Updated on May 17, 2017  //  computer

Inspired by oldgeekjobs.com i’m trying to establish a clear and simple geeks-only jobs listing site for Estonia. It’s supposed to be easier than combing through the jobs portals.

Give it a try if you have jobs to offer or are looking for any geekjobs.ee

today-i-learned

Quick way to forward mails via postfix

Posted on January 31, 2015  //  Updated on May 17, 2017  //  software

Source: https://www.bentasker.co.uk/documentation/linux/173-configuring-postfix-to-automatically-forward-mail-for-one-address-to-another

Assuming you’re running Postfix, first we make sure the virtual mappings file is enabled here /etc/postfix/virtual:

# Scroll down until you find virtual_alias_maps, make sure it reads something like
virtual_alias_maps = hash:/etc/postfix/virtual
# We also need to make sure the domain is enabled
virtual_alias_domains=example.com

Save and exit. Next we add the aliases to our mapping file /etc/postfix/virtual:

# Forward mail for admin@example.com to jo.bloggs@hotmail.com
admin@example.com  jo.bloggs@hotmail.com

If we want to send to two different addresses at once, we specify:

admin@example.com  jo.bloggs@hotmail.com jos.wife@hotmail.com

Finally, we need to create a hash (later versions of Postfix don’t require this)

postmap /etc/postfix/virtual

It’s the same principle as passing mail into a local user’s mailbox.

today-i-learned

How to create a self-signed (wildcard) certificate

Posted on September 25, 2014  //  Updated on May 17, 2017  //  cli howto

This is a quick step to generate a self-signed certificate:

openssl genrsa 2048 > host.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert
#[enter *.domain.com for the Common Name]
openssl x509 -noout -fingerprint -text < host.cert > host.info
cat host.cert host.key > host.pem
chmod 400 host.key host.pem

source: http://blog.celogeek.com/201209/209/how-to-create-a-self-signed-wildcard-certificate/