Play Beyond the Titanic on GNU/Linux

The story

Ship iconOne game I played in the past was Beyond the Titanic. It was a shareware game for MS-DOS, in the genre of text adventure (now known as interactive fiction).
In 2009 its source code was released under the GPL (reference 2). An enterprising individual (not this author) modified it and made it possible to build with the Free Pascal Compiler (probably known as fpc in your distro packages).
The game has an interesting quirk in that it really, really depends on having a terminal with size 80×24 and not anything else.
And of course, my Fedora COPR was having trouble building the package, but I promise you the rpm spec works on Fedora 28 (reference 4) and the dpkg spec works on Devuan 2.0 beowulf/ceres.
Although you could of course just run the BEYOND.COM version in Dosbox. I did observe the savegame files are not compatible between builds. Loading the fpc-version savegames into the DOS version of the game caused some funny and tragic endings where the monster killed me while I was standing on the deck of the Titanic.
Happy typing!

Credits

The icon I used for my project is linkware, so by linking to the author’s requested page at https://malagatravelguide.net/, I can use the icon.

References

Weblinks

  1. gitlab: beyond-the-titanic/History/History.txt
  2. Original release of source ftp://ftp.3drealms.com/freeware/tit_free.zip
  3. Gamespot walkthrough for Beyond the Titanic
  4. rpm and dpkg specs on my gitlab

run “pip install” behind proxy

Even when you trust the MITM proxy devices’ self-signed certificates, pip can still fail.

# cat ~/.config/pip/pip.conf
[global]
cert = /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt

Even with telling the server names to be explicitly trusted.

# pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org google-auth
Collecting google-auth
  HTTP error 403 while getting https://files.pythonhosted.org/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl#sha256=20705f6803fd2c4d1cc2dcb0df09d4dfcb9a7d51fd59e94a3a28231fd93119ed (from https://pypi.org/simple/google-auth/)
  Could not install requirement google-auth from https://files.pythonhosted.org/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl#sha256=20705f6803fd2c4d1cc2dcb0df09d4dfcb9a7d51fd59e94a3a28231fd93119ed because of error 403 Client Error: Forbidden for url: https://files.pythonhosted.org/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl
Could not install requirement google-auth from https://files.pythonhosted.org/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl#sha256=20705f6803fd2c4d1cc2dcb0df09d4dfcb9a7d51fd59e94a3a28231fd93119ed because of HTTP error 403 Client Error: Forbidden for url: https://files.pythonhosted.org/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl for URL https://files.pythonhosted.org/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl#sha256=20705f6803fd2c4d1cc2dcb0df09d4dfcb9a7d51fd59e94a3a28231fd93119ed (from https://pypi.org/simple/google-auth/)

Solution

I had to use a squid proxy to make it happen.

# export https_proxy=http://10.123.456.5:3128
# pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org google-auth
Collecting google-auth
  Downloading https://files.pythonhosted.org/packages/c5/9b/ed0516cc1f7609fb0217e3057ff4f0f9f3e3ce79a369c6af4a6c5ca25664/google_auth-1.6.3-py2.py3-none-any.whl (73kB)
    100% |████████████████████████████████| 81kB 3.0MB/s
Collecting pyasn1-modules>=0.2.1 (from google-auth)
  Downloading https://files.pythonhosted.org/packages/da/98/8ddd9fa4d84065926832bcf2255a2b69f1d03330aa4d1c49cc7317ac888e/pyasn1_modules-0.2.4-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 5.4MB/s
Collecting cachetools>=2.0.0 (from google-auth)
  Downloading https://files.pythonhosted.org/packages/39/2b/d87fc2369242bd743883232c463f28205902b8579cb68dcf5b11eee1652f/cachetools-3.1.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in /usr/lib/python2.7/site-packages (from google-auth)
Collecting rsa>=3.1.4 (from google-auth)
  Downloading https://files.pythonhosted.org/packages/02/e5/38518af393f7c214357079ce67a317307936896e961e35450b70fad2a9cf/rsa-4.0-py2.py3-none-any.whl
Collecting pyasn1<0.5.0,>=0.4.1 (from pyasn1-modules>=0.2.1->google-auth)
  Downloading https://files.pythonhosted.org/packages/7b/7c/c9386b82a25115cccf1903441bba3cbadcfae7b678a20167347fa8ded34c/pyasn1-0.4.5-py2.py3-none-any.whl (73kB)
    100% |████████████████████████████████| 81kB 37.5MB/s
Installing collected packages: pyasn1, pyasn1-modules, cachetools, rsa, google-auth
  Found existing installation: pyasn1 0.1.9
    Uninstalling pyasn1-0.1.9:
      Successfully uninstalled pyasn1-0.1.9
  Found existing installation: pyasn1-modules 0.0.8
    Uninstalling pyasn1-modules-0.0.8:
      Successfully uninstalled pyasn1-modules-0.0.8
Successfully installed cachetools-3.1.0 google-auth-1.6.3 pyasn1-0.4.5 pyasn1-modules-0.2.4 rsa-4.0

Install PowerShell and PowerCLI on CentOS 7 Linux

I never thought I’d be doing this, but here’s how to install PowerShell (yes, that Powershell) on our beloved GNU/Linux. I need it because I want to automate some VMware tasks and PowerCLI is available for Linux through powershell.

curl https://packages.microsoft.com/config/rhel/7/prod.repo -o- | sudo tee /etc/yum.repos.d/microsoft.repo
sudo yum install -y powershell

Now powershell is installed, on GNU/Linux! Let’s contain our horror and keep moving forward. Open powershell and install the PowerCLI components.

pwsh
Set-PSRepository -Name "PSGallery" -InstallationPolicy "Trusted"
Find-Module "VMware.PowerCLI" | Install-Module -Scope "CurrentUser" -AllowClobber
Import-Module "VMware.PowerCLI"

List what is available now with

Get-Module "VMware.*" -ListAvailable | FT -Autosize

And most VMware instances I’ve seen don’t have pristine ssl certs, so you might want to run:

Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore

Maintenance tasks include updating the PowerCLI modules.

Update-Module "VMware.PowerCLI"

References

Weblinks

  1. Shamelessly ripped from Install PowerShell and VMware PowerCLI on CentOS | iThinkVirtual
  2. Zsoldier’s Tech Blog: PowerCLI: The SSL connection could not be established, see inner exception.

Fix vlc ui scaling problems

Vlc disable hidpi scaling

tl;dr

Set the environment variables:

export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCREEN_SCALE_FACTORS=1

The story

I am testing Fluxbox on Devuan on a physical system (instead of just a VM) with two monitors. I discovered that on one monitor, the ui for vlc is scaled way wrong.
For my left monitor, the buttons are way larger than they should be.
VLC with large buttons and normal menus
And on the other monitor, the buttons were normal-sized, but the menus and other text widgets were way too small.
VLC with normal buttons and tiny menus
When I set the environment variables as described above, vlc appears in the correct scaling. At one point, I had some OS or DE installed that showed that my system viewed the left monitor (HDMI-connected) as a 7″ screen with 1920×1080 resolution, which is why the scaling on the left side was messed up.
VLC with normal buttons and menus
Not only did I add those variable exports to my ~/.fluxbox/startup file, I also wrote a wrapper for vlc as /usr/local/bin/vlc

#!/bin/sh
QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCREEN_SCALE_FACTORS=1 /usr/bin/vlc

I was not aware that VLC was a QT program. But, after setting some environment variables,

References

Weblinks

  1. How to Enable hiDPI Scaling? – The VideoLAN Forums

Internet searches

  1. vlc disable hidpi scaling

Read Chrome and Firefox history from command line

Chrome

Shamelessly ripped from How do I access Chrome’s history (saved browsing history) file as a readable format without using third-party applications or extensions? – Quora

You will need a sqlite3 binary, probably from the package sqlite, to read the Chrome history file.

Chrome history in Linux is normally stored as file ~/.config/google-chrome/Default/History.

sqlite3 ~/.config/google-chrome/Default/History "select datetime(last_visit_time/1000000-11644473600,'unixepoch'),url from  urls order by last_visit_time asc" > output.txt

Firefox, Palemoon, Waterfox

This one’s in UTC.
Find the relevant history sqlite file.
For palemoon, it is similar to:

~/".moonchild productions/pale moon/1234abdf.default/places.sqlite"
sqlite3 ~/".moonchild productions/pale moon/1234abdf.default/places.sqlite" "select datetime(h.visit_date/1000000,'unixepoch'),p.url from moz_historyvisits as h, moz_places as p where p.id == h.place_id order by h.visit_date asc;"

Ssh use 7z with password and suppress password echo

If you want to use 7z with a password, over ssh, by default the password will be displayed!

Suppress it with ssh -t. I don’t know why. Here’s the relevant section of the man page for ssh.

     -t      Force pseudo-terminal allocation.  This can be used to execute arbitrary screen-based programs on a remote machine, which
             can be very useful, e.g. when implementing menu services.  Multiple -t options force tty allocation, even if ssh has no
             local tty.