Getting Graylog onto the internet

A while back I had made a small post about getting Graylog running on Windows. It was fun, as it’s just JAVA so you know it should be portable, and other than some weird disk access thing it does seem to run fine.

Of course, the next step is to create a dashboard to replace what I used on wp-statistics, as it was crashing taking up 100% of my CPU, and exceeding PHP’s 12GB of RAM per process limit. You know things are messed up when I’m replacing you with not one, but 2 Java apps! (Graylog & Opensearch).

magical dashboard

It’s by no means perfect, but the guide How to se -up graylog geoip configuration, is all around great to have. The rest of it is me learning how to do aggregate searches, and simple lists, to see latest hits, 404’s and count the pages and build a graph.

Again, this is all good, now for the real question, how to get this onto the Internet?!

The firs thing to do is enable cors.. It’s for being on the internet!

http_enable_cors = true

Next enable the external URI name

http_external_uri = https://dash.board.com/

And now the changes I had to make in my haproxy config

frontend http-in
        acl host_graylog hdr(host) -i dash.board.com
        http-request set-uri %[path,regsub(/api/api,/api)] if host_graylog
        use_backend graylog if host_graylog

backend graylog
        option forwardfor
        http-request add-header X-Forwarded-Host %[req.hdr(host)]

        acl bad_ct path_end .js
        http-response set-header Content-Type application/javascript if bad_ct

        http-request set-header X-Graylog-Server-URL http://192.168.33.5:9000
        server graylog 192.168.23.33:9000 maxconn 20 check

I kind of wish I saved the logs while going crazy but YES for some reason it’ll try to reference itself as /api/api. I don’t know why, so I had to do some uri regex to fix that. Neat!

Next for some reason Graylog responds that all .js (javascript) files are actually text. Chrome doesn’t allow that to work, so yes you need to set the content type header to “application/javascript” for Chrome to be happy.

I had wasted over an hour with this and couldn’t get it working. So, I walked away for a few hours, and it suddenly was working. I think Cloudflare was doing some caching against it.

This is probably too terse to be really useful, and I lost all the pages I was reading about setting stuff in haproxy as I was doing that incognito. Oops. I picked this config out of fragments from five other people’s stuff. There is other considerations to host it on a subdirectory of a public site, but I just wanted to K.I.S.S.

It was 25 years ago today

32bit computing arrived to the masses. Although it’s incredibly frail by modern standards, Windows 95 did deliver on the promises of OS/2. Depending on your apps, and drivers of course. Although OS/2 did have int13.sys to pass disk calls to a special v86 machine which then used the disk BIOS to make disk access possible, Microsoft and IBM stopped short there, not going all the way letting OS/2 use MS-DOS device drivers. Windows 95, however could.

This was always the winning strategy of Windows, is that it relied on the incredible OEM driver support for MS-DOS. Of course this would also be a catastrophic weakness. From my personal experience being able to leverage ancient MS-DOS drivers also helped squeeze as much as possible out of existing hardware. Case in point, the NDIS2 drivers for the AT&T Starlan 1mbit cards worked fine under Windows 95, additionally you could lost just the lower level drivers, and 95 could then load it’s protocols on top of that stack allowing you to have a TCP/IP network over that 1mbit Starlan stack letting you telnet into your 3b2 (or setup SAMBA, and doing file/print sharing).

If anything the biggest flaw of Windows 95 was not installing TCP/IP by default. However unlike many OS’s of the time, Windows 95 did include LAN and dialup stacks. There was plenty great about OS/2, but it’s refusal to integrate networking into the operating system hamstrung things like named pipes, peer, and larger apps, as you would have to buy and license a stack of stuff to bring OS/2 up to where it should be, while NT and 95 were complete out of the box.

Windows 95 was an excellent bridge OS for the era, until OEMs finally got around to writing drivers for Windows NT. Once the mainstream could finally take that leap, and leave MS-DOS far behind. But that didn’t really happen until Windows XP.

That being said, the favorite thing is to run Windows 95 in a browser. I found https://copy.sh/v86/ the fastest and best, as it loads a short 6MB compressed core image, and you are instantly teleported to the 95 desktop.

Try it out, play some solitaire and enjoy!

Hypnospace Outlaw

Hypnos desktop

It’s an interesting twist on the typical point & click adventure game. How so? Well simply put it’s all based on web technology! With a big emphasis on that late 90’s vibe! Complete with ‘desktop pets’ animated GIFs, blinking text, and embedded MIDI (and even more sophisticated music).

While it’s obviously not real, the entire ‘web’ is stored locally (even in it’s own lore), it’s still fun to dig around in.

You play as an “Enforcer” basically it’s like back to the AOL days of walled gardens being patrolled by unpaid volunteers. Look for banned content and flag it appropriately. As the game progresses things go off the rails, near riots, helicopter crashes, amputations, culminating in a Y2K crash that kills people.

I totally missed out on this being a crowdfunded thing, and found out from Steam recommendations of all things.

Even for the aesthetic alone, I think it’s worth it. Some of the game play is too much wrapped up into it’s own lore, so paying attention is kind of important.

BoxedWine

Not this kind!

I got a tip in another post about this fantastical project, boxedwine!  It’s Wine + a 386 processor emulator, and it’s been targeted to SDL.  What does this mean? Wine on Windows!

Sim Earth for Windows 3.0

I went ahead with one of the oldest Windows games I have around, SimEarth, for Windows 3.0.  I don’t have Balance of Power, although I guess I may procure a copy one day.  Anyways it’s Windows in it’s 1990 glory 16bit, 286 protected mode, and sure as heck won’t run on Win64.  Oh sure you can run this on MS-DOS + Windows, but where is the fun in that?

Now that’s all good fun, sure Wine can run stuff, sure, but it’s still wine.  Well remember all that noise about android running Wine?  Yeah, well here we go.

Wine + x86 emulation +SDL in javascript!

Here we go.  Games, and the BoxedWine project page.   And yes, it can run stuff like Quake 2, and other far more intense applications.  Just like Wine.  It’s really great stuff, check it out, if only in a browser.

If you want to run ancient Win16 stuff in a pinch, it may actually run.  I had issues with win87em.dll stuff, but just like Wine it’s a moving window of compatibility.

Microsoft C KnowledgeBase articles online

PC Mag, January 1989

It’s weird I was discussing putting this online in a more human readable format, and then  Jeff Parsons over at the incredible full system emulation in javascript site, pcjs.org just did it.

As you may or not be aware of, Microsoft hit it big as a computer languages company, before they added operating systems into it’s portfolio.  And for some weird reason after the whole OS/2 divorce thing, someone decided that everything that had been painfully learned in the earlier eras should just be expunged from history.  Which is a real shame to anyone interested in Basic, Fortran, Pascal, C and MASM.  Years ago I had gone through the steps of extracting the text the only way I could figure out easily, by writing a simple TSR that would dump the contents of the text video buffer, and write it to a file, then press the page down key, and keep repeating the process. The end result being that I had then dumped the MSPL aka the Microsoft Programmer’s Library.  I had put the text into an archive, aptly named Microsoft_Programmers_Library.7z, and pretty much used grep whenever I wanted any information, and left it at that..

It’s really cool to see it slowly transitioning to more useful information.  You can read Jeff’s article Corporations Are Crappy Archivists about his quest for seemingly simple information about ancient Microsoft mice, and the archive of KB’s for Microsoft C.

One thing that is annoying is that information on CD from the late 1980’s seems to be darned near impossible to find.  I know that each generation of machines until about 2005 was exponentially larger than the previous one (post 2007 we hit the iThing world, along with most machines being ‘good enough’ for day to day usage).  I know this ad may seem insane, but Microsoft really was trying to push people to CD distributions.  As we all know that internet thing didn’t quite tickle their fancy.    Did they ever put resources like this online?  Like on BIX or Compuserve?  It seems like an ideal resource.  But I was a kid, and didn’t have that kind of money.

Awesome CD-ROM collection and drive, starting at a mere $899!

So in the interest of a bad idea, here is MSPL, aka qemu/curses in action.

Oh my god, what I have I done!?

Well as an addendum I thought it’d be cool to put MSPL online, via shellinabox.  First off I needed a 5MB MS-DOS disk, basically enough MS-DOS too boot up, run smartdrive, idle and the CD-ROM driver, along with the minimal MSPL install.  And to button it up, I added a reboot.com from the autoexec, so when you exit it’ll reboot the VM.  Great.

The reboot command was input via debug, as it’ll let you assemble code directly.  Although it isn’t a MACRO assembler, so you have to know exactly what you are doing.

DEBUG RESET.COM
A
XOR AX, AX
NOT AX
PUSH AX
NOT AX
PUSH AX
RETF
(return on a line by itself)
RCX
9
W
Q

And with that saved, now I have to setup Qemu.  Since I’m taking the shellinabox approach that means I need something text mode, and I was thinking this was light weight. Qemu has a curses output so that’ll work.  I set it up to use qcow2 and a backing store image so that way every forked user doesn’t eat 5MB of disk space, it’s more like 100kb.

#!/bin/sh
set -m
PID=$$
mkdir /tmp/$PID
cd /tmp/$PID
qemu-img create -f qcow2 -b /usr/local/mspl/MSPL.qcow2 MSPL.qcow2
qemu-system-i386 -m 4 -cpu 486 -hda MSPL.qcow2 -cdrom /usr/local/mspl/Microsoft-Programers-Library-v1.3.iso -curses -no-reboot
cd /tmp
rm -rf /tmp/$PID

Then to tie it into shell in a box, it’ll just need the flag:

-s /mspl:nobody:nogroup:/:/usr/local/bin/mspl.sh

and this will run it as nobody, and kick off the above bash script.  Now that’s great and all, but what about stale/abandoned sessions?  I wrote this quick script to clean them up.

#!/bin/bash

FIND=”find /tmp -type d -regextype sed -regex ‘.*/[0-9]*’ -mmin +30 | sed ‘s/\/tmp\///’>/tmp/kill_out.txt”
eval $FIND
while read process; do

KILL=”kill -9 ${process}”
eval $KILL
RMDIR=”rm -rf /tmp/${process}”
eval $RMDIR

done < /tmp/kill_out.txt
rm -rf /tmp/kill_out.txt

So it’ll find numerical directories that are at least 30 minutes old, kill them and remove their directory.  Probably very dangerous to run, but it’s isolated so Im not too worried.  Then just have root add that script to it’s crontab, and run it every minute, and it’ll kill the old stuff hanging around.

I’ll add a video later on how to use MSPL via this setup.  And maybe I’ll rig something to have RDP access as well, depending on how I’m feeling.

8 bit boy & JS-DOS

A long while ago I had combined both 8bit boy & a JAVA port of DOSBox for a run in your browser extravaganza featuring a Russian version of Windows/386 and tetris (along with other Russian adapted games).  But time moves on, and flash apps fall out of favor, and well Oracle did their thing and Java is basically dead in the browser.  I had been trying to go with a javascript solution for a while, but js-dos looks better than the last few iterations.

However I haven’t figured out how to boot into a disk image, and attempting to loop to loop causes it to hang.  So I’m stuck with a simple zip of tetris and using the newer 8bit boy javascript port to hammer out some MOD’s of various theme music.  It’s not perfect but it’s better than being dead, which is where it was before this.

You can see it here.

I though this same tech would be a great way to take my GCC 1.27 build of DooM, and shove it in DOSBox and get it out into the world.  Although its far too slow for me, but it could be this crap laptop.  (my new one should be here in 7 days, but I have to travel again in 5…..).  I had also updated my DJGPP cross project to include 1.27, and rename the v1 as gcc_v139 to at least reflect what it is.

You can check out this super early GCC compiled version of DooM here.

I’ll have to try to convert over all I can.  I hated having all this stuff basically configured, but then thanks to SUN going bust, and Oracle being Oracle it all got screwed over.

 

NetHack in your browser via Moxie CPU

I saw this many years ago, but for some reason never finished writing about this. Moxie was a virtual CPU designed to be as simple as possible for the GNU toolchain to target.

Perhaps one of the more interesting things was a port of RTEMS to the Moxie CPU, and a port of Nethack to that architecture. And of course, there was a javascript simulator environment allowing me to easily embed it into this post.

Terminal uses canvas

So yes, it’s a virtual CPU, OS & Game, running in java-script and on the page.

Multiplayer Macintosh Plus via Javascript/

I found this fun page over on retroweb.maclab.org  What is interesting is that it encorporates PeerJS and WebRTC to allow for a virtual network, letting you play multiplayer AppleTalk.  Just enable the network, and scan for other users.

It’s pretty cool, in a zero config kind of way!

PCE-MacPlus

And for coolness it’ll embed in a snazzy picture of a Mac Plus.  Although you can magnify the screen, so you don’t have to squint so much.