Thursday, December 17, 2020

Raspberry Pi Wireless Wi-Fi TOR Anonymizer Gateway (Yet Another Post)

Tor-logo-2011-flat.svg

Many tutorials are floating around with instructions to make a raspberry pi into a wifi wireless access point that will direct all client traffic through the onion ring anonymizer network, for example here and here. They all seem to be various versions of some initial document somewhere, and none actually clearly call out everything that is needed.

The pi this runs on has an internet connection via copper from physical LAN port to ISP router. Also, I use ufw as the pi's firewall and so ufw rules are included below.

So here are my working configuration files, including those for the tor, hostapd, dnsmasq and ufw daemons. This pi reports kernel 4.19.60 and /etc/issue says "Raspbian GNU/Linux 10".


/etc/network/interfaces.d/wlan0

I prefer to keep /etc/network/interfaces empty and have individual files for network adapters in /etc/network/interfaces.d. Here is /etc/network/interfaces.d/wlan0:

allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.5.1
    netmask 255.255.255.0
    network 192.168.5.0
    broadcast 192.168.5.255

Note: a couple of online tutorials I saw forgot to mention that the wlan0 IP network has to match the IPs that dnsmasq DHCP server and tor transport and DNS server addresses bind to, as you will see below in torrc.


/etc/hostapd/hostapd.conf

Adjust ssid and password to your preference.

interface=wlan0
ssid=ONION
hw_mode=g
channel=11
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=SOMEPASSWORDHERE
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP


/etc/dnsmasq.conf

no-resolv
interface=wlan0
dhcp-range=192.168.5.100,192.168.5.199,255.255.255.0,6h
# Cloudflare free dns
server=1.1.1.1


/etc/tor/torrc

Log notice syslog
VirtualAddrNetwork 10.192.0.0/10
AutomapHostsSuffixes .onion,.exit
AutomapHostsOnResolve 1
TransPort 192.168.5.1:59040
DNSPort 192.168.5.1:53


/etc/ufw/before.rules

You need to already have IP forwarding enabled in the kernel (check /etc/sysctl.conf and set net.ipv4.ip_forward=1), and add the following nat rules for all DNS and TCP traffic on wlan0 to be passed through tor. This makes any wireless clients connecting to your wifi access point use tor for traffic.

This is my entire before.rules file, including other unrelated stuff. You only need the tor-related nat table rules at the top to drop into the existing before.rules installed with ufw. (Unrelated, but this specific pi also happens to host a simh VAX that acts as the DECnet router for my real MicroVAX 3100-80, nodename MARIAH.)

#
# rules.before
#
# Rules that should be run before the ufw command line added rules. Custom
# rules should be added to one of these chains:
#   ufw-before-input
#   ufw-before-output
#   ufw-before-forward
#

# **********
# NAT table rules
# **********
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]

# ---
# Flush the table first, otherwise UFW keeps adding the rules if reloaded
# ---
-F

# ---
# Incoming connections port forwardings
# ---
# TELNET to MARIAH with rate limiting
-A PREROUTING -i br-ip -p tcp --dport 23 -j DNAT --to-destination 10.3.100.80 -m limit --limit 1/minute --limit-burst 1

# TOR | All DNS traffic from wlan0 to TOR (see /etc/tor/torrc)
-A PREROUTING -i wlan0 -p udp --dport 53 -j REDIRECT --to-ports 53
# TOR | All TCP traffic from wlan0 to TOR (see /etc/tor/torrc)
-A PREROUTING -i wlan0 -p tcp --syn -j REDIRECT --to-ports 59040

# ---
# Forward outgoing traffic from MARIAH through br-ip to the internet
# ---
-A POSTROUTING -o br-ip -j MASQUERADE

# don't delete the 'COMMIT' line or these nat table rules won't
# be processed
COMMIT

# **********
# End NAT table rules
# **********

# Don't delete these required lines, otherwise there will be errors
*filter
:ufw-before-input - [0:0]
:ufw-before-output - [0:0]
:ufw-before-forward - [0:0]
:ufw-not-local - [0:0]
# End required lines


# allow all on loopback
-A ufw-before-input -i lo -j ACCEPT
-A ufw-before-output -o lo -j ACCEPT

# quickly process packets for which we already have a connection
-A ufw-before-input -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-output -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-forward -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

# drop INVALID packets (logs these in loglevel medium and higher)
-A ufw-before-input -m conntrack --ctstate INVALID -j ufw-logging-deny
-A ufw-before-input -m conntrack --ctstate INVALID -j DROP

# ok icmp codes for INPUT
-A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT
-A ufw-before-input -p icmp --icmp-type time-exceeded -j ACCEPT
-A ufw-before-input -p icmp --icmp-type parameter-problem -j ACCEPT
-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT

# ok icmp code for FORWARD
-A ufw-before-forward -p icmp --icmp-type destination-unreachable -j ACCEPT
-A ufw-before-forward -p icmp --icmp-type time-exceeded -j ACCEPT
-A ufw-before-forward -p icmp --icmp-type parameter-problem -j ACCEPT
-A ufw-before-forward -p icmp --icmp-type echo-request -j ACCEPT

# allow dhcp client to work
-A ufw-before-input -p udp --sport 67 --dport 68 -j ACCEPT

#
# ufw-not-local
#
-A ufw-before-input -j ufw-not-local

# if LOCAL, RETURN
-A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN

# if MULTICAST, RETURN
-A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN

# if BROADCAST, RETURN
-A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN

# all other non-local packets are dropped
-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny
-A ufw-not-local -j DROP

# allow MULTICAST mDNS for service discovery (be sure the MULTICAST line above
# is uncommented)
-A ufw-before-input -p udp -d 224.0.0.251 --dport 5353 -j ACCEPT

# allow MULTICAST UPnP for service discovery (be sure the MULTICAST line above
# is uncommented)
-A ufw-before-input -p udp -d 239.255.255.250 --dport 1900 -j ACCEPT

# don't delete the 'COMMIT' line or these rules won't be processed
COMMIT


UFW Rules

And finally, add UFW firewall rules to allow DNS and tor transport traffic from the command line:

# ufw allow in on wlan0 to any port 53 proto udp comment "dns for wireless clients"

# ufw allow in on wlan0 to any port 59040 proto tcp comment "tor transport for wireless clients"


That's it. Restart all affected daemons, including ufw (disable and enable it), connect a computer to the wireless hotspot and visit a website that will report the IP address it sees the browser request coming from (e.g. https://whoer.net/). Apparently I am currently accessing the internet from a tor exit point somewhere in Austria.



Friday, December 4, 2020

PCVMS - taking the aspirational DOS based VMS inspired multitasking environment for a spin

Wendin Multiuser PCVMS

According to a smattering of information on the internet, there was once a computer software company called Wendin based in Cheney, WA. They launched a product called PCVMS "Personal Operating System" in 1985. It was distributed on a set of three 5.25" 360KB floppy diskettes. More history and juicy bits are in Bill's 2009 post in his "Personally Interesting Stuff" blog. I also found a public profile of Steve Jones at Linkedin, "Steve launched Wendin's Computer Systems Division in 1984, developing the XTC text editor, the PCVMS operating system ("a VAX/VMS operating system clone that ran on IBM PC/ATs), the PCUNIX (later called PCNX) operating system (a Unix clone that ran on IBM PC/ATs), Operating System Toolbox (an operating system toolkit that enabled software developers to create their own operating systems), and Wendin-DOS (an MS-DOS clone with OS/2-like screen groups and multitasking), among other products." The March 1997 issue of IEEE Software "New Product Reviews" contains a quick review of PCVMS written by Randy Kaplan of Temple University:

R. Eckhouse, "New Product Reviews" in IEEE Software, vol. 4, no. 02, pp. 79-84, 1987. doi: 10.1109/MS.1987.230374 keywords: {null} url: https://doi.ieeecomputersociety.org/10.1109/MS.1987.230374
R. Eckhouse, "New Product Reviews" in IEEE Software, vol. 4, no. 02, pp. 79-84, 1987.
doi: 10.1109/MS.1987.230374
keywords: {null}
url: https://doi.ieeecomputersociety.org/10.1109/MS.1987.230374

A trademark was apparently refused for "PCVMS" in 1986. It was described in the trademark application in 1985 as "MAIL ORDER COMPUTER PROGRAMS USED BY OWNERS OF PERSONAL COMPUTERS IN PERSONAL COMPUTERS AS OPERATING SYSTEMS PROGRAMS FOR THE GENERAL OPERATION OF SUCH PERSONAL COMPUTERS". In any case, a"VAX/VMS operating system clone that ran on IBM PC/ATs" is intriguing. Responses to my quick questions at the HECnet mailing list and comp.os.vms NNTP group indicate folks already played with PCVMS decades ago. However, the universal opinion seems to be PCVMS should be approached with tempered expectations.

I fired up a 86BOX instance running Caldera DR-DOS 7.03 on a 80486SX 25MHz PC and installed PCVMS 1.08 following the instructions in the PCVMS README file. On launching PCVMS, it asks for a username and password. Username "root" with empty password presented a welcome message and a "$" command prompt. 

PCVMS operating system on DOS

There is VMS-like help, one of the installed files even being HELPLIB.HLB like in DEC VAX VMS systems. On the other hand, the PCVMS user authentication system is straight off Unix, relying on a "passwd" file under "etc" directory under the boot drive. The touch of Unix probably has something to do with "PCNX UNIX-like environment; not just UNIX-like tools, but multi-processing under MS-DOS" which provided at, cat, cmp, cp, cron, date, df, echo, false, file, find, finger, getty, grep, group, grppswd, head, kill, line, logname, lpd, lpr, ls, mail, mkdir, mkgroup, mkuser, more, mv, news, nice, nohup, od, passwd, pr, ps, rev, rm, rmdir, rmgroup, rmuser, sh, sleep, strings, stty, tail, tee, test, time, touch, true, tty, uniq, wc, who, whodo, write. 

By the way, I also briefly tried Wendin's "Wendin-DOS multitasking, multiuser MS-DOS replacement" which is publicly available, but it kept crashing with some sort of internal error in a rectangular box occupying the top third of the screen. This is another operating system that is my queue of things to explore further.

But, at this point, it appears for using "multi-user" features of PCVMS we need some sort of multiple hardware terminal connections with each then becoming a session. Something to be tried if and when I come back to this. A manual would be nice, but so far I have none.

Thursday, December 3, 2020

Command Line Torrent Client and Gopher Server on Raspberry Pi

One Raspberry Pi in my home lab has a 1TB USB external hard disk drive connected to it. I wanted to share some retrocomputing hobbyist-related stuff publicly in gopherspace. I also wanted a command-line torrent client to download retro public-domain stuff from archive.org and other places.  Here are the pieces I ended up using.

GOPHER

I set up a gopher server on the Pi and opened up and forwarded TCP/IP Port 70 to it. I am able to reach the gopher server using a standard web-browser from the public internet using Floodgap Gopher-HTTP Gateway. Currently it has some ancient ZX Spectrum home microcomputer stuff. It is connection-rate limited using UFW, so slow down while visiting it to not be refused!

Gopher HTTP Proxy
Floodgap also runs a great Veronica-2 Gopherspace Search engine.

Here are the steps for quickly getting into Gopherspace:

Gopher server

pygopherd: PyGopherd is a modern Internet Gopher server written in Python and is maintained by John Goerzen. In addition to support for RFC 1436 Gopher and Gopher+, PyGopherd also supports HTTP and WAP (Wikipedia).

Gopher client (browser) - Text/Terminal

Lynx Gopher Client Browser

Good old Lynx terminal web client continues to support Gopher. It is available from standard package repositories for virtually every operating system in use.

Gopher Client (Browser) - Windows, Mac OS X

Little Gopher Client for MacOS X

Little Gopher Client - works great, available for MacOS X, Linux and Windows.


Command-line bittorrent client

rtorrent works fine!

Thursday, November 26, 2020

BBC WORLD SERVICE: STREAMING THE NEWS CHANNEL I GREW UP WITH

BBC News.svg
By BBC News, Public Domain, Link




For as far back as I can remember, my father would come back from work in the evening, shower and grab a cup of tea and fire up a shortwave radio to tune into BBC World Service.

It is not as if I actively focused on Dad's radio. I went about whatever it was I did in those evening, with the voices from the radio floating around in the background.

As I grew older and left my parent's nest, it became apparent that pieces of that background voice noise had gotten embedded in my mind, without me being aware of it. Obviously, it got to a point where I had to find a way to tune into BBC World Service.

In the pandemic and politician stressed year 2020, BBC World News has done for me what no other audio or visual medium has done - calm me down. So, here are some ways to tune into BBC World News.

BBC World Service live official international audio internet stream URL: https://www.bbc.co.uk/sounds/play/live:bbc_world_service

Many more links to various BBC radio streams collected by Giles Booth: http://www.suppertime.co.uk/blogmywiki/2015/04/updated-list-of-bbc-network-radio-urls


Monday, November 9, 2020

Presidential Election 2020 Biden-Harris Victory over Trump-Pence: Anandabazar Patrika Coverage

I sent in three reports over the 2020 United States presidential elections to Anandabazar Patrika (sometimes abbreviated to ABP), the Bengali (bangla) language daily newspaper with the highest print and online circulation published from Kolkata, India. All three reports were published on the front page at the top, on November 4, 5 and 9.

Incumbents Donald Trump and Mike Pence were convincingly defeated after their first term by Joe Biden and Kamala Harris. A sulky Trump continued to refuse to accept failure until ejection from the White House, blaming non-existent fraud in what is in reality a spectacularly executed democratic process. Unfortunately, but not unexpectedly, low-information emotional Trump voters continued to believe in the imaginary world created by conservative media talk show hosts. This way Donald Trump could keep on using the rage of the part of the American population that he could convince into the myth of his win in the election having been stolen over a collapse of the democratic system, despite there being no evidence of such a scenraio.

November 4, 2020

Supratim Sanyal Anandabazar Patrika ABP Donal Trump Joe Biden Kamala Harris Election 2020
Supratim Sanyal Anandabazar Patrika ABP Donal Trump Joe Biden Kamala Harris Election 2020

November 5, 2020

Supratim Sanyal Anandabazar Patrika ABP Donal Trump Joe Biden Kamala Harris Election 2020
Supratim Sanyal Anandabazar Patrika ABP Donal Trump Joe Biden Kamala Harris Election 2020

November 9, 2020

Supratim Sanyal Anandabazar Patrika ABP Donal Trump Joe Biden Kamala Harris Election 2020
Supratim Sanyal Anandabazar Patrika ABP Donal Trump Joe Biden Kamala Harris Election 2020


Monday, November 2, 2020

Remembering the dot-matrix printer: Epson LQ-2500 24-pin dot matrix emulation on 86BOX running Windows 95

 

Example of simulated printout from Epson LQ-2500 24-pin impact dot-matrix printer

I was thinking about the venerable dot matrix printers I grew up with. In an era WordPerfect for DOS ruled supreme, Panasonic, Epson and other printer manufacturers competed furiously, going from 9 pins in the print head to 24 and even to 48. Impact dot-matrix printing technology improved in leaps and bounds, eventually featuring "near letter quality" (NLQ) modes approaching laser printers. Epson's ESC/P standard was immensely popular, allowing software to select from various fonts and styles, even bitmap graphics and barcodes, built right into printers or optional cartridges. Those were great times for novice programmers to fool around with little filters in C to set the styles and pipe input to the printer. I could print AUTOEXEC.BAT in superscripted bolded italics by piping the DOS TYPE command through my filters written in Borland Turbo C, eventually out through LPT1! (The purpose of doing so eludes me now after a quarter century later from Windows 95.)

It recently occurred to me to look for emulators for those classic dot-matrix printers. However, it turned out to be a bit more difficult than I expected. Other than a commercial product called PRTWIN ("Epson matrix printer emulator under Windows") there was little out there on the internet for an emulator that would, for example, create a virtual parallel port (LPT1) for other programs to send print jobs to. I posted a question at - of all places - the QEMU mailing list, and was excited to hear from Will Senn about an emulator called 86BOX that includes the option of connecting an emulated ESC/P capable virtual printer to the LPT1 port of an emulated PC compatible machine.

86BOX - Windows 95 Printer Test Page on emulated Epson LQ-2500 dot-matrix printer

Turns out 86BOX is a fascinating PC emulator that I had not played with before. It emulates a numerous variety of PC architectures comprehensively and precisely at the motherboard and add-on card levels including BIOS and firmware. Of particular importance: among the hardware emulated by 86BOX is a generic Epson ESC/P standard printer that can be attached virtually to LPT1: parallel port!

Back in the day, my setup (actually my Dad's setup) was a Windows 95 PC with a Panasonic dot-matrix printer. I thus have a special bond with Windows 95, but getting Windows 95 to work on 86BOX with a functional LPT1: port proved to be a bit challenging. In the beginning, I could readily install Windows 95 OSR 2.5 on numerous motherboard, processor and peripheral combinations on 86BOX, but ended up every time with a dysfunctional parallel port (yellow exclamation in device manager) or no LPT1: port at all. Turns out the problem was, as usual, resource conflict with the sound card, and I had forgotten to allocate the sound card and parallel port IRQs specifically to the ISA bus instead of the default PCI (more details are below).

I nailed it eventually and now have a fully functional 86BOX PC with multimedia sound, networking and EPSON LQ-2500 dot-matrix printer. (This specific printer model is recommended for use with the ESC/P emulator built into 86BOX.)

The printer emulation works great including from WordPerfect Office 2000 and Microsoft Office 95. The LQ-2500 dot-matrix printer emulator happily generates PNG image files for printed pages in a "printer" subdirectory.

Printing from Microsoft Word 95  (Windows 95) to Simulated Epson LQ-2500 Dot Matrix Printer

Printing from WordPerfect 9 (Windows 95) to Simulated Epson LQ-2500 Dot Matrix Printer

Feeling more adventurous, I set up the 86BOX Windows 95 instance with pcap networking and shared the virtual printer on the network. Windows 95 successfully obtains an IP address from my router and connects to the internet. I can even see the Windows 95 shared LQ-2500 printer from other Windows 10 PCs on the network, but attempts to connect to it from Windows 10 have failed so far. Windows 10, unfortunately, throws up some hex error codes that I will have to do more research on (TBD). An initial web search seems to indicate NTLM version mismatch. Anyway, my working configuration of 86BOX running Windows 95 OSR 2.5 with simulated dot-matrix printing is:

  • Machine Type: Socket 7-3V
  • Machine: [i430FX] ASUS P/I-P54TP4XE
  • CPU: Pentium OverDrive MMX 75
  • Memory: 128 MB
  • Video: [PCI] Diamond Stealth 64 VRAM (S3 Vision964)
  • Mouse: Standard PS/2 Mouse
  • Sound card: [ISA] Sound Blaster AWE32 (IRQ 5 has to be manually allocated to ISA in BIOS)
  • MIDI Out Device: System MIDI
  • Network adapter: [PCI] AMD PCnet-PCI II
  • LPT1 Device: Generic ESC/P Dot-Matrix (IRQ 7 has to be manually allocated to ISA in BIOS)
  • Hard disk: 1GB (2078 cylinders, 16 heads, 63 sectors = 1022 MB) on IDE Primary Master (Channel 0:0)
  • 32x ATAPI CD-ROM on IDE Secondary Master (Channel 1:0)
  • 3.5" 1.44 MB Floppy drive A:
  • 5.25 1.2 MB Floppy drive B:

Here is the corresponding 86BOX configuration file:


As was usual for the Windows 95 era, I did go through the BIOS screens and fixed everything up to reflect the hardware. Once again, of special importance is the assignment of the IRQs used by the sound card and parallel port to ISA instead of PCI. Here are the BIOS screens:






While at it, of course I could not resist having some fun, while appreciating how remarkably close 86BOX comes to the "real" Windows 95 PC gaming experience.

Johnny Castaway Screensaver (Sierra, 1992)

Fury 3 on Windows 95

Monster Truck Madness on Windows 95


Sid Meier's Civilization II

Download:

If you wish, you can grab my entire Windows 95 86BOX virtual machine here.



Monday, October 19, 2020

Pandemic and Venus: March 2020

On March 5, 2020, an emergency was declared in my state of Maryland after COVID-19 was confirmed to have arrived with two people testing positive. By March 12, all schools and University of Maryland campuses had moved to continuing online after spring break. Emergency was escalated with the invocation of Maryland National Guard.  By March 30, the number of cases had reached over 1000 and our governor issued a mandatory stay-at-home order. On the same day, Virginia and Washington DC also went into "lock-down" - a phrase that would eventually cease to surprise but which was terrifying when I first heard it.

Mid-April. Our bustling suburban city of 110,000 is a ghost town. Nothing moving in a deafening silence. A bit after dark. I step out and see a helicopter searchlight behind the trees. A pretty common sight - Medevac or police bird hovering, looking for something. I go back in thinking nothing of it.

Next night, around same time. The helicopter, searchlight on, still hovering at the exact same spot. Hmmm ... interesting, maybe the USAF is doing something at the nearby Andrews Air Force Base. Has happened before.

Night #3. Helicopter with light again. Beginnings of a doubt, but still shrugged it off.

Night #4 - Mental flags go up. A perfectly still helicopter at a geometrically precise location night after night at the same hour on the clock?

I fire up the sky-chart app. The hazy skies of the capital region had cleared so much that for the first time in my 23 years living here, I was looking at the dazzling evening star - Venus. I ran in and grabbed the kids. "Look at that - what do you think that is?"


HP T5740 Thin Client Retrocomputing Experiment: MS DOS 6.22, Windows 1.0, 2.0, 3.0, 3.11 and XP

Supratim Sanyal's Blog: Inside of HP Thin Client T5740 Computer PC Atom N280 Windows XP SSD 2GB RS-232 VGA

"Thin clients" are interesting pieces of hardware. They are perfectly capable little computers in their own right. With decent processors and multitude of graphics and USB connectivity options, they easily match and out-perform full "fat" desktop PCs of Windows XP era. All but the purest of thin clients also come with some form of minimal storage allowing them to boot up locally instead of relying on booting over network.

I recently picked up a HP T5740 thin client. The little computer has an Intel Atom N280 1.66GHz processor, 1GB RAM and a 2GB IDE Flash disk. In addition to the external USB ports, there are two "secure" USB ports inside the case, to one of which I connected a 802.11n wi-fi wireless adapter for wireless network access for Windows XP.  



It came with Windows XP Embedded. I got rid of it, repartitioning the 2 GB IDE Flash disk into a primary 512 MB FAT-16 partition and the remaining 1.5 GB into an extended partition with a NTFS logical drive using all of it for Windows XP. After having a few days of great fun installing ancient operating systems and MS DOS executives, I ended up with MS DOS 6.22, Windows 1.01, Windows 2.03, Windows 3.0a, Windows for Workgroups 3.11 and Windows XP, all selectable from Windows XP and MS DOS boot loaders and boot menus. I also found and installed all the applications I could find for Windows 1.0 and 2.0, and even Microsoft Word for MS DOS, along with a few games for the various environments. Here is a video walkthrough:





Saturday, July 18, 2020

OpenVMS: Purge/Delete Expired Licenses and Clean Up LMF DB License Database

Supratim Sanyal's Blog: OpenVMS VAX License PAK


This is a thread from the comp.os.vms newsgroup. The archived conversation is at:


---

comp.os.vms ›
LICENSE PURGE ?
7 posts by 6 authors 

Peter LANGSTOEGER
3/14/01
Since the VMS hobbyist program is there (many thanks for that !!), I have
a bunch of licenses loaded which starts to terminate now. And I start to
feel tired of deleting yet another expired license...
Is there a LMF command to delete all expired licenses at once ?

--
Peter "EPLAN" LANGSTOEGER           Tel.    +43 1 81111-2651
Network and OpenVMS system manager  Fax.    +43 1 81111-888
<<< KAPSCH AG  Wagenseilgasse 1     E-mail  ep...@kapsch.net
A-1121 VIENNA  AUSTRIA              "I'm not a pessimist, I'm a realist"

Click here to Reply

Martin Vorlaender
3/14/01
Peter LANGSTOEGER (ep...@kapsch.net) wrote:
> Since the VMS hobbyist program is there (many thanks for that !!), I have
> a bunch of licenses loaded which starts to terminate now. And I start to
> feel tired of deleting yet another expired license...
>
> Is there a LMF command to delete all expired licenses at once ?
I solved (or circumvented) that problem by issuing a $ LICENSE CREATE
before executing the command procedures that register the new hobbyist
licenses. But then, the hobbyist licenses are the only ones on my system.

I guess one could write a quick perl script to look over OPERATOR.LOG
and issue appropriate $ LICENSE DELETE commands.

cu,
  Martin
--
One OS to rule them all       | Martin Vorlaender  |  VMS & WNT programmer
One OS to find them           | work: m...@pdv-systeme.de
One OS to bring them all      |   http://www.pdv-systeme.de/users/martinv/
And in the Darkness bind them.| home: mar...@radiogaga.harz.de


Hunter Goatley
3/14/01
On 15 Mar 2001 00:45:53 +0100, ep...@kapsch.net (Peter LANGSTOEGER) wrote:
>Since the VMS hobbyist program is there (many thanks for that !!), I have
>a bunch of licenses loaded which starts to terminate now. And I start to
>feel tired of deleting yet another expired license...
>
>Is there a LMF command to delete all expired licenses at once ?
>
$ delete sys$system:lmf$license.ldb;*
A bit drastic, but it works.

$ LICENSE DELETE *

also works, but, again, is a bit drastic.  Less drastic, and one
that will probably do exactly what you want (delete the hobbyist
licenses and leave any other intact):

$ LICENSE DELETE */AUTHORIZATION=DECUS-USA-*

or whatever common authorization string they have.

Or:

$ LICENSE DISABLE */AUTHOR=DECUS-USA-*
$ LICENSE DELETE */STATUS=DISABLED

Hunter
------
Hunter Goatley, Process Software, http://www.process.com/
goath...@goatley.com     http://www.goatley.com/hunter/


Robert Deininger
3/15/01
In article <3ab0...@news.kapsch.co.at>, ep...@kapsch.net wrote:
> Since the VMS hobbyist program is there (many thanks for that !!), I have
> a bunch of licenses loaded which starts to terminate now. And I start to
> feel tired of deleting yet another expired license...
>
> Is there a LMF command to delete all expired licenses at once ?
There's a LICENSE DELETE/STATUS=DISABLED
There's a LICENSE LIST/BEFORE/TERMINATION
Alas, there's no LICENSE DELETE/BEFORE/TERMINATION

I've made a command file that parses the output of
   LICENSE LIST/FULL/BEFORE/TERM,
generates a bunch of LICENSE DISABLE commands, and does
   LICENSE DELETE/STATUS=DISABLED.

This will get rid of terminated licenses and leave the others intact.

I can email or post the command file if there's interest.

--
Robert Deininger
rdein...@mindspring.com


Robert Deininger
3/15/01
In article
<rdeininger-15...@user-2ivec5u.dialup.mindspring.com>,
rdein...@mindspring.com (Robert Deininger) wrote:

> I can email or post the command file if there's interest.

I've gotten a couple of requests, so I'll just post the following
use-at-your-own-risk DCL.

There are two files below.

JRDDCL.COM is pretty much stolen from Hoff's book; I've only typed in what
I've needed so far, so it isn't the whole library.  The main utility
depends on these routines.  You'll have to decide where to keep the
library on your system. The second routine defines a symbol to locate the
library; you'll want to adjust that definition.  You can also change all
occurances of "jrd" to your own initials if you want.

DISABLE_TERMINATED_LICENSES.COM is the utility that disables all the
terminated license PAKs.  It leave the LICENSE DELETE for you to do by
hand.  Since I'm parsing text output from LICENSE LIST, it may go wrong if
the format changes, or if you have PAKs that don't follow the pattern I
expect.  I STRONGLY suggest you accept the default options to make a copy
of the license file before changing it, and to view the generated command
file before it runs.  This has been tested on CSLG licences.  It's
supposed to work with hobbyist PAKs as well, but I haven't tested since
mine haven't expired yet.

This would be moot if the LICENSE folks would add the qualifiers that LIST
knows to other commands like DISABLE and DELETE.

Here's the stuff.  You may have to de-wrap a few lines.


JRDDCL.COM:

$!   DCL subroutine library
$!      Modelled after the example in "Writing Real Programs in DCL, 2nd
$!      Edition."
$
$  jrddcl__status = %x10000000
$  jrddcl__success = jrddcl__status + %x0001
$  on control_y then exit jrddcl__status + %x0004
$  on warning then exit $status .or. %x10000000
$
$  display = "write sys$output"
$  goto 'p1'
$
$! Title:   Ask a Question
$
$! Synopsis:   This subroutine asks the user a question and returns
$!    the answer.  The prompt for the question is composed
$!    of a query string and optionally a default answer.
$
$! Parameters: P2: A global symbol to receive the answer.
$!    P3: The data type of the answer.  B for boolean
$!        (yes,no); I for integer; S for string.
$!    P4: The query string for the question.  It must end
$!        with a punctuation character and no space.
$!    P5: The default answer (optional; if not specified
$!        then an answer must be entered).
$!    P6: A comma-separated list of options:
$!       H: Display help before asking question.
$!       S: Skip a line before asking question.
$!       U: Upcase the input string.
$!       Z: Allow Ctrl/Z as an nswer.
$!    P7: The help specifier (optional).  It must be in
$!        in the form "procedure [parameter...]".  The
$!        procedure is invoked with the @-sign command.
$
$ASK:
$
$  signal = "@" + f$environment("PROCEDURE") + " signal ask"
$  if p3 .eqs. "B" .and. p5 .nes. "" .and. f$type(p5) .eqs. "INTEGER"
$       then
$     p5 = f$element(p5,"/","NO/YES")
$  endif
$  if p5 .nes. ""
$  then
$     p4 = f$extract(0,f$len(p4)-1,p4) + -
           " [" + p5 + "]" + f$extract(f$len(p4)-1,1,p4)
$  endif
$  if f$locate("S",p6) .ne. f$length(p6) then display ""
$  if f$locate("H",p6) .ne. f$length(p6) then @'p7'
$
$a10: read sys$command/prompt="''p4' " input/end_of_file=a_eof
$  if input .eqs. "" then input = p5
$  input = f$edit(input,"TRIM")  
$  if input .eqs. ""
$  then
$     signal w inputreq "Please enter a value; there is no default."
$  else if input .eqs. "?"
$  then
$     if p7 .nes. "" then @'p7'
$     if p7 .eqs. "" then display "There is no help for this question."
$  else
$     goto a_'p3'
$a_B:    input = f$edit(input,"UPCASE")
$     if f$locate(input,"YES") .eq. 0 .or. -
         f$locate(input,"NO") .eq. 0
$     then
$        input = input .and. 1
$        goto a19
$     else
$        signal w yesnoreq "Please answer YES or NO."
$     endif
$     goto a15
$
$a_I:    if f$type(input) .eqs. "INTEGER"
$     then
$        input = f$integer(input)
$        goto a19
$     else
$        signal w intreq "The input must be an integer."
$     endif
$     goto a15
$
$a_S:    if f$locate("U",p6) .ne. f$length(p6)
$     then
$        input = f$edit(input,"UPCASE")
$     endif
$     goto a19
$a15:
$  endif
$  endif
$  goto a10
$a_eof:
$  input = "^Z"
$  if f$locate("Z",p6) .ne. f$length(p6) then goto a19
$  signal i invctrlz "End-of-file is not a valid response."
$  goto a10
$a19:
$  'p2' == input
$  exit jrddcl__success
$
$! Title:   Signal an Informational or Error Message
$
$! Synopsis:   This subroutine "signals" a message, producing one
$!    or more message lines in the standard OpenVMS format.
$!    It also exits with a status whose severity matches
$!    that of the message.
$
$! Parameters: P2: The message facitlity code.
$!    P3: The message serverity (S, I, W, E, or F).
$!    P4: The message identification.
$!    P5: The message text.
$!    Pn: Optional message lines or status codes whose
$!        corresponding message lines are to me included.
$
$! Status:  The severity of the exit status is equal to the
$!    message severity, except in the case of warnings.
$!    If the message severity is W, and informational
$!    severity is included in the status so that the
$!    caller's error handler is not invoked.
$
$SIGNAL:
$
$  prefix = f$fao("%!AS-!AS-!AS, ",p2,p3,p4)
$  i = 4
$s10:    i = i + 1
$     if i .gt. 8 then goto s19
$     if p'i' .eqs. "" then goto s19
$     text = p'i'
$     if f$type(text) .eqs. "INTEGER"
$     then
$        text = f$message(text)
$     endif
$     if f$ext(0,1,text) .nes. "%" then text = prefix + text
$     if i .gt. 5 then text [0,1] := "-"
$     display text
$     goto s10
$s19:
$  if p3 .eqs. "W" then p3 = "I"
$  exit jrddcl__status + f$locate(p3,"WSEIF")
$


DISABLE_TERMINATED_LICENSES.COM:

$! Title:   Disable Terminated Licenses
$
$! Synopsis:   This command file disables all the terminated licenses
$!    in the active license database, which is defined by
$!    the current value of LMF$LICENSE.
$
$! Parameters: None
$
$! Author:  Robert Deininger
$! Created: January, 2001
$
$
$! Define some simple status codes.
$
$ lic__status  = %x10000000
$ lic__success = lic__status + %x0001
$ lic__ctrly   = lic__status + %x000C
$
$! Set up interrupt and error handlers.
$
$ status = lic__success
$ on control_y then goto control_y
$ on warning then goto error
$
$! Define some useful symbols.
$ say = "write sys$output"
$ jrdcall = "@jrddcl.com"     !!! <<<---- adjust this as needed
$
$! The real work starts here.
$
$ tempfile1 = "terminated.lis;"
$ tempfile2 = "disable_terminated.com;"
$
$ current_ldb = f$search(f$trnlnm("lmf$license"))
$
$ type sys$input

 Utility to DISABLE all the terminated licenses in the active
 license database...

 The active database is:
$ say "   ",current_ldb
$ type sys$input

 This utility makes many changes to the license database.  Do you
 want a backup copy of the database file saved before changes
 are made?
$10:
$ on warning then goto 10
$ jrdcall ask lic__answer b "Save a backup copy?" "YES" U,S
$ on warning then goto error
$
$ if lic__answer
$ then
$    current_ldb = current_ldb - f$parse(current_ldb,,,"version")
$    say ""
$    copy/log 'current_ldb' 'current_ldb'
$    current_ldb = f$search(f$trnlnm("lmf$license"))
$    say ""
$    say " The new highest version will be modified."
$ endif
$
$ say " Finding terminated licenses..."
$
$! Get a list of terminated licenses.
$ license list/before/terminated/full/output='tempfile1'
$
$ say " Making a command file to disable licenses..."
$
$! Open the input and output files.
$ open/read  tempfile1 'tempfile1'
$ open/write tempfile2 'tempfile2'
$
$ target_string = "-----------------------"
$main_loop:
$ gosub find_string
$ if input_string .nes. ""
$ then
$!   We have read the "header" line for a single license.
$!   Look for expected beginnings on the next 4 lines, and save the good
$!   parts.
$
$    get_string = "Issuer:"
$    gosub get_string
$    if result_string .nes. ""
$    then
$       issuer = result_string
$    else
$       goto main_loop
$    endif
$
$    get_string = "Authorization:"
$    gosub get_string
$    if result_string .nes. ""
$    then
$       authorization = result_string
$    else
$       goto main_loop
$    endif
$
$    get_string = "Product Name:"
$    gosub get_string
$    if result_string .nes. ""
$    then
$       product_name = result_string
$    else
$       goto main_loop
$    endif
$
$    get_string = "Producer:"
$    gosub get_string
$    if result_string .nes. ""
$    then
$       producer = result_string
$    else
$       goto main_loop
$    endif
$
$    ! We have the 4 important pieces of information we wanted.  Generate
$    ! a LICENSE DISABLE command.
$    gosub write_command
$
$    goto main_loop
$ endif
$
$! We have processed the whole input file.
$ close tempfile1
$ write tempfile2 "$ exit"
$ close tempfile2
$
$20:
$ on warning then goto 20
$ jrdcall ask lic__answer b "Do you want to view the command file?" -
             "YES" U,S
$ on warning then goto error
$
$ if lic__answer
$ then
$    type/page 'tempfile2'
$ endif
$
$30:
$ on warning then goto 30
$ jrdcall ask lic__answer b -
     "Do you want to exectute these commands to modify the license database?" -
     "" U,S
$ on warning then goto error
$
$ if lic__answer
$ then
$    @'tempfile2'
     type sys$input

 Disabling is complete.

 You may want to execute
   $ LICENSE DELETE */STATUS=DISABLED/LOG
 to completely remove all disabled licenses from the database.
$
$ else
$    say ""
$    say " Modifications cancelled."
$ endif
$
$ goto cleanup
$
$CONTROL_Y:
$ status = lic__ctrly
$ goto cleanup
$
$ERROR:
$ status = $status
$ goto cleanup
$
$CLEANUP:
$ if f$search(tempfile1) .nes. "" then delete/nolog/noconfirm 'tempfile1'*
$ if f$search(tempfile2) .nes. "" then delete/nolog/noconfirm 'tempfile2'*
$
$ if f$type(lic__answer) .nes. "" then delete/symbol/global/nolog lic__answer
$
$ exit status .or. %x10000000
$
$FIND_STRING:
$! This subroutine reads lines from tempfile1 until it obtains a line that
$! begins with target_string.  It returns with input_string equal to the
$! entire input line, or the null string if the end of the file was reached
$! without finding the target.
$
$find_loop:
$ read/end_of_file=end_of_file tempfile1 input_string
$ if f$locate(target_string,input_string) .eq. 0
$ then
$    ! The current string begins with the target.
$    return ! (FIND_STRING)
$ else
$    goto find_loop
$ endif
$
$end_of_file:
$ input_string = ""
$ return ! (FIND_STRING)
$
$GET_STRING:
$! This subroutine reads a line from tempfile1, checks that it starts
$! with get_string, and returns in result_string the last part of the string.
$! The "last part" is the second element delimited by " ", after the part
$! matching get_string is removed.
$
$ read tempfile1 input_string
$ if f$locate(get_string,input_string) .eq. 0
$ then
$    ! The current string begins with the target.
$    temp = f$edit((input_string - get_string),"compress")
$    result_string = f$element(1," ",temp)
$
$ else
$    say "Unexpected line.  Expected ''get_string', found:"
$    say line
$    say ""
$
$    result_string = ""
$ endif
$
$ return ! (GET_STRING)
$
$WRITE_COMMAND:
$! This subroutine writes a single "license disable" command to tempfile2,
$! using the information in symbols PRODUCT_NAME, AUTHORIZATION, ISSUER,
$! and PRODUCER.
$
$ write tempfile2 "$ license disable/log ''product_name' -"
$ write tempfile2 "    /authorization=''authorization' -"
$ write tempfile2 "    /issuer=''issuer' -"
$ write tempfile2 "    /producer=''producer'"
$ write tempfile2 "$"
$
$ return ! (WRITE_COMMAND)


Jim Agnew
3/20/01
I followed Mr. Robert Deininger's
kindly given com files, and when I tried to do the license delete/disabled * step, (or however it's spelled), lmf whined about being
greater than a 64K command..  I had about oh, 3,000 old licenses clogging up my db.  we simply edited the disable_licenses.com file
into a delete_licenses.com, and nuked them.

my license db did NOT shrink...  should I copy them over to a new file to reduce the file size, or just leave it.  

many thanks, my console is no longer incessantly beeping...

j.

- show quoted text -

Hoff Hoffman
3/20/01
In article <3AB7C29...@hsc.vcu.edu>, Jim Agnew <ag...@hsc.vcu.edu> writes:
:my license db did NOT shrink...  should I copy them over to a new file to
:reduce the file size, or just leave it.  
  The RMS indexed file storage allocation does not normally shrink without
  outside assistance.

  Having a larger-than-required indexed file containing deleted records
  is not (usually) of any particular consequence.  (Salient exceptions:
  severely oversized files when disk space is correspondingly severely
  constrained, large numbers of deleted records and other cruft built up
  within an indexed file when frequently accessed, etc.)

  You would need to CONVERT/RECLAIM or similar conversion, and not COPY,
  to remove the deleted records and to reorganize the internal structures
  of an RMS indexed file.

 ---------------------------- #include <rtfaq.h> -----------------------------
      For additional, please see the OpenVMS FAQ -- www.openvms.compaq.com    
 --------------------------- pure personal opinion ---------------------------
   Hoff (Stephen) Hoffman   OpenVMS Engineering   hoffman#xdelta.zko.dec.com

Saturday, July 4, 2020

Playing Audio Music (Big Ben Westminster Clock Chime) on Internal PC Speaker Connected to Motherboard Southbridge 8253 / 8254 PIT chip (Not Sound Card)

Supratim Sanyal's Blog: PC internal speaker buzzer beeper (beep speaker)
Motherboard with connected internal speaker

I have always built my own internet routers to serve as gateways to ISPs for my home and family. The last one - a Pentium-D based build - was getting challenged with 200 mbps uplinks to Verizon FiOS and Comcast xfinity. So I recently built a new router using a ASRock J4105B-ITX Mini ITX motherboard with Intel Gemini Lake Celeron J4105 quad-core processor,  8 GB of DDR4 SODIMM memory,  a four-port IBM Netxtreme gigabit ethernet adapter (removed for the picture above to show the piezo buzzer clearly),  a 120 GB SSD for storage and a InWin Mini-ITX case with power supply unit. The router works great, easily supporting two WAN gateways in failover / redundant mode and two gigabit private LAN subnets. The power requirements at just 10 watts TDP for the CPU and five more watts for the quad-port Netxtreme gigabit Ethernet adapter are a fraction of the Pentium-D build with 95 watts TDP just for the processor.

PC Motherboard Internal BIOS Alarm Speaker Buzzer - Piezo Beeper
PC internal Piezoelectric speaker »
Whenever I build a computer I make it a point to install a motherboard-connected speaker or a beeper. Unfortunately a lot of recent computer cases do not include this simple and cheap part, thus depriving builders of a basic tool for troubleshooting when the computer does not boot far enough to get to the BIOS screen. The mini-ITX case I bought for the router was also missing the speaker / buzzer, so I obtained and installed a piezo buzzer as you can see in the picture at the top of this post.

The ASRock motherboard has a header for the speaker (as do all motherboards I have come across, including ASUS and Dell motherboards over the last thirty years). Strangely, ASRock's BIOS had the internal speaker turned off by default. I turned it on manually, and was happy to hear the familiar single short beep at boot time: all systems go. Perhaps some people do not want their PCs to signal all is good when they boot or reboot their computer.

The router runs Ubuntu 20.04 LTS (Focal Fossa) operating system which serves as the virtualization hypervisor for a Sophos UTM 9 Home virtual machine that performs actual routing, firewall, IDS and IPS functions (the four physical ethernet ports on the Netxtreme are bridged into the virtual machine).

Of relevance to this post, Ubuntu provides a nifty PC Speaker device driver kernel module that allows command-line and shell script access to the internal speaker.  This module was was automatically included during installation, but was not being loaded by default during Focal Fossa boot. I added a simple "modprobe pcspkr" line in /etc/rc.local (and made it executable) to load it at boot-time. The driver provides access to the case speaker via a /dev/input/by-path/platform-pcspkr-event-spkr device which in my case is a link to "../event6".  It then becomes possible to write to it this device to play tones of specific frequencies and duration. Armed with a frequency lookup table for musical notes, entire tunes can then be played on the chassis / case speaker.  This method does not require writing to the processor's I/O ports that are connected to the Intel 8253 / 8254 Programmable Interval Timer (PIT) to which the case speaker is connected via an AND gate on Counter 2.

With the PC speaker kernel module loaded, we can use the convenient beep utility from beep package to play notes on the internal buzzer. "beep" needs to be invoked from the native root account (it does not work with sudo).

I wrote a cron-invoked bash shell script that plays the famous Westminster Chimes (Westminster Quarters) melody at each quarter, half, three-quarters and top of the hour.  The Westminster Chimes consists of four sequences of four notes each rendered by a bell in the bell tower. The first, second and third of the four sequences are played at fifteen minutes, thirty minutes and forty-five minutes past the hour.  All four sequences are played at the top of the hour, followed by all four bells ringing to count the hour.

Piezoelectric beepers are reported to work best at audio frequencies in the 1 to 5 KHz range. Mapping the Westminster Quarters notes to frequencies just around 1 KHz, here is the piezo buzzer playing at the top of the hour:



Here are root's crontab entries:

# Westminster chimes
0 * * * * /root/beep/westminster-pcspkr.sh -00 > /dev/null 2>&1
15 * * * * /root/beep/westminster-pcspkr.sh -15 > /dev/null 2>&1
30 * * * * /root/beep/westminster-pcspkr.sh -30 > /dev/null 2>&1
45 * * * * /root/beep/westminster-pcspkr.sh -45 > /dev/null 2>&1

and here is the shell script "/root/beep/westminster-pcspkr.sh":








Thursday, May 21, 2020

Associate Wireless Adapter with a Wifi Access Point without assigning an IP address (for use by a Virtual Machine)

I recently signed up for mobile service with a MVNO that uses Sprint's network. A free phone and unlimited data is included with the plan, along with unlimited tethering.

For my home internet setup, I already have a dual-WAN setup using Sophos UTM 9 running in a VirtualBox as the IDS/IPS load-balancing gateway. But still, given the unlimited data and tethering ability with the new cell phone plan, I wanted to add cellular broadband as a fall-back internet connection, mostly as an experiment but also as a useful backup internet uplink.

So I attached a USB wifi adapter to the Dell blade that hosts the Sophos UTM 9 gateway, looking to tether it to the cell phone hotspot only as far as wifi association takes place with no IP address, and connect the wifi-associated wireless lan adapter to the Sophos UTM 9 virtual machine which would then configure it with a DHCP address as another WAN uplink.

The alternative would have been to configure VirtualBox settings to connect the USB wifi adapter directly to the UTM 9 virtual machine. On researching this option, however, it appeared to be a daunting task to get Sophos UTM 9 to configure a wireless network adapter as an internet uplink.

Therefore I created the following bash shell script for the wifi USB dongle to associate with the mobile network. This script runs on the host blade. The UTM VM now has a new additional virtual adapter bridged to the wifi dongle. Everything works great.


#!/bin/bash
### wifi-wireless-usb-setup.sh
### REF: https://www.linux.com/training-tutorials/how-configure-wireless-any-linux-desktop/

DEVICE="wlx000f00bf03d7"

dhclient -r ${DEVICE}
ifconfig ${DEVICE} down
killall wpa_supplicant
rm -f /run/wpa_supplicant/${DEVICE}

ifconfig ${DEVICE} up
sleep 5

# wpa_supplicant.conf should have the output generated by "wpa_passphrase WIFI-SSID WIFI-PASSWORD"
wpa_supplicant -B -i ${DEVICE} -Dwext -s -c /etc/wpa_supplicant/wpa_supplicant.conf

iwlist ${DEVICE} scan

echo
echo "Connecting, please wait"

sleep 10

iwconfig ${DEVICE} rate 32M
iwconfig ${DEVICE}

echo "Check association with \"iwconfig ${DEVICE}\""
echo "Get IP address if needed with \"dhclient ${DEVICE}\""

sync;sync;sync
exit 0


"SIOCSIFFLAGS: Operation not possible due to RF-kill"

If you get the above error when you try to bring the wifi adapter up, the kernel has "soft blocked" your wireless adapter. To unblock it, do the following as root:

# rfkill list
1: phy1: Wireless LAN
Soft blocked: yes
Hard blocked: no

# rfkill unblock all

# rfkill list
1: phy1: Wireless LAN
Soft blocked: no
Hard blocked: no



Thursday, April 23, 2020

Installing and Executing DFU - the awesome ODS-2 Disk and File Utilities for OpenVMS VAX and Alpha

SANYALnet Labs: DFU disk defragmentation and file utility tool for Digital Equipment Corporation DEC VAX Server VMS and OpenVMS VAX and Alpha AXP
DFU for VMS Main Menu

Introduction to DFU


The online help for DFU provides a great introduction to the tool:

"The ODS-2 Disk and File Utilities (DFU) is a collection of high performance utilities developed to perform routine maintenance and special purpose operations on disks, files and directories. The functionality offered by DFU is not or partly available through other DCL commands or VMS utilities.

DFU has the following functions:

  • DEFRAGMENT : defragment individual files
  • DELETE   : delete files by file-id, and delete directory(trees) fast
  • DIRECTORY functions
    • COMPRESS , DUMP or RECOVER directories
    • Search directories for files with multiple versions, alias files or empty directories
  • INDEXF   : analyze , defragment truncate and extend INDEXF.SYS
  • REPORT     : reports disk fragmentation
  • SEARCH   : search for files
  • SET        : set file attributes
  • UNDELETE   : recover deleted files
  • VERIFY   : analyze (and repair) the disk structure"

Installing DFU on OpenVMS VAX 7.3

The DFU tool for VAX servers running OpenVMS operating system is available free online for download. I installed it on MARIAH (31.70) - my real MicroVAX 3100-80.

To download DFU VAX:

[localuser@linuxpc tmp]$ wget https://www.digiater.nl/openvms/freeware/v50/dfu027a/dec-vaxvms-dfu-v0207-a-1.pcsi
--2020-04-21 03:13:50--  https://www.digiater.nl/openvms/freeware/v50/dfu027a/dec-vaxvms-dfu-v0207-a-1.pcsi
Resolving www.digiater.nl (www.digiater.nl)... 185.92.71.114
Connecting to www.digiater.nl (www.digiater.nl)|185.92.71.114|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 974848 (952K)
Saving to: ‘dec-vaxvms-dfu-v0207-a-1.pcsi’

100%[======================================>] 974,848     62.7KB/s   in 13s

2020-04-21 03:14:04 (73.5 KB/s) - ‘dec-vaxvms-dfu-v0207-a-1.pcsi’ saved [974848/974848]

Then FTP the PCSI installer to the VAX:

[localuser@linuxpc tmp]$ ftp 10.42.2.5
Connected to 10.42.2.5 (10.42.2.5).
220 sanyalnet-vax.sanyalnet.lan FTP Server (Version 5.1) Ready.
Name (10.42.2.5:localuser): sanyal
331 Username sanyal requires a Password
Password:
230 User logged in.
Remote system type is VMS.
ftp> cd temp
250-CWD command successful.
250 New default directory is DUA1:[SANYAL.TEMP]
ftp> bin
200 TYPE set to IMAGE.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> put dec-vaxvms-dfu-v0207-a-1.pcsi
local: dec-vaxvms-dfu-v0207-a-1.pcsi remote: dec-vaxvms-dfu-v0207-a-1.pcsi
227 Entering Passive Mode (10,42,2,5,192,20)
150 Opening data connection for DUA1:[SANYAL.TEMP]DEC-VAXVMS-DFU-V0207-A-1.PCSI; (10.42.2.11,43577)
########################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
226 Transfer complete.
974848 bytes sent in 0.49 secs (1987.70 Kbytes/sec)
ftp> bye

Then log into the VAX and install DFU.

DUA1:[SANYAL.TEMP] dir *.pcsi

Directory DUA1:[SANYAL.TEMP]

DEC-VAXVMS-DFU-V0207-A-1.PCSI;1

Total of 1 file.
DUA1:[SANYAL.TEMP] product install *

The following product has been selected:
    DEC VAXVMS DFU V2.7-A                  Layered Product

Do you want to continue? [YES]

Configuration phase starting ...

You will be asked to choose options, if any, for each selected product and for
any products that may be installed to satisfy software dependency requirements.

DEC VAXVMS DFU V2.7-A: Disk and File Utilities for OpenVMS

Do you want the defaults for all options? [YES] NO

    DEC VAXVMS VMS V7.3 [Installed]

    * Configuration options for this referenced product cannot
    * be changed now because the product is already installed.
    * (You can use PRODUCT RECONFIGURE later to change options.)

    Documentation in Text format [YES]

    Documentation in PostScript format [YES]

    Documentation in BookReader format [YES]

    Documentation in HTML format [YES]

Do you want to review the options? [NO]

Execution phase starting ...

The following product will be installed to destination:
    DEC VAXVMS DFU V2.7-A                  DISK$OPENVMS$7_3:[VMS$COMMON.]

Portion done: 0%...10%...20%...30%...40%...70%...80%...90%...100%

The following product has been installed:
    DEC VAXVMS DFU V2.7-A                  Layered Product
DUA1:[SANYAL.TEMP]


Attempting to run DFU straightaway fails. We need the identifier DFU_ALLPRIV to be granted to the user.

DUA1:[SANYAL] dfu defrag vaxgames.sav

%DFU-E-NOPRIV, No privilege to perform this function (DFU_ALLPRIV not granted)

Proceed to grant the required identifier to the user.

DUA1:[SANYAL.TEMP] cd sys$system
SYS$SYSROOT:[SYSEXE] mc authorize
UAF>
UAF> grant/identifier DFU_ALLPRIV SANYAL
%UAF-I-GRANTMSG, identifier DFU_ALLPRIV granted to SANYAL
UAF> exit
%UAF-I-NOMODS, no modifications made to system authorization file
%UAF-I-NAFNOMODS, no modifications made to network proxy database
%UAF-I-RDBDONEMSG, rights database modified

LOGOUT  and log back in. Once the identifier is granted, DFU can be used.

$ set proc/priv=all
DUA1:[SANYAL] dfu defrag vaxgames.sav

┌──────────────────────────< DFU V2.7-A (Freeware) >───────────────────────────┐
│%DFU-I-DEFRAG, Start defragmenting file(s) ...                                │
│%DFU-S-MOVED, File DUA1:[SANYAL]VAXGAMES.SAV;2 defragmented                   │
│                                                                              │
│%DFU-I-READY, DEFRAG command ready                                            │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                             │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
├──────────────────────────────────Statistics──────────────────────────────────┤
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘




DUA1:[SANYAL] dfu search dua2 /version_num=min=500


┌──────────────────────────< DFU V2.7-A (Freeware) >───────────────────────────┐

│%DFU-I-SEARCH, Start search on DUA2: (QCOCAL$DUA2:)                           │
│                                                                              │
│QCOCAL$DUA2:[FAL$SERVER]INTRUSIONS.TXT;880 19/21                            │
│                                                                              │
│%DFU-I-EOF, End of file INDEXF.SYS, Primary headers : 3491                    │
│                                                                              │
│%DFU-S-FND , Files found : 1, Size : 19/21                                    │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                             │
│                                                                              │ 
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
├──────────────────────────────────Statistics──────────────────────────────────┤
│  Progress : |                       100%                       |             │
│  Status   : READY                                                            │
└──────────────────────────────────────────────────────────────────────────────┘





Installing DFU on OpenVMS Alpha 8.3


Installing DFU on OpenVMS/Alpha is just like installing on VAX VMS. I installed it on RAPTOR (31.18) - an AlphaServer ES40 833 MHz running OpenVMS Alpha 8.3:

$ SHOW CPU

System: RAPTOR, AlphaServer ES40 833 MHz

CPU ownership sets:
   Active            0
   Configure         0

CPU state sets:
   Potential         0
   Autostart         0
   Powered Down      None
   Not Present       None
   Failover          None
$


First, download the OpenVMS/Alpha edition of DFU on a local Linux machine:

[localuser@linuxpc ~]$ wget https://www.digiater.nl/openvms/freeware/v70/dfu/dec-axpvms-dfu-v0301-1-1.pcsi
--2020-04-22 01:45:43--  https://www.digiater.nl/openvms/freeware/v70/dfu/dec-axpvms-dfu-v0301-1-1.pcsi
Resolving www.digiater.nl (www.digiater.nl)... 185.92.71.114
Connecting to www.digiater.nl (www.digiater.nl)|185.92.71.114|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1392640 (1.3M)
Saving to: ‘dec-axpvms-dfu-v0301-1-1.pcsi.1’

100%[======================================>] 1,392,640    138KB/s   in 13s

2020-04-22 01:45:57 (104 KB/s) - ‘dec-axpvms-dfu-v0301-1-1.pcsi.1’ saved [1392640/1392640]

Then FTP the DFU PCSI installer to the Alphaserver:

[localuser@linuxpc ~]$ ls *pcsi
dec-axpvms-dfu-v0301-1-1.pcsi  dec-vaxvms-dfu-v0207-a-1.pcsi
[localuser@linuxpc ~]$ ftp 10.42.2.12
Connected to 10.42.2.12 (10.42.2.12).
220 raptor.sanyalnet.lan FTP Server (Version 5.6) Ready.
Name (10.42.2.12:localuser): sanyal
331 Username sanyal requires a Password
Password:
230 User logged in.
Remote system type is VMS.
ftp> bin
200 TYPE set to IMAGE.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> put dec-axpvms-dfu-v0301-1-1.pcsi
local: dec-axpvms-dfu-v0301-1-1.pcsi remote: dec-axpvms-dfu-v0301-1-1.pcsi
227 Entering Passive Mode (10,42,2,12,192,16)
150 Opening data connection for SYS$SYSDEVICE:[SANYAL]dec-axpvms-dfu-v0301-1-1.pcsi; (10.42.2.11,37666)
################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
226 Transfer complete.
1392640 bytes sent in 0.241 secs (5784.11 Kbytes/sec)
ftp>  bye
221 Goodbye.


Invoke the PCSI installer as usual:


$ DIR *.PCSI

Directory SYS$SYSDEVICE:[SANYAL]

dec-axpvms-dfu-v0301-1-1.pcsi;1

Total of 1 file.
$


$ PRODUCT INSTALL *
%PCSI-I-CANNOTVAL, cannot validate RAPTOR$DKA0:[SANYAL]dec-axpvms-dfu-v0301-1-1.
pcsi;1
-PCSI-I-NOTSIGNED, product kit is not signed and therefore has no manifest file

The following product has been selected:
    DEC AXPVMS DFU V3.1-1                  Layered Product

Do you want to continue? [YES]

Configuration phase starting ...

You will be asked to choose options, if any, for each selected product and for
any products that may be installed to satisfy software dependency requirements.

DEC AXPVMS DFU V3.1-1: Disk and File Utilities for OpenVMS Alpha

Do you want the defaults for all options? [YES] NO

    DEC AXPVMS VMS V8.3 [Installed]

    * Configuration options for this referenced product cannot
    * be changed now because the product is already installed.
    * (You can use PRODUCT RECONFIGURE later to change options.)

    Documentation in Text format [YES]

    Documentation in PostScript format [YES] NO

    Documentation in Adobe (R) PDF format [YES] NO

    Documentation in HTML format [YES] NO

Do you want to review the options? [NO]

Execution phase starting ...

The following product will be installed to destination:
    DEC AXPVMS DFU V3.1-1                  DISK$ALPHASYS:[VMS$COMMON.]

Portion done: 0%...10%...20%...60%...70%...100%

The following product has been installed:
    DEC AXPVMS DFU V3.1-1                  Layered Product
$
$ DIR SYS$SYSTEM:DFU.EXE

Directory SYS$COMMON:[SYSEXE]

DFU.EXE;1

Total of 1 file.

Define a symbol to make running DFU easier (this same symbol can be defined in SYS$MANAGER:SYLOGIN_VMS.COM too), and away we go running the great tool.


$ DFU :== "$SYS$SYSTEM:DFU.EXE"

$ DFU HELP

┌─────────────────────────────< DFU Help Screen >──────────────────────────────┐
│                                                                              │
│DFU                                                                           │
│                                                                              │
│                                                                              │
│  The ODS-2 Disk and File Utilities is a high performance utility             │
│  developed to perform routine maintenance and special purpose operations     │
│  on disks, files and directories. The functionality offered by DFU           │
│  is not or partly available through other DCL commands or VMS utilities.     │
│                                                                              │
│  DFU has the following functions:                                            │
│                                                                             │
│    o DEFRAGMENT : defragment individual files                                │
│    o DELETE   : delete files by file-id, and delete directory(trees) fast    │
│    o DIRECTORY functions                                                     │
│          : COMPRESS , DUMP or RECOVER directories                            │
│          : search directories for files with multiple versions ,             │
│             alias files , or empty directories                               │
│    o INDEXF   : analyze , defragment truncate and extend INDEXF.SYS          │
│    o REPORT     : reports disk fragmentation                                 │
│                                                                              │
│Press RETURN to continue...                                                   │
└──────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────< DFU Help Screen >──────────────────────────────┐
│    o SEARCH   : search for files                                             │
│    o SET        : set file attributes                                        │
│    o UNDELETE   : recover deleted files                                      │
│    o VERIFY   : analyze (and repair) the disk structure                      │
│                                                                              │
│                                                                              │
│                                                                              │
│  Additional information available:                                           │
│                                                                              │
│  New_features          Restrictions        DEFRAG   DELETE                   │
│  DIRECTORY  EXIT       HELP       INDEXF     REPORT   Screen_Management      │
│  SEARCH     SET        SPAWN      UNDELETE   VERIFY                          │
│                                                                             │
│DFU Subtopic?                                                                 │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                             │
│                                                                              │
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘



$ DFU

┌────────────────────────────────< DFU V3.1-1 >────────────────────────────────┐
│                                                                              │
│     Disk and File Utilities for OpenVMS V3.1-1                               │
│     DFU functions are :                                                      │
│                                                                              │
│     DEFRAGMENT : Defragment files                                            │
│     DELETE : Delete files by File-ID; delete directory (trees)              │
│     DIRECTORY  : Manipulate directories                                      │
│     INDEXF : Modify /View INDEXF.SYS                                        │
│     REPORT : Generate a complete disk report                                │
│     SEARCH : Fast file search                                               │
│     SET : Modify file attributes                                            │
│     UNDELETE : Recover deleted files                                        │
│     VERIFY : Check and repair disk structure                                │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
├──────────────────────────────────Statistics──────────────────────────────────┤
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘
 DFU> exit
$

$ DFU SEARCH DKA0 /VERSION=MINIMUM=2000

┌────────────────────────────────< DFU V3.1-1 >────────────────────────────────┐
│%DFU-I-SEARCH, Start search on DKA0: (RAPTOR$DKA0:)                           │
│                                                                              │
│RAPTOR$DKA0:[SYS0.NML$SERVER]NETSERVER.LOG;28983 2/16                       │
│RAPTOR$DKA0:[SYS0.TCPIP$SMTP]TCPIP$SMTP_RECV_RUN.LOG;32767                    │
│                                                                2/16          │
│RAPTOR$DKA0:[SYS0.NML$SERVER]NETSERVER.LOG;28984                2/16          │
│RAPTOR$DKA0:[SYS0.TCPIP$NTP]TCPIP$NTP.DRIFT;17209 1/16                      │
│RAPTOR$DKA0:[SYS0.NML$SERVER]NETSERVER.LOG;28981 2/16                       │
│RAPTOR$DKA0:[SYS0.NML$SERVER]NETSERVER.LOG;28982        2/16                 │
│RAPTOR$DKA0:[SYS0.NML$SERVER]NETSERVER.LOG;28980 2/16                       │
│                                                                             │
│%DFU-I-EOF, End of file INDEXF.SYS, Primary headers : 11455                   │
│                                                                              │
│%DFU-S-FND , Files found : 7, Size : 13/112                                   │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
├──────────────────────────────────Statistics──────────────────────────────────┤
│  Progress : |                       100%                       |             │
│  Status   : READY                                                            │
└──────────────────────────────────────────────────────────────────────────────┘

$
$ DFU DEFRAG RAPTOR$DKA0:[SYS0.NML$SERVER]NETSERVER.LOG

┌────────────────────────────────< DFU V3.1-1 >────────────────────────────────┐
│%DFU-I-DEFRAG, Start defragmenting file(s) ...                                │
│%DFU-S-MOVED, File RAPTOR$DKA0:[SYS0.NML$SERVER]NETSERVER.LOG;28984 defragment│
│ed                                                                            │
│                                                                              │
│%DFU-I-READY, DEFRAG command ready                                            │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                             │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
│                                                                              │
├──────────────────────────────────Statistics──────────────────────────────────┤
│                                                                              │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

$