dav3.net drawing to a close

it’s time to move on

This was always a wordpress site and I think for what I need, it’s time to close the doors and move onto something else.

What else? No idea. The internet is so full of crap these days.

I was lucky, I grew up in a time where the internet was new and the information was groundbreaking, and although it still can be, today it is so full of shit.

The last few weeks I’ve been looking at cross platform application development. Having been out of the Micro$oft paradigm for a long time I was stuck between an insanely difficult OS X world and an insanely more difficult linux world. I did miss some of the simplicity of MS, but not enough to go back.

I recently had to develop an application for a windows computer and so I downloaded the Windows 10 Enterprise Evaluation / Developers edition to make an app that I quickly deployed. I found Visual Studio buggy and it crashed a lot, but it got the job done.

I have been wanting something truly cross platform for a long while but if you want to include linux in the mix it starts to get a bit difficult. Qt’s licensing is not the best and GTK is just buggy. And everything requires extras to be installed (whether it be GTK for windows, or mono for OSX and Linux, there’s always something).

I recently searched for cross platform development and came across a post for 7 development tools. COOL! Let’s check the out. I took the first one from the list and checked Youtube, the NEWEST video for that tool was 6 years old! I went back to the article and saw that it was “Last Updated: February 2014

So what do you do?

I don’t know, I’m still investigating, but WordPress and Visual Studio just aren’t cutting it.

I HAVE been looking at Xojo.com. I haven’t bought into it yet but I like it. It’s not as nice and full featured as Python, or C# or nodeJS, but it is really cross platform. And as an ex VB6 user, it’s kind of reminiscent going back to BASIC, but I think I’m too accustomed to the modern tools now.

But I’m persevering. I think I’ll get it in the end.

But it really is time for dav3 to re-invent itself.

I just wish I had time to do it!

sudo pip install…

I know that sudo pip is obviously wrong, so what am I supposed to do?

There are other issues as well, not using virtual environments and installations that break OS dependencies, and/or a mishmash of install options to begin with (like: do you use macports or homebrew? What happens when the tool you need is in one and not the other? why can’t they coincide peacefully together? Then managing what was installed from original sources and binaries, or through third parties such as homebrew and ports? And that’s not to mention installers built on the underlying technologies you’re trying to install!)

One issue I keep getting is about privileges and permissions and sudo seems to fix all that, but it can lead to other issues and break things as well, like the underlying OS reliance on older python and permissions for other users (not so bad in my single user environment /me thinks).

After playing with other technologies I am beginning to see an underlying pattern that virtual environments are a step in the right direction.

A user solution:

A much better and secure way would be:

pip install --user numpy # libs will be installed in ~/.local/lib

This is better, and can be used for installing applications, but it doesn’t solve the problem of having different versions needs for different python projects. Enter pipenvpipenv is to python what composer is to PHP. It lets you easily install and use libraries per project. It’s not the only tool allowing you to do that, but it’s the one I use so it’s the one I’m gonna present you. Example:

A pipenv solution

pipenv install numpy matplotlib pandas
# to start your program
pipenv run ./crunch-data.py
# to install libs from another machine, after a git pull:
pipenv sync
# to get a shell in the env (like `source myenv/bin/activate` for venv)
pipenv shell

This allows a very reproducible environment for your program, without resorting to Docker and without messing up user or system libraries. Save yourself from future bugs and start using pipenv, venv, conda or virtualenv right away! It’s much better than requirements.txt + pip. :)

reference: https://dev.to/elabftw/stop-using-sudo-pip-install-52mn

Adding additional IP Address to ethernet interface

Scenario: You have several devices within your network, you’ve changed the address range for the network but you’ve forgotten to change one in particular. It’s easier to log into the device than to physically attend to it (it may be headless, it may not be in your immediate vicinity, or you’re just to lazy to get out of your chair to do it.

Q. How do you log into a network device that isn’t on your subnet?

A. You create an alias IP address for your current interface within the scope of the IP address you need to hit.

In this example we’ve moved a network from a 192.168.0.1 to 10.0.0.1.

The router has been configured, all the devices have been configured and you’re up and running but realised you forgot the file server in the garage. Your whole network is now setup on the 10.0.0.1 network, but the file server is sitting patiently waiting for you back on the 192.168.0.1 network.

Here’s how you would do it in linux (Ubuntu):

>$ ifconfig
enp6s0: flags=4163 mtu 1500
inet 10.0.0.5 netmask 255.255.255.0 broadcast 10.0.0.255
RX packets 6406862 bytes 7485766742 (7.4 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3920089 bytes 1566938600 (1.5 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
The old server is at 192.168.0.100, our computer was at 192.168.0.77. You can use any IP address that is not the device you want to connect to, and that is still within the same subnet range.

$ ifconfig enp6s0:0 192.168.0.77 up
Confirm it worked:

enp6s0: flags=4163 mtu 1500
inet 10.0.0.5 netmask 255.255.255.0 broadcast 10.0.0.255
ether 11:22:dd:99:4e:ee txqueuelen 1000 (Ethernet)
RX packets 6413204 bytes 7488178719 (7.4 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3925411 bytes 1568449079 (1.5 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp6s0:0: flags=4163 mtu 1500
inet 192.168.0.77 netmask 255.255.255.0 broadcast 192.168.0.255
ether 11:22:dd:99:4e:ee txqueuelen 1000 (Ethernet)
note: this won’t survive a reboot. But for most intents and purposes, this will suffice. You can log into the file server and change the IP address and jump back out.

To make it permanent we will need to edit

/etc/network/interfaces
from: https://askubuntu.com/questions/585468/how-do-i-add-an-additional-ip-address-to-an-interface-in-ubuntu-14 (modified only to match the example above)

# vi /etc/network/interfaces
Append the following to the file (This is in addition to existing information, not a replacement for it)

auto eth0:1
iface eth0:1 inet static
name Ethernet alias LAN card
address 192.168.1.7
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
Save and close the file. Restart the network:

# /etc/init.d/networking restart

Back from the Moon, Apollo Astronauts Had to Go Through Customs

Today commemorates 50 years since the moon landing. That means I’m officially half a century old! Not that I remember it, but on that day in July, I was in a baby bassinet watching Armstrong and Aldrin taking their historic steps.

Apparently on their return to Hawaii they filled out a customs declaration. It was more of a joke than anything else at the time. However today it is more of a formality.

For a full copy of the declaration and more of a back story, please visit the below link

from: https://www.space.com/7044-moon-apollo-astronauts-customs.html

Forgotten raspberry pi login password

Today I am working on an old raspberry pi (model B, original version) and need to get this project up and running, but I have forgotten the password.

No problem.

Let’s take the SD card and edit the `cmdline.txt` file in the root directory and add `init=/bin/sh` to the end of it (make sure there is a space before it).

Put it back into the pi and reboot.

On the pi, type:

su
mount -o remount, rw /
passwd pi

and enter your new password. Once done, sync the drive and exit
sync
exit

I like beer

In some of my songs, I have casually mentioned
The fact that I like to drink beer.

This little song, is more to the point,
Roll out the barrels and lend me your ears,

I like beer
It makes me a jolly good fellow,
I like beer
it helps me unwind and sometimes it makes me feel mellow (makes him feel mellow)

Whisky’s too rough,
Champaign costs too much
and Vodka puts my mouth in gear,
This little refrain, should help me explain,
as a matter of fact, I like beer (he likes beer)

My wife often frowns, when We’re on the town,
And I’m wearing a suit and a tie,
She’s sipping vermouth and she thinks I’m uncouth,
when I yell as the waiter goes by,

Whisky’s too rough,
Champaign costs too much
and Vodka puts my mouth in gear,
While this little refrain, should help me explain,
as a matter of fact, I like beer (he likes beer)

Last night I dreamed, that I passed from the scene
and I went to a place so sublime
All the water was clear and tasted like beer
then they turned it all into wine

I like beer
It makes me a jolly good fellow,
I like beer
it helps me unwind and sometimes it makes me feel mellow (makes him feel mellow)

Whisky’s too rough,
Champaign costs too much
and Vodka puts my mouth in gear,
This little refrain, should help me explain,
as a matter of fact, I love beer (yes he likes beer)

journalctl -xef -u some.service

systemctl status … will display an excerpt.

If the error is displayed when starting Caddyserver from a console, but is not shown in the logs if an initdaemon such as systemd is used (which logs stdout and stderr), then Caddyserver’s authors have forgotten to Flush stdout and/or stderr before exiting.

found: https://caddy.community/t/cant-start-caddy-with-systemd-service-file/3447

I wish I’d found this little gem a long time ago!