From 5c530e67256f8ecbd93336ba4e876acbba73f716 Mon Sep 17 00:00:00 2001 From: Miguel Date: Tue, 19 Feb 2019 12:25:40 +0100 Subject: cleaning up more.. --- 010_me/index.md | 2 +- .../index.md | 43 +++ .../00110_Midnight-Commander-Cheatsheet/index.md | 61 ++++ 080_blog/00010_Various-Cheat-Sheets/index.md | 3 + .../00035_A-quick-Trumpet-in-Blender/1.png | Bin 0 -> 90433 bytes .../00035_A-quick-Trumpet-in-Blender/2.png | Bin 0 -> 741047 bytes .../00035_A-quick-Trumpet-in-Blender/3.png | Bin 0 -> 743011 bytes .../00035_A-quick-Trumpet-in-Blender/4.png | Bin 0 -> 728056 bytes .../00035_A-quick-Trumpet-in-Blender/index.md | 25 ++ 080_blog/00020_3D-Art/index.md | 3 + 080_blog/00020_About-Software-Fools/index.md | 54 ---- .../00025_Open-Source-Gaming-on-Linux/index.md | 33 --- .../00010_The-Old-Times/attack.png | Bin 0 -> 25834 bytes .../00010_The-Old-Times/attack.zip | Bin 0 -> 26160 bytes .../00010_The-Old-Times/high1.png | Bin 0 -> 169188 bytes .../00010_The-Old-Times/high2.png | Bin 0 -> 89748 bytes .../00010_The-Old-Times/highway.zip | Bin 0 -> 2960639 bytes .../00010_The-Old-Times/index.md | 54 ++++ .../00010_The-Old-Times/naval.zip | Bin 0 -> 31425 bytes .../00010_The-Old-Times/naval1.png | Bin 0 -> 24910 bytes .../00010_The-Old-Times/naval2.png | Bin 0 -> 43527 bytes .../Space-Engineers-ASCII-Bars.png | Bin 0 -> 26480 bytes .../Space-Engineers-Animated-Display-Setup.png | Bin 0 -> 15425 bytes .../Space-Engineers-LCD-Panels.png | Bin 0 -> 28543 bytes .../Space-Engineers-Pixel-Display.png | Bin 0 -> 24105 bytes .../index.md | 325 +++++++++++++++++++++ 080_blog/00030_Computer-Games/index.md | 4 + 080_blog/00035_Trumpet-in-Blender/index.md | 25 -- 080_blog/00040_Graham-Scan-(Haskell)/index.md | 128 -------- .../00040_Graham-Scan-(Haskell)/index.md | 128 ++++++++ .../00065_Base64-Encoder-(Haskell)/index.md | 51 ++++ .../00120_Lambda-Calculus-(Haskell)/index.md | 38 +++ .../index.md | 29 ++ .../SimpleSvg.hs | 179 ++++++++++++ .../index.md | 31 ++ .../svg.png | Bin 0 -> 13130 bytes .../100_Static-Page-Maker-in-Haskell/index.md | 121 ++++++++ 080_blog/00040_Haskell-Projects/index.md | 4 + 080_blog/00065_Base64-Encoder-(Haskell)/index.md | 51 ---- 080_blog/00090_Miguels-KVM-Adventures/index.md | 2 +- 080_blog/00090_Miguels-KVM-Adventures/ipv4.png | Bin 0 -> 123475 bytes .../index.md | 325 --------------------- .../index.md | 41 --- 080_blog/0010_The-Old-Times/attack.png | Bin 25834 -> 0 bytes 080_blog/0010_The-Old-Times/attack.zip | Bin 26160 -> 0 bytes 080_blog/0010_The-Old-Times/high1.png | Bin 169188 -> 0 bytes 080_blog/0010_The-Old-Times/high2.png | Bin 89748 -> 0 bytes 080_blog/0010_The-Old-Times/highway.zip | Bin 2960639 -> 0 bytes 080_blog/0010_The-Old-Times/index.md | 54 ---- 080_blog/0010_The-Old-Times/naval.zip | Bin 31425 -> 0 bytes 080_blog/0010_The-Old-Times/naval1.png | Bin 24910 -> 0 bytes 080_blog/0010_The-Old-Times/naval2.png | Bin 43527 -> 0 bytes .../00110_Midnight-Commander-Cheatsheet/index.md | 74 ----- 080_blog/00120_Lambda-Calculus-(Haskell)/index.md | 38 --- .../index.md | 29 -- .../index.md | 40 --- .../00010_Monospace-Font-Bitmap-Generator/index.md | 64 ---- .../00020_Notes-on-Mail-Clients/index.md | 144 --------- 080_blog/00_Old-And-Outdated/index.md | 5 - .../00010_Monospace-Font-Bitmap-Generator/index.md | 64 ++++ .../00_garbage/00020_About-Software-Fools/index.md | 54 ++++ .../00020_Notes-on-Mail-Clients/index.md | 144 +++++++++ .../00025_Open-Source-Gaming-on-Linux/index.md | 33 +++ 080_blog/00_garbage/index.md | 5 + .../0100_Webkit-Keyboardless-Navigation/index.md | 4 +- 080_blog/100_Static-Page-Maker-in-Haskell/index.md | 121 -------- favicon.ico | Bin 318 -> 198 bytes template.html | 2 +- 68 files changed, 1404 insertions(+), 1231 deletions(-) create mode 100644 080_blog/00010_Various-Cheat-Sheets/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md create mode 100644 080_blog/00010_Various-Cheat-Sheets/00110_Midnight-Commander-Cheatsheet/index.md create mode 100644 080_blog/00010_Various-Cheat-Sheets/index.md create mode 100644 080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/1.png create mode 100644 080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/2.png create mode 100644 080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/3.png create mode 100644 080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/4.png create mode 100644 080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/index.md create mode 100644 080_blog/00020_3D-Art/index.md delete mode 100644 080_blog/00020_About-Software-Fools/index.md delete mode 100644 080_blog/00025_Open-Source-Gaming-on-Linux/index.md create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/attack.png create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/attack.zip create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/high1.png create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/high2.png create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/highway.zip create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/index.md create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/naval.zip create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/naval1.png create mode 100644 080_blog/00030_Computer-Games/00010_The-Old-Times/naval2.png create mode 100644 080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-ASCII-Bars.png create mode 100644 080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Animated-Display-Setup.png create mode 100644 080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-LCD-Panels.png create mode 100644 080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Pixel-Display.png create mode 100644 080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md create mode 100644 080_blog/00030_Computer-Games/index.md delete mode 100644 080_blog/00035_Trumpet-in-Blender/index.md delete mode 100644 080_blog/00040_Graham-Scan-(Haskell)/index.md create mode 100644 080_blog/00040_Haskell-Projects/00040_Graham-Scan-(Haskell)/index.md create mode 100644 080_blog/00040_Haskell-Projects/00065_Base64-Encoder-(Haskell)/index.md create mode 100644 080_blog/00040_Haskell-Projects/00120_Lambda-Calculus-(Haskell)/index.md create mode 100644 080_blog/00040_Haskell-Projects/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md create mode 100644 080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/SimpleSvg.hs create mode 100644 080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/index.md create mode 100644 080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/svg.png create mode 100644 080_blog/00040_Haskell-Projects/100_Static-Page-Maker-in-Haskell/index.md create mode 100644 080_blog/00040_Haskell-Projects/index.md delete mode 100644 080_blog/00065_Base64-Encoder-(Haskell)/index.md create mode 100644 080_blog/00090_Miguels-KVM-Adventures/ipv4.png delete mode 100644 080_blog/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md delete mode 100644 080_blog/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md delete mode 100644 080_blog/0010_The-Old-Times/attack.png delete mode 100644 080_blog/0010_The-Old-Times/attack.zip delete mode 100644 080_blog/0010_The-Old-Times/high1.png delete mode 100644 080_blog/0010_The-Old-Times/high2.png delete mode 100644 080_blog/0010_The-Old-Times/highway.zip delete mode 100644 080_blog/0010_The-Old-Times/index.md delete mode 100644 080_blog/0010_The-Old-Times/naval.zip delete mode 100644 080_blog/0010_The-Old-Times/naval1.png delete mode 100644 080_blog/0010_The-Old-Times/naval2.png delete mode 100644 080_blog/00110_Midnight-Commander-Cheatsheet/index.md delete mode 100644 080_blog/00120_Lambda-Calculus-(Haskell)/index.md delete mode 100644 080_blog/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md delete mode 100644 080_blog/00140_Minimalistic-SVG-Generator-(Haskell)/index.md delete mode 100644 080_blog/00_Old-And-Outdated/00010_Monospace-Font-Bitmap-Generator/index.md delete mode 100644 080_blog/00_Old-And-Outdated/00020_Notes-on-Mail-Clients/index.md delete mode 100644 080_blog/00_Old-And-Outdated/index.md create mode 100644 080_blog/00_garbage/00010_Monospace-Font-Bitmap-Generator/index.md create mode 100644 080_blog/00_garbage/00020_About-Software-Fools/index.md create mode 100644 080_blog/00_garbage/00020_Notes-on-Mail-Clients/index.md create mode 100644 080_blog/00_garbage/00025_Open-Source-Gaming-on-Linux/index.md create mode 100644 080_blog/00_garbage/index.md delete mode 100644 080_blog/100_Static-Page-Maker-in-Haskell/index.md diff --git a/010_me/index.md b/010_me/index.md index 2e96290..ec17625 100644 --- a/010_me/index.md +++ b/010_me/index.md @@ -49,5 +49,5 @@ Download a PDF version of my Curriculum Vitae: [Michal\_Idziorek\_CV.pdf](/DATA/Michal_Idziorek_CV.pdf) -... but it is likely out of date, sorry. +It is likely out of date, sorry. diff --git a/080_blog/00010_Various-Cheat-Sheets/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md b/080_blog/00010_Various-Cheat-Sheets/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md new file mode 100644 index 0000000..80b24b1 --- /dev/null +++ b/080_blog/00010_Various-Cheat-Sheets/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md @@ -0,0 +1,43 @@ +GNU Screen - Keyboard Shortcuts +============================================= + +Invocation +---------- + $ screen [-S session_name] # simply start new session + $ screen -ls # lists sessions + $ screen -r session_name # resume detached session + $ screen -d -R session_name # resume session (also detach or create) + $ screen -d -RR #resume first session + +Shortcuts +--------- + ctrl-a c NEW WINDOW + ctrl-a n / ctrl-a p NEXT/PREVIOUS + ctrl-a d DETACH + ctrl-a D D DETACH and LOGOUT + + ctrl-a S SPLIT HORIZ. + ctrl-a | SPLIT VERTICAL + ctrl-a tab NEXT REGION + ctrl-x REMOVE REGION + ctrl-a q REMOVE ALL OTHER REGIONS + ctrl-a F FIT WINDOW + + ctrl-a c CLEAR SCREEN + ctrl-a k KILL WINDOW + ctrl-a \ QUIT + + ctrl-a esc COPY/SCROLLBACK MODE + +Layout Commands +--------------- + ctrl-a : #enter command mode + :layout new [title] + :layout remove [n|title] + :layout next + :layout prev + :layout show #list layouts + +Reference +--------- + [1] $ man screen diff --git a/080_blog/00010_Various-Cheat-Sheets/00110_Midnight-Commander-Cheatsheet/index.md b/080_blog/00010_Various-Cheat-Sheets/00110_Midnight-Commander-Cheatsheet/index.md new file mode 100644 index 0000000..eedc66a --- /dev/null +++ b/080_blog/00010_Various-Cheat-Sheets/00110_Midnight-Commander-Cheatsheet/index.md @@ -0,0 +1,61 @@ +###>>>KWD midnight commander cheatsheet, mc cheatsheet, mc shortcuts, midnight commander shortcuts +###>>>DSC Cheatsheet for Midnight Commander summarizing the most useful shortcuts. +Midnight Commander Cheatsheet +============================= + +A short cheat-sheet summarizing midnight commander's most useful shortcut keys. + +Basic Navigation +---------------- + tab switch active panel + up/down select previous/next rown + return open selected directory + alt-o open selected directory on other panel + +View +---- + alt-. toggle hidden files + ctrl-o toggle console + alt-t toggle listing mode + alt-i sync with other panel + ctrl-u swap panels + +Miscellaneous +------------- + shift-f6 rename, filling in the current filename + insert/ctrl-t/+/\/* selections + esc-tab auto complete + ctrl-enter / alt-enter copy currently selected filename to console + Ctrl + Shift + Enter copy full path + + alt-shift-h show dir history + alt-y/alt-u navigate history + + alt+?/alt-s/ctrl-s searches + + ctrl-space calculte size + ctrl - x c chmod + ctrl - x o chown + +Troubleshooting / Extras +------------------------ +Adding this to your _.bashrc_ will let _mc_ stay in the current directory after exiting: + + alias mc='. /usr/libexec/mc/mc-wrapper.sh' + +I run _midgnight commander_ inside _tmux_ and the shifted function keys did not work as +expected. Use midnight commanders _Learn Keys_ dialog to fix this. + +Set default viewer for pdf: + + xdg-mime default evince.desktop application/pdf + +Set default editor: + + alias mc='EDITOR=vim' + +Reference +--------- + +* http://klimer.eu/2015/05/01/use-midnight-commander-like-a-pro/ +* man mc diff --git a/080_blog/00010_Various-Cheat-Sheets/index.md b/080_blog/00010_Various-Cheat-Sheets/index.md new file mode 100644 index 0000000..ee779fa --- /dev/null +++ b/080_blog/00010_Various-Cheat-Sheets/index.md @@ -0,0 +1,3 @@ +Cheat Sheets +============ +A growing collection of some of my cheat sheets. diff --git a/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/1.png b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/1.png new file mode 100644 index 0000000..4a28a5b Binary files /dev/null and b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/1.png differ diff --git a/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/2.png b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/2.png new file mode 100644 index 0000000..980bef5 Binary files /dev/null and b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/2.png differ diff --git a/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/3.png b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/3.png new file mode 100644 index 0000000..6deb011 Binary files /dev/null and b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/3.png differ diff --git a/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/4.png b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/4.png new file mode 100644 index 0000000..90c2d8a Binary files /dev/null and b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/4.png differ diff --git a/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/index.md b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/index.md new file mode 100644 index 0000000..fab8cab --- /dev/null +++ b/080_blog/00020_3D-Art/00035_A-quick-Trumpet-in-Blender/index.md @@ -0,0 +1,25 @@ +Hear the Trumpets hear the Pipers +================================= + November 9, 2017 +Today morning I was playing with blender’s cycles “material nodes”, the “sub-surf modifier” and the “depth of field” camera setting. + +I modeled a simple trumpet by extruding some cylinders and used the Diffuse and Glossy shaders for the trumpet, as well as a Wave texture for the marble surface. + +**Extruded** and scaled some basic **cylinders** to get a simple (yet unfinished) trumpet: + +![](1.png){.img-fluid} + +Added **materials**: + +![](2.png){.img-fluid} + +Added the **subsurf** modifier: + +![](3.png){.img-fluid} + +Configured **depth of field**: + +![](4.png){.img-fluid} + +Voila, ... it's alpha and omega's kingdom come. + diff --git a/080_blog/00020_3D-Art/index.md b/080_blog/00020_3D-Art/index.md new file mode 100644 index 0000000..b840fc7 --- /dev/null +++ b/080_blog/00020_3D-Art/index.md @@ -0,0 +1,3 @@ +3D Art +====== +Some of my three dimensional creations, mostly in Blender. diff --git a/080_blog/00020_About-Software-Fools/index.md b/080_blog/00020_About-Software-Fools/index.md deleted file mode 100644 index 394b67e..0000000 --- a/080_blog/00020_About-Software-Fools/index.md +++ /dev/null @@ -1,54 +0,0 @@ -The Software Fools -================== - -A highly creative team consisting of software & hardware engineers, quantum physicians, data scientists, -cooks, painters, programmers, writers, philosophers, full stack developers, photographers, heavy drinkers, game designers and musicians,... among many others. - -It was formed in 1994 and consist, in it's very core and from the very -beginnings, by it's fouding fathers: Miguel & Nick. - -Most notable part-time members of the SoftwareFools include: Matjas & Juls. - -Some of the old SoftwareFools logos emerged around the turn of the millenium, -probably in the early 2000s: - -![](/DATA/sf/logo0.jpg){.img-fluid} - -![](/DATA/sf/logo2.jpg){.img-fluid} - -![](/DATA/sf/logo2b.jpg){.img-fluid} - -![](/DATA/sf/logo1.jpg){.img-fluid} - -![](/DATA/sf/fool2007.jpg){.img-fluid} - -![](/DATA/sf/fool2011.jpg){.img-fluid} - -The Logo of the glorious Software Fools Tangible Tabletop Division, engaging -successfully in bleeding edge hardware designs: - -![](/DATA/sf/logo3.jpg){.img-fluid} - -And here antoher one: - -![](/DATA/sf/hardwarefool.jpg){.img-fluid} - -Interestingly the Division suddenly ceased to exist, on the very verge of its success. - -The logo of the famous Software Fools Mediawiki, base of universal knowledge covering a broad range of topics: - -![](/DATA/sf/wikifool.jpg){.img-fluid} - -The software fools 2bit logo: - -![](/DATA/sf/logo_pixel.jpg){.img-fluid style="width:380px;'"} - -and some webdesign logos used mainly by nick for branding: - -![](/DATA/sf/webdesign1.jpg){.img-fluid} - -![](/DATA/sf/webdesign2.jpg){.img-fluid} - - - - diff --git a/080_blog/00025_Open-Source-Gaming-on-Linux/index.md b/080_blog/00025_Open-Source-Gaming-on-Linux/index.md deleted file mode 100644 index 38a6311..0000000 --- a/080_blog/00025_Open-Source-Gaming-on-Linux/index.md +++ /dev/null @@ -1,33 +0,0 @@ -Open Source Linux Games -======================= - -May 22, 2015 - -Some of my favourite games from the 90ies are reimplemented as open-source software and work natively on Linux. - -## OpenTTD (Transport Tycoon Deluxe) -My beloved Transport Tycoon with many extra features and high resolution graphics. - -![](/DATA/linuxgames/ttd.png){style="width:50%"} - - -## Jagged Alliance 2 (ja2-straciatella) -“No cops, no courts, no jails, no law. You can count me in!” - -![](/DATA/linuxgames/ja2.jpg){style="width:50%"} - -## ScummVM -Script Creation Utility for Maniac Mansion! This supports a multitude of Lucas Arts (and not only) games. - -![](/DATA/linuxgames/sammax.png){style="width:50%"} - -## OpenRA -Supports a variety of the classical Westwood real-time strategy games. - -![](/DATA/linuxgames/ra.png){style="width:50%"} - -## More -Check out this external pages for even more games: - - [1] https://wiki.debian.org/Games/ - [2] http://osgameclones.com/ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/attack.png b/080_blog/00030_Computer-Games/00010_The-Old-Times/attack.png new file mode 100644 index 0000000..7c83d63 Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/attack.png differ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/attack.zip b/080_blog/00030_Computer-Games/00010_The-Old-Times/attack.zip new file mode 100644 index 0000000..2d09784 Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/attack.zip differ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/high1.png b/080_blog/00030_Computer-Games/00010_The-Old-Times/high1.png new file mode 100644 index 0000000..93ebf07 Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/high1.png differ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/high2.png b/080_blog/00030_Computer-Games/00010_The-Old-Times/high2.png new file mode 100644 index 0000000..c94a5ef Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/high2.png differ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/highway.zip b/080_blog/00030_Computer-Games/00010_The-Old-Times/highway.zip new file mode 100644 index 0000000..ffc7d7b Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/highway.zip differ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/index.md b/080_blog/00030_Computer-Games/00010_The-Old-Times/index.md new file mode 100644 index 0000000..192a1c7 --- /dev/null +++ b/080_blog/00030_Computer-Games/00010_The-Old-Times/index.md @@ -0,0 +1,54 @@ +Games from the past +=================== + + 1990ies + +## About this games + +I recently found this simple and stupid games from times long gone. +I coded them in the 90ies as a teenager. Their source code was fortunatelly lost. + +This DOS MZ exacutables will run fine in a DOSBox. + +## Highway + + Coded: 1999 + Tech: C, DJGPP compiler, Allegro library + +A unique combination of Frogger and the original GTA, which it was probably +inspired by. Control your vehicle with the arrow keys without crashing, +as long as possible. + +Download: [highway.zip](highway.zip) + +![](high1.png){.img-fluid style="width:300px;"} +![](high2.png){.img-fluid style="width:300px;"} + +## Under Attack + + Coded: Early 90ies + Tech: QBasic + +Originally I coded this game for the TI-83 caluclator, later reimplementing +it for my PC **in colors**. As the commander of a the mighty battleship _HMS Miguel_ you need +to use the arrow keys to evade enemy missiles fired from the deepness of the ocean, +by enemy submarines. + +Download: [attack.zip](attack.zip) + +![](attack.png){.img-fluid style="width:300px;"} + +## Operation Naval Storm + + Coded: 1996 + Tech: QBasic + +Another naval warfare classic, based on the well known *Sea Battle* game, played on +paper grids. In this advanced version every player places only one single +ship, measuring 1x1 in size. Try to outperform the brilliant AI. + +![](naval1.png){.img-fluid style="width:300px;"} +![](naval2.png){.img-fluid style="width:300px;"} + +Download: [naval.zip](naval.zip) + diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/naval.zip b/080_blog/00030_Computer-Games/00010_The-Old-Times/naval.zip new file mode 100644 index 0000000..6155a1e Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/naval.zip differ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/naval1.png b/080_blog/00030_Computer-Games/00010_The-Old-Times/naval1.png new file mode 100644 index 0000000..d351629 Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/naval1.png differ diff --git a/080_blog/00030_Computer-Games/00010_The-Old-Times/naval2.png b/080_blog/00030_Computer-Games/00010_The-Old-Times/naval2.png new file mode 100644 index 0000000..fb45276 Binary files /dev/null and b/080_blog/00030_Computer-Games/00010_The-Old-Times/naval2.png differ diff --git a/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-ASCII-Bars.png b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-ASCII-Bars.png new file mode 100644 index 0000000..812e22e Binary files /dev/null and b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-ASCII-Bars.png differ diff --git a/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Animated-Display-Setup.png b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Animated-Display-Setup.png new file mode 100644 index 0000000..e923382 Binary files /dev/null and b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Animated-Display-Setup.png differ diff --git a/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-LCD-Panels.png b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-LCD-Panels.png new file mode 100644 index 0000000..26ef16b Binary files /dev/null and b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-LCD-Panels.png differ diff --git a/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Pixel-Display.png b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Pixel-Display.png new file mode 100644 index 0000000..fc50dd0 Binary files /dev/null and b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/Space-Engineers-Pixel-Display.png differ diff --git a/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md new file mode 100644 index 0000000..7786555 --- /dev/null +++ b/080_blog/00030_Computer-Games/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md @@ -0,0 +1,325 @@ +###>>>KWD Space Engineers Pixel Display, Space Engineers Font, Monospaced +###>>>DSC A Pixel precise Display for Space Engineers including a custom monospaced Font. +# Monospaced Font and Pixel Display for Space Engineers +

September 23, 2016

+
+![](Space-Engineers-Pixel-Display.png){.img-fluid .rounded alt="Closeup of standard Space Engineers LCD Panel, showing pink letters. Single Pixels can be determined." title="Pink is the color of passion"} +
+Standard LCD Panel displaying monospaced text. +
+
+ +## Pixel Precise Font + +For everyone suffering from the lack of monospaced fonts and pixel-based +displays in Space Engineers here I share my simple, yet effective solution: +A simple helper class in C#, which I wrote yesterday night to solve this +particular problem. As a bonus this also enabled using the LCD Screens +for arbitrary pixel-precise output, even with animations, as you will +see later. + +Have fun and feel free to improve it! + +The class can be easily embedded in your programmable blocks and allows simulating pixel-precise displays on the LCD and Text Panels. The class also ships with a beautiful set of retro-style compile time mono-spaced fonts. + +First admire a few screenshot to get a first impression: + +
+![](Space-Engineers-ASCII-Bars.png){.img-fluid .rounded alt="A Space Engineers Console showcasing our Font. It displays some ASCII styled bars." title="The Monospaced Font in Action."} +
+Status bars showing normal and inverted font. +
+
+ +
+![](Space-Engineers-LCD-Panels.png){.img-fluid .rounded alt="Two adjacent Space Engineers Consoles. One shows a sinus wave, demonstrating pixel precise output."} +
+The Display to the right demonstrates animated pixel precise output. +
+
+ +The class exposes the following public methods: + +* Screen constructor +* pixelOn +* draw_rect +* put_letter +* put_letter_inv // inverted single letter +* put_text +* put_text_inv // inverted text +* update // updates lcd or text panel + +## Pixel Display supports Animations + +
+![](Space-Engineers-Animated-Display-Setup.png){.img-fluid .rounded alt="Complete setup with 3 Panels a timer block and a programmable block"} +
+A complete Setup featuring 3 LCD Panels and supporting blocks. +
+
+ +With a timer block this approach can be used for beautiful animations too! + +The solution is based on emulating pixels using very small fonts ~0.2 on regular LCD Panels. I use ‘[‘ and ‘.’ here, since they both have the same widths and work quite well to emulate on/off pixels. + + +Usage of the class is easy and straigth forward from your Main function: + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} +// construct a new Screen class instace providing +// the label of your panel and dimensions. +Screen s = new Screen("Your_LCD_1",215,59,this); + +// put text on specified pixel coordinates +s.put_text(10,10," Welcome to the Machine "); + +// refresh the LCD Panel +s.update(); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +## C Sharp Class for the Space Engineers Font + +And this is the C# class behind it. You will have to copy it into your programmable blocks. (Let me know if there is a more elegant way?) + +Sidenote: If you wonder how I generated this numbers inside the letters array, you can read it in this seperate post about bitmap fonts generation. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} +class Screen +{ + + public int width; + public int height; + + IMyTextPanel panel; + + char mark_pixel='['; + char mark_empty='.'; + + static MyGridProgram programm; + string output; + + public Screen(string panel_name, int _width, int _height, MyGridProgram programRef) + { + width=_width; + height=_height; + programm=programRef; + panel=programm.GridTerminalSystem.GetBlockWithName(panel_name) as IMyTextPanel; + + output=new string(' ',0); + for(int y=0;y=(letter & (int)Math.Pow(2,24-(i+j*5)) )) + pixelOn(x+i,y+j); + } + + public void update() + { + panel.WritePublicText(output, false); + } + + // monospace fonts starting from 0x20 (space) + static readonly int[] letters = + { + 0,4329476,10813440,11512810,16398526,17895697,6632015,4325376,2232450,8523912, + 22483413,4357252,68,31744,4,1118480,15390382,4608142,15239320,31504446, + 1841462,33060926,33062463,32540808,33095231,33094719,131200,131208,2236546, + 1016800,8521864,32051204,15392270,33095217,32045630,33047071,32032318, + 33061407,33062416,33050175,18415153,14815374,14748236,20673235,17318431,18732593,18667121, + 15255086,32045584,15259213,32045779,33299071,32641156,18400814,18393412,18405233,18157905,18157700, + 32575775,14950670,17043521,14747726,4539392,31,6389760,33095217,32045630, + 33047071,32032318,33061407,33062416,33050175,18415153,14815374,14748236, + 20673235,17318431,18732593,18667121,15255086,32045584,15259213,32045779,33299071, + 32641156,18400814,18393412,18405233,18157905,18157700,32575775,2240642,4329604 + 8525960,14016, + }; + +}; + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +## Source Code used for Example Screenshots above + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} +static int cnt=0; // programm counter + +public void Main(string argument) +{ + // increase programm counter + cnt+=1; + if (cnt>100) cnt= 0; + + // init our screen class: new 438x59 screen + Screen s = new Screen("Miguel_LCD_1",(int)(438*1.5),(int)(59*1.5),this); + + // draw some rectangles + s.draw_rect(0,0,s.width,s.height); + s.draw_rect(2,2,s.width-4,s.height-4); + + //draw more rectangles (stress testing only) + // for(int i=4; i<35; i+=2) + // { + // s.draw_rect(i,i,s.width-2*i,s.height-2*i); + // } + + // write counter value + s.put_text(8,5,"counter: "+cnt); + + // inverted text + s.put_text_inv(8,12,"SOME INVERTED TEXT --- "); + + + // paint a sinus wave + for(int i=0;i200)s.pixelOn(i,(int)(s.height/2+s.height/3*Math.Sin((i+cnt)/25.0))); + } + + // paint individual letters along a sinus + string txt=new string(' ',0); + txt="! software fools rules the waves!"; + + for(int i=0;i<=;'~^\n"+ + " %#@!~?{}[]-+*&`.,:'"); + + s3.draw_rect(0,0,s3.width,s3.height); + s3.draw_rect(2,2,s3.width-4,s3.height-4); + + s2.put_text(10,1, +"Something......[|||||||||| ] 10%\n"+ +"Foo............[||| ] 33%\n"+ +"Bar............[||| ] 99%\n"+ +"Something else.[||||||||||I ] 05%\n" +); + +s2.put_text_inv(10,35, +"Something......[|||||||||| ] 10%\n"+ +"Foo............[||| ] 33%\n"+ +"Bar............[||| ] 99%\n"+ +"Something else.[||||||||||I ] 05%\n" +); + +s2.put_text(10,65, +"copyright by softwarefools.com" +); + + s2.update(); + s3.update(); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +## Helpful Comment on improving Performance + + JR Raynal + December 13, 2017 at 9:29 am + +Hi, I was playing with your script, and found it super slow… which is odd given the performances of other scripts out there. Turns out by switching the output from a string to a StringBuilder, you don’t need to copy them around as much. I assume this is the fix because I experienced a serious speed increase with that! + +Here is the rewritten snippet: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} + + StringBuilder output; + + public Screen(string panel_name, int _width, int _height, MyGridProgram programRef) + { + width = _width; + height = _height; + programm = programRef; + panel = programm.GridTerminalSystem.GetBlockWithName(panel_name) as IMyTextPanel; + + output = new StringBuilder(); + for (int y = 0; y < height; y++) + { + output.Append(mark_empty, width); + output.Append('\n'); + } + } + + public void pixelOn(int x, int y) + { + output[y * (width + 1) + x] = mark_pixel; + } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +## TODOS + +cleanup and optimize code!!, move sources to git repo, use some kind of syntax highlihter on this post. allow other font-sets with other sizes and let the user adjust spacing, publish python font converter in another post. diff --git a/080_blog/00030_Computer-Games/index.md b/080_blog/00030_Computer-Games/index.md new file mode 100644 index 0000000..914d7d3 --- /dev/null +++ b/080_blog/00030_Computer-Games/index.md @@ -0,0 +1,4 @@ +Computer Games +============== +This section holds various content related to computer games. +Be it simple games, mods or notes ... diff --git a/080_blog/00035_Trumpet-in-Blender/index.md b/080_blog/00035_Trumpet-in-Blender/index.md deleted file mode 100644 index e1a9953..0000000 --- a/080_blog/00035_Trumpet-in-Blender/index.md +++ /dev/null @@ -1,25 +0,0 @@ -hear the trumpets hear the pipers -================================= - November 9, 2017 -Today morning I was playing with blender’s cycles “material nodes”, the “sub-surf modifier” and the “depth of field” camera setting. - -I modeled a simple trumpet by extruding some cylinders and used the Diffuse and Glossy shaders for the trumpet, as well as a Wave texture for the marble surface. - -**Extruded** and scaled some basic **cylinders** to get a simple (yet unfinished) trumpet: - -![](/DATA/3d/trumpet/1.png){.img-fluid} - -Added **materials**: - -![](/DATA/3d/trumpet/2.png){.img-fluid} - -Added the **subsurf** modifier: - -![](/DATA/3d/trumpet/3.png){.img-fluid} - -Configured **depth of field**: - -![](/DATA/3d/trumpet/4.png){.img-fluid} - -Voila, ... it's alpha and omega's kingdom come. - diff --git a/080_blog/00040_Graham-Scan-(Haskell)/index.md b/080_blog/00040_Graham-Scan-(Haskell)/index.md deleted file mode 100644 index 195dbe1..0000000 --- a/080_blog/00040_Graham-Scan-(Haskell)/index.md +++ /dev/null @@ -1,128 +0,0 @@ -Haskell – Convex Hull – Graham Scan -=================================== - -December 16, 2017 - -Playing with Convex Hulls (via Graham Scan) and SVG Export in Haskell: - -This is an embedded SVG generated by the Haskell programm below: - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} ---------------------------------------------------------------------------------------------- --- --- GRAHAM SCAN IMPLEMENTATION --- --- This little haskell programm calulates the Convex Hull for a set of 2D points. --- It ships wit a main function that feeds the Graham Scan algorithm with some --- random points and generates a simple SVG of the input points and resulting envelope. --- A simple SVG encoder is included. --- --- Alogrithm used: https://en.wikipedia.org/wiki/Graham_scan --- --- CREDITS -- --- --- Michal Idziorek --- 16 December 2017 --- ---------------------------------------------------------------------------------------------- - -import Data.List -import System.Random - ---------------------------------------------------------------------------------------------- - --- GRAHAM SCAN -- - --- Three points are clockwise if ccw < 0. -ccw (p1x,p1y) (p2x,p2y) (p3x,p3y) = (p2x - p1x)*(p3y - p1y) - (p2y - p1y)*(p3x - p1x) - --- Calculate the slope defined by 2 points. (return Infinity, if points are identical). -slope (ax,ay) (bx,by) | (ax,ay ) == (bx,by) = 1/0 -- Infinity - | otherwise = (bx-ax)/(by-ay) - --- Comparison function to sort points counterclockwise (given a reference point). -slope_cmp a b c = compare (slope a c) (slope a b) - --- Comparison function using the y and x coordinates for ordering. -graham_cmp (ax,ay) (bx,by) | ay /= by = compare ay by - | otherwise = compare ax bx - --- Graham scan on prepared data. this will calculate the convex hull. -graham_calc [] hs = hs -graham_calc (x1:xs) hh | length(hh) < 2 = graham_calc xs (x1:hh) -graham_calc xx@(x1:xs) hh@(h1:h2:hs) | ccw x1 h1 h2 < 0 = graham_calc xs (x1:hh) - | otherwise = graham_calc xx (h2:hs) - --- Find the starting point, sort all points counterclockwise and perform the graham scan. -graham xs = graham_calc sortedPoints [] - where minPoint = minimumBy graham_cmp xs - sortedPoints = sortBy (slope_cmp minPoint) xs - ---------------------------------------------------------------------------------------------- - --- XML ENCODING-- - -xml_attr (x:xs) = x++"=\""++(head xs)++"\" " -xml_enc tag attrs body = "<"++tag++" "++xml_attrs++">"++body++"" - where xml_attrs = unlines $ map xml_attr attrs - --- SVG ENCODING -- - --- hardcoded scaling and panning function -svg_transf x = x*30+5 - -line_to_svg ((x1,y1),(x2,y2)) = xml_enc "line" [["x1",show lx1],["y1",show ly1], - ["x2",show lx2],["y2",show ly2], - ["style", "stroke:rgb(255,0,0);stroke-width:2"]] "" - where lx1=svg_transf x1 - lx2=svg_transf x2 - ly1=svg_transf y1 - ly2=svg_transf y2 - -point_to_svg (x,y) = xml_enc "circle" [["cx",show cx],["cy",show cy],["r","5"], - ["fill","rgb(30,150,"++(show (floor dist))++")"]] "" - where cx=svg_transf x - cy=svg_transf y - dist= (sqrt ((x-5)*(x-5) + (y-5)*(y-5)))*255/8 - - - --- draws SVG points and lines (in hardcoded sizes and colors) -svg_draw p l = xml_enc "svg" [style,["width","330"],["height","330"]] body - where style = ["style", - "background-color:black;border:3px solid green;margin:2px;"] - body = (unlines (map point_to_svg p )) ++ - (unlines (map line_to_svg l )) - --- calculate convex hull and generate svg -svg_graham xs = svg_draw xs (zip hull hull_open) - where hull_open = graham xs - hull = (last hull_open) : hull_open - --- RANDOMIZING -- - -randomPoints g cnt = take cnt (zip r10a r10b) - where r5 = randomRs (0,5) g :: [Double] - r10a =zipWith (+) r5 (drop cnt r5) - r10b =zipWith (+) (drop (2*cnt) r5) (drop (3*cnt) r5) - ---------------------------------------------------------------------------------------------- - --- MAIN -- - --- Note that this is the only place of impurity in this source-file. --- Is is subject to side effects due to I/O (we are writng to stdout) --- and the random number generator. -main = do - g <- newStdGen - putStr (svg_graham (randomPoints g 25)) - putStr (svg_graham (randomPoints g 50)) - putStr (svg_graham (randomPoints g 100)) - putStr (svg_graham (randomPoints g 250)) - putStr (svg_graham (randomPoints g 500)) - putStr (svg_graham (randomPoints g 1500)) - ---------------------------------------------------------------------------------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/080_blog/00040_Haskell-Projects/00040_Graham-Scan-(Haskell)/index.md b/080_blog/00040_Haskell-Projects/00040_Graham-Scan-(Haskell)/index.md new file mode 100644 index 0000000..195dbe1 --- /dev/null +++ b/080_blog/00040_Haskell-Projects/00040_Graham-Scan-(Haskell)/index.md @@ -0,0 +1,128 @@ +Haskell – Convex Hull – Graham Scan +=================================== + +December 16, 2017 + +Playing with Convex Hulls (via Graham Scan) and SVG Export in Haskell: + +This is an embedded SVG generated by the Haskell programm below: + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +--------------------------------------------------------------------------------------------- +-- +-- GRAHAM SCAN IMPLEMENTATION +-- +-- This little haskell programm calulates the Convex Hull for a set of 2D points. +-- It ships wit a main function that feeds the Graham Scan algorithm with some +-- random points and generates a simple SVG of the input points and resulting envelope. +-- A simple SVG encoder is included. +-- +-- Alogrithm used: https://en.wikipedia.org/wiki/Graham_scan +-- +-- CREDITS -- +-- +-- Michal Idziorek +-- 16 December 2017 +-- +--------------------------------------------------------------------------------------------- + +import Data.List +import System.Random + +--------------------------------------------------------------------------------------------- + +-- GRAHAM SCAN -- + +-- Three points are clockwise if ccw < 0. +ccw (p1x,p1y) (p2x,p2y) (p3x,p3y) = (p2x - p1x)*(p3y - p1y) - (p2y - p1y)*(p3x - p1x) + +-- Calculate the slope defined by 2 points. (return Infinity, if points are identical). +slope (ax,ay) (bx,by) | (ax,ay ) == (bx,by) = 1/0 -- Infinity + | otherwise = (bx-ax)/(by-ay) + +-- Comparison function to sort points counterclockwise (given a reference point). +slope_cmp a b c = compare (slope a c) (slope a b) + +-- Comparison function using the y and x coordinates for ordering. +graham_cmp (ax,ay) (bx,by) | ay /= by = compare ay by + | otherwise = compare ax bx + +-- Graham scan on prepared data. this will calculate the convex hull. +graham_calc [] hs = hs +graham_calc (x1:xs) hh | length(hh) < 2 = graham_calc xs (x1:hh) +graham_calc xx@(x1:xs) hh@(h1:h2:hs) | ccw x1 h1 h2 < 0 = graham_calc xs (x1:hh) + | otherwise = graham_calc xx (h2:hs) + +-- Find the starting point, sort all points counterclockwise and perform the graham scan. +graham xs = graham_calc sortedPoints [] + where minPoint = minimumBy graham_cmp xs + sortedPoints = sortBy (slope_cmp minPoint) xs + +--------------------------------------------------------------------------------------------- + +-- XML ENCODING-- + +xml_attr (x:xs) = x++"=\""++(head xs)++"\" " +xml_enc tag attrs body = "<"++tag++" "++xml_attrs++">"++body++"" + where xml_attrs = unlines $ map xml_attr attrs + +-- SVG ENCODING -- + +-- hardcoded scaling and panning function +svg_transf x = x*30+5 + +line_to_svg ((x1,y1),(x2,y2)) = xml_enc "line" [["x1",show lx1],["y1",show ly1], + ["x2",show lx2],["y2",show ly2], + ["style", "stroke:rgb(255,0,0);stroke-width:2"]] "" + where lx1=svg_transf x1 + lx2=svg_transf x2 + ly1=svg_transf y1 + ly2=svg_transf y2 + +point_to_svg (x,y) = xml_enc "circle" [["cx",show cx],["cy",show cy],["r","5"], + ["fill","rgb(30,150,"++(show (floor dist))++")"]] "" + where cx=svg_transf x + cy=svg_transf y + dist= (sqrt ((x-5)*(x-5) + (y-5)*(y-5)))*255/8 + + + +-- draws SVG points and lines (in hardcoded sizes and colors) +svg_draw p l = xml_enc "svg" [style,["width","330"],["height","330"]] body + where style = ["style", + "background-color:black;border:3px solid green;margin:2px;"] + body = (unlines (map point_to_svg p )) ++ + (unlines (map line_to_svg l )) + +-- calculate convex hull and generate svg +svg_graham xs = svg_draw xs (zip hull hull_open) + where hull_open = graham xs + hull = (last hull_open) : hull_open + +-- RANDOMIZING -- + +randomPoints g cnt = take cnt (zip r10a r10b) + where r5 = randomRs (0,5) g :: [Double] + r10a =zipWith (+) r5 (drop cnt r5) + r10b =zipWith (+) (drop (2*cnt) r5) (drop (3*cnt) r5) + +--------------------------------------------------------------------------------------------- + +-- MAIN -- + +-- Note that this is the only place of impurity in this source-file. +-- Is is subject to side effects due to I/O (we are writng to stdout) +-- and the random number generator. +main = do + g <- newStdGen + putStr (svg_graham (randomPoints g 25)) + putStr (svg_graham (randomPoints g 50)) + putStr (svg_graham (randomPoints g 100)) + putStr (svg_graham (randomPoints g 250)) + putStr (svg_graham (randomPoints g 500)) + putStr (svg_graham (randomPoints g 1500)) + +--------------------------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/080_blog/00040_Haskell-Projects/00065_Base64-Encoder-(Haskell)/index.md b/080_blog/00040_Haskell-Projects/00065_Base64-Encoder-(Haskell)/index.md new file mode 100644 index 0000000..830ed8d --- /dev/null +++ b/080_blog/00040_Haskell-Projects/00065_Base64-Encoder-(Haskell)/index.md @@ -0,0 +1,51 @@ +Miguel's Naive Base64 Encoder +============================== + February 19, 2018 + +Coded on a winter afterfnoon on 19th Feb 2018 A.D. to fully understand +base64 encoding and play with haskell, which is always an indisputable +pleasure. + +The following lines were written in full awareness that 'libraries' for +this very purpose, which perform way better, are in existence. + +Coded in big anger due to nick's stories about saving his binary format, +encrypted passwords in an ascii config file, featuring +strange letters and characters. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +-- File: base64.hs -- + +import Data.Char +import Text.Printf +import qualified Data.List as L +import qualified Data.List.Split as T + +toBase64 x = maskBase64 x . toBase64core . asciiToBin . binFill $ x +toBase64core = map base64toDigit . map binToDec . T.chunksOf 6 + +base64toDigit x = (['A'..'Z']++['a'..'z']++['0'..'9']++['+','/']) !! x +binToDec = sum . map (2^) . L.findIndices (=='1') . reverse +asciiToBin = concat . map (\y -> printf "%08b" y) . map ord +binFill x = x ++ (take (fill64length x) $ cycle "\000") + +maskBase64 o x = take (length x - l ) x ++ (take l $ cycle "=") + where l = (fill64length o) + +fill64length x | m==0 = 0 + | otherwise = 3-m + where m=mod (length x) 3 + +main = do + line <- getLine + putStrLn $ toBase64 line +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Example usage, with decoding via `base64 -d` + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.bash} +miguel@megaloman:~$ echo -n "secret haskell" | runghc base64.hs +c2VjcmV0IGhhc2tlbGw= +miguel@megaloman:~$ echo -n "c2VjcmV0IGhhc2tlbGw=" | base64 -d # decode to check +secret haskell +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/080_blog/00040_Haskell-Projects/00120_Lambda-Calculus-(Haskell)/index.md b/080_blog/00040_Haskell-Projects/00120_Lambda-Calculus-(Haskell)/index.md new file mode 100644 index 0000000..25c6b83 --- /dev/null +++ b/080_blog/00040_Haskell-Projects/00120_Lambda-Calculus-(Haskell)/index.md @@ -0,0 +1,38 @@ +Lambda Calculus +=============== + + May 2, 2018 + +Playing with Type Quantifiers and Haskell's Rank 2 Type Polymorphsim, +implementing Boolean logic from scratch. We use the conventional +definitions for `True` an `False` also known as Church booleans, after Alonzo Church, who +intruced them along Lambda Calculus in the 1930s [1]. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +{-# LANGUAGE Rank2Types #-} + +fTrue :: forall a. a->a->a +fTrue x y = x + +fFalse :: forall a. a->a->a +fFalse x y = y + +fAnd :: (forall a. a->a->a)->(forall a. a->a->a)->(forall a. a->a->a) +fAnd p q = p q p + +fOr :: (forall a. a->a->a)->(forall a. a->a->a)->(forall a. a->a->a) +fOr p q = p p q + +fNot :: (forall a. a->a->a)->(forall a. a->a->a) +fNot p = p fFalse fTrue + +ifThenElse :: (forall a. a->a->a)->(forall a. a->a->a) + ->(forall a. a->a->a)->(forall a. a->a->a) +ifThenElse p a b = p a b + +-- Example -- + +main = print $ (ifThenElse fFalse fFalse $ fAnd fTrue $ fNot fFalse) "T" "F" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + [1] https://en.wikipedia.org/wiki/Lambda_calculus diff --git a/080_blog/00040_Haskell-Projects/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md b/080_blog/00040_Haskell-Projects/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md new file mode 100644 index 0000000..9701481 --- /dev/null +++ b/080_blog/00040_Haskell-Projects/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md @@ -0,0 +1,29 @@ +Simple Calculator on Parsec and GTK +=================================== + + May 3, 2018 + +![](/DATA/haskell/calc/calc.png){.img-fluid .border} + +Today I implemented this simple stupid calulator as a side effect of playing +around with parsec [1] and haskells gtk3 [2] bindings, as well as glade [3] - +an interactive user interface designer. + +Source Files +------------ + +* [calc.hs](/DATA/haskell/calc/calc.hs) +* [calc.glade](/DATA/haskell/calc/calc.glade) + +calc.hs Listing +--------------- + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +{BEGIN:SOURCE} +./DATA/haskell/calc/calc.hs +{END:SOURCE} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + [1] https://hackage.haskell.org/package/parsec + [2] https://hackage.haskell.org/package/gtk3 + [3] https://glade.gnome.org/ diff --git a/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/SimpleSvg.hs b/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/SimpleSvg.hs new file mode 100644 index 0000000..7b44557 --- /dev/null +++ b/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/SimpleSvg.hs @@ -0,0 +1,179 @@ +-- +-- Miguel's Simple SVG Generator +-- +-- Author: Michal Idziorek +-- Last Update: May 11th, 2018 +-- + +{-# LANGUAGE ExistentialQuantification #-} + +module SimpleSvg ( + + svgExample1 -- predefined example canvas + -- you can generate the output string via: + -- putStr $ svgGenerate svgExample1 + + ,svgGenerate -- canvas to svg + + ,svgEmpty -- empty canvas + ,svgAdd -- add to canvas (single) + ,svgAddList -- add to canvas (list) + + ,svgCircle -- circle + ,svgLine -- line + ,svgTriangle -- trianvle + + ,svgFilledCircle -- filled circle + ,svgFilledLine -- filled line + ,svgFilledTriangle -- filled trianvle + + ,svgColor -- colors and shades of gray + ,svgRed + ,svgGreen + ,svgBlue + ,svgWhite + ,svgBlack + ,svgShGray + + + ,svgRedLine -- red line + ,svgBluePoint -- small blue circle + ,svgGreenTriangle -- green triangle + + + ) where + +-- CONFIG -- + +svgStrokeWidth = 2 + +-- EXAMPLE CANVAS -- + +-- Demonstrating how to add a few objects to a light gray 300x200 canvas + +svgExample1 = svgAddList (svgEmpty (svgShGray 200) 300 200) $ + [ svgRedLine (0,0) (200,200) + ,svgRedLine (300,0) (100,200) + ,svgBluePoint (33,133) + ,svgBluePoint (33,22) + ,svgBluePoint (66,25) + ,svgFilledTriangle svgBlack svgWhite (20,20) (100,100) (10,90) + ,svgFilledCircle svgWhite svgGreen (150,120) 30 + ]++ + map (svgBluePoint . (,) 250) [50,60..150] + + +-- SHAPES -- + +-- A few predefined shapes easing a quickstart as well as serving as an +-- example, for how to define them in your own code. + +svgRedLine = svgLine svgRed +svgBluePoint pos = svgCircle svgBlue pos 2 +svgGreenTriangle = svgTriangle svgGreen + + +-- Shape construction + +svgLine c (x1,y1) (x2,y2) = + svgShape c (SvgLine (svgCoord x1 y1) (svgCoord x2 y2)) + +svgCircle c (x,y) r = + svgShape c (SvgCircle (svgCoord x y) r) + +svgTriangle c (x1,y1) (x2,y2) (x3,y3)= + svgShape c (SvgTriangle (svgCoord x1 y1) (svgCoord x2 y2) (svgCoord x3 y3)) + +svgFilledLine c1 c2 (x1,y1) (x2,y2) = + svgFilledShape c1 c2 (SvgLine (svgCoord x1 y1) (svgCoord x2 y2)) + +svgFilledCircle c1 c2 (x,y) r = + svgFilledShape c1 c2 (SvgCircle (svgCoord x y) r) + +svgFilledTriangle c1 c2 (x1,y1) (x2,y2) (x3,y3)= + svgFilledShape c1 c2 (SvgTriangle (svgCoord x1 y1) (svgCoord x2 y2) (svgCoord x3 y3)) + +svgShape c1 = SvgPrim c1 (svgNoFill) +svgFilledShape c1 c2 = SvgPrim c1 (svgFill c2) + +-- CANVAS -- + +data SvgCanvas = SvgCanvas SvgColor Int Int [SvgPrim] + +svgEmpty c w h = SvgCanvas c w h [] +svgAdd (SvgCanvas c w h xs) x = SvgCanvas c w h (x:xs) +svgAddList (SvgCanvas c w h xs) ys = SvgCanvas c w h (reverse ys++xs) + +svgGenerate (SvgCanvas col width height prims) = + xml_enc "svg" [("height",show height),("width", show width), + ("style","background-color:"++svgGenColor col)] + body + where body = foldl f "" prims + f a x = primToSvg x++a + +-- COLORS -- + +-- color type along with a few predefined colors to work with + +newtype SvgColor = SvgColor (Int,Int,Int) +svgColor r g b = SvgColor (r,g,b) +svgRed = svgColor 255 0 0 +svgBlue = svgColor 0 0 255 +svgGreen = svgColor 0 255 0 +svgShGray v = svgColor v v v +svgBlack = svgShGray 0 +svgWhite = svgShGray 255 + +svgGenColor (SvgColor (r,g,b)) = "rgb("++show r++","++show g++","++show b++")" + +-- the fill color is wrapped inside a Maybe type, since it is optional + +newtype SvgFill = SvgFill (Maybe SvgColor) +svgFill col = SvgFill (Just col) +svgNoFill = SvgFill Nothing + +-- SHAPES -- + +-- A class for shapes that we want to transform into SVG +-- We define instances for circle, line and triangle +-- The 2D coordinates are wrapped inside a newtype SvgCoord + +newtype SvgCoord = SvgCoord (Double,Double) +svgCoord x y = SvgCoord (x,y) + +data SvgPrim = forall a.SvgPrimClass a => SvgPrim SvgColor SvgFill a + +class SvgPrimClass a where + getSvg :: a->(String,[(String,String)]) + +data SvgCircle = SvgCircle SvgCoord Double +instance SvgPrimClass SvgCircle where + getSvg (SvgCircle (SvgCoord (x,y)) r) = + ("circle", [("cx",show x),("cy",show y),("r",show r)]) + +data SvgLine = SvgLine SvgCoord SvgCoord +instance SvgPrimClass SvgLine where + getSvg (SvgLine (SvgCoord (x1,y1)) (SvgCoord (x2,y2))) = + ("line", [("x1",show x1),("y1",show y1), + ("x2",show x2),("y2",show y2)]) + +data SvgTriangle = SvgTriangle SvgCoord SvgCoord SvgCoord +instance SvgPrimClass SvgTriangle where + getSvg (SvgTriangle (SvgCoord (x1,y1)) (SvgCoord (x2,y2)) (SvgCoord (x3,y3))) = + ("polygon", [("points",pts)]) + where pts=show x1++","++show y1++" "++ + show x2++","++show y2++" "++ + show x3++","++show y3 + +-- transform single primitve to SVG +primToSvg (SvgPrim col (SvgFill fill) prim) = xml_enc tag (attrs++attrs2) "" + where (tag, attrs)=getSvg prim + attrs2=[ ("fill",maybe "none" svgGenColor fill) + ,("stroke",svgGenColor col) + ,("stroke-width",show svgStrokeWidth)] + +-- XML ENCODER -- + +xml_enc tag attrs body = "<"++tag++" "++xml_attrs++">"++body++"" + where xml_attrs = unlines $ map xml_attr attrs + xml_attr (a,v) = a++"=\""++v++"\" " diff --git a/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/index.md b/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/index.md new file mode 100644 index 0000000..8211ba2 --- /dev/null +++ b/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/index.md @@ -0,0 +1,31 @@ +A Minimalistic SVG Generator +============================ + + May 11, 2018 + + +A minimalistic SVG generator for my humble requirements. +They might grow someday however... + +The SVG in the following screenshot was generated from the following code +to demonstrate a simple use case. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +svgExample1 = svgAddList (svgEmpty (svgShGray 200) 300 200) $ + [ svgRedLine (0,0) (200,200) + ,svgRedLine (300,0) (100,200) + ,svgBluePoint (33,133) + ,svgBluePoint (33,22) + ,svgBluePoint (66,25) + ,svgFilledTriangle svgBlack svgWhite (20,20) (100,100) (10,90) + ,svgFilledCircle svgWhite svgGreen (150,120) 30 + ]++ + map (svgBluePoint . (,) 250) [50,60..150] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +![](svg.png){.img-fluid .border} + +Source Files +------------ + +* [SimpleSvg.hs](SimpleSvg.hs) diff --git a/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/svg.png b/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/svg.png new file mode 100644 index 0000000..d679fad Binary files /dev/null and b/080_blog/00040_Haskell-Projects/00140_Minimalistic-SVG-Generator-(Haskell)/svg.png differ diff --git a/080_blog/00040_Haskell-Projects/100_Static-Page-Maker-in-Haskell/index.md b/080_blog/00040_Haskell-Projects/100_Static-Page-Maker-in-Haskell/index.md new file mode 100644 index 0000000..0619078 --- /dev/null +++ b/080_blog/00040_Haskell-Projects/100_Static-Page-Maker-in-Haskell/index.md @@ -0,0 +1,121 @@ +# Static Haskell Website Creator - Miguel's Lair + + April 12, 2018 + +About two weeks ago, for personal reasons, I decided to switch my homepage +from a well known PHP driven CMS solution, to a light and static set +of html pages. + +I used this fact as a pretence to write my own simple static website +generator. And, Yes.. I know there are already hundereds of such genertors +out there, but I wanted to practice haskell and my masturbatory solution +fits in under 100 lines of code. (Including comments and type signatures) + +I use pandoc for all the heavy work, as syntax highlighting and conversion of +markdown to html, anyway. + +## Features + +* No Documentation +* No Database +* Sitemap derived from Directory Tree +* Simple Markdown Files for Content + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +-- +-- Staticus WWW - A minimalistic yet undocumented static website generator +-- coded in April 2018 by Michal Idziorek +-- + +module StaticusWWW where + +import Control.Exception +import Control.Monad.Reader +import Data.List +import Data.List.Split +import Data.List.Utils +import Data.Maybe +import Data.Text(pack,unpack) +import Data.Tree +import System.Directory +import Text.Pandoc + +-- generate a HTML link from a href & title +htmlLink :: String -> String -> String +htmlLink href title=""++replace "_" " " title++"" + +-- generate HTML breadcrumbs from a list of page titles +genBrc :: [String] -> String +genBrc b | length b < 2 = "" + | otherwise = fst $ foldl lnk ("",0) b + where lnk (a,c) v = (a++" / "++html c v,c+1) + html c = htmlLink (concat (replicate (length b-c-1) "../")) + +-- pure function that generates a single HTML page from: +-- a html template, description, keywords, breadcrumbs, topMenue & submenue +genPage :: String->String->String->[String]->[String]->[String]->String->String +genPage tmpl dsc kw brc top chld md = + foldr rplc tmpl (replacers content (menu "/" top) (menu "./" chld) (genBrc brc) title dsc kw) + where content = either (const "error") unpack res + where res = runPure $ do doc <- readMarkdown def{readerExtensions=(enableExtension Ext_raw_html pandocExtensions )} $ pack md + writeHtml5String def doc + rplc v = replace ("##" ++ fst v ++ "##") (snd v) + title = if null brc then "Home" else replace "_" " " $ last brc + menu p = foldr (fm p) "" + fm p s a = "
  • "++htmlLink (p++s) s ++"
  • "++a + replacers c m m2 b t d k= + [("CONTENT", c) + ,("LOGO", "/DATA/logo.png") + ,("STYLESHEET", "/DATA/style.css") + ,("SITE_TITLE", "Miguel's Lair") + ,("SITE_SUBTITLE", "
    where information sleepzzZZZzz ...") + ,("TITLE", t) + ,("DESCRIPTION", d) + ,("KEYWORDS", k) + ,("AUTHOR", "Michal Idziorek") + ,("MENU", m) + ,("SUB_MENU", m2) + ,("BREADCRUMBS", b) + ,("FOOTER", "(c) by Miguel 2018")] + +-- get list of subdirectories in given directory, with full relative path +getDirList :: FilePath -> IO [FilePath] +getDirList d = map ((d++"/")++) <$> listDirectory d + >>= filterM doesDirectoryExist + +-- sequence IO Action 'f' for each subdirectory of 'fp' recursively +trvDirTree :: FilePath -> (FilePath -> [FilePath] -> IO()) -> IO () +trvDirTree fp f = unfoldTreeM unf fp >>= sequence_ + where unf p = getDirList p >>= \s -> f p s >>= \l -> + return (return l, s) + +-- write the HTML page generated from current diectory by 'genPage' +wrtPage :: FilePath -> FilePath -> String -> [FilePath] -> FilePath -> [FilePath] -> IO () +wrtPage idx out tmpl top p chld = do + + when (not home) (createDirectory outdir) + + md <- readFile $ p ++ "/index.md" + cfg <- (map ((\(x:xs) -> (x,unwords xs)).words).lines) + <$> catch (readFile $ p++"/config") + ((\_ -> return "") :: IOException -> IO String) + + writeFile (outdir++"/index.html") + (genPage tmpl (lkp cfg "dsc") (lkp cfg "kwd") + brc (menu top) (if home then [] else menu chld) md) + + where home = outdir==out++"/" + remUnder = filter (not.null) . map (dropWhile(=='_').dropWhile(/='_')) + lkp cfg k = fromMaybe "" (lookup k cfg) + menu = remUnder . filter (not . isPrefixOf "00_") . map (last.splitOn "/") . sort + outdir = out ++ "/" ++ intercalate "/" brc + brc = remUnder $ splitOn "/" (drop (length idx) p) + +-- Main IO action: traverses index recursively and calls wrtPage in each +-- subdir, which in turn generates the output directories and html pages +main :: IO () +main = do tmpl <- readFile "./DATA/template.html" + top <- getDirList "./INDEX" + trvDirTree "./INDEX" (wrtPage "./INDEX" "./OUT" tmpl top) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + diff --git a/080_blog/00040_Haskell-Projects/index.md b/080_blog/00040_Haskell-Projects/index.md new file mode 100644 index 0000000..5a0766d --- /dev/null +++ b/080_blog/00040_Haskell-Projects/index.md @@ -0,0 +1,4 @@ +Haskell +======= + +Some of my small and tiny Haskell creations and notes. diff --git a/080_blog/00065_Base64-Encoder-(Haskell)/index.md b/080_blog/00065_Base64-Encoder-(Haskell)/index.md deleted file mode 100644 index 830ed8d..0000000 --- a/080_blog/00065_Base64-Encoder-(Haskell)/index.md +++ /dev/null @@ -1,51 +0,0 @@ -Miguel's Naive Base64 Encoder -============================== - February 19, 2018 - -Coded on a winter afterfnoon on 19th Feb 2018 A.D. to fully understand -base64 encoding and play with haskell, which is always an indisputable -pleasure. - -The following lines were written in full awareness that 'libraries' for -this very purpose, which perform way better, are in existence. - -Coded in big anger due to nick's stories about saving his binary format, -encrypted passwords in an ascii config file, featuring -strange letters and characters. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} --- File: base64.hs -- - -import Data.Char -import Text.Printf -import qualified Data.List as L -import qualified Data.List.Split as T - -toBase64 x = maskBase64 x . toBase64core . asciiToBin . binFill $ x -toBase64core = map base64toDigit . map binToDec . T.chunksOf 6 - -base64toDigit x = (['A'..'Z']++['a'..'z']++['0'..'9']++['+','/']) !! x -binToDec = sum . map (2^) . L.findIndices (=='1') . reverse -asciiToBin = concat . map (\y -> printf "%08b" y) . map ord -binFill x = x ++ (take (fill64length x) $ cycle "\000") - -maskBase64 o x = take (length x - l ) x ++ (take l $ cycle "=") - where l = (fill64length o) - -fill64length x | m==0 = 0 - | otherwise = 3-m - where m=mod (length x) 3 - -main = do - line <- getLine - putStrLn $ toBase64 line -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Example usage, with decoding via `base64 -d` - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.bash} -miguel@megaloman:~$ echo -n "secret haskell" | runghc base64.hs -c2VjcmV0IGhhc2tlbGw= -miguel@megaloman:~$ echo -n "c2VjcmV0IGhhc2tlbGw=" | base64 -d # decode to check -secret haskell -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/080_blog/00090_Miguels-KVM-Adventures/index.md b/080_blog/00090_Miguels-KVM-Adventures/index.md index 7f50c76..f69989b 100644 --- a/080_blog/00090_Miguels-KVM-Adventures/index.md +++ b/080_blog/00090_Miguels-KVM-Adventures/index.md @@ -122,7 +122,7 @@ Make sure to adapt the boot order in the os section by adding an appropriate lin ## Networking Since my primary interface to the virtual machines is SSH, reliable network connectivity is one of the primary foci. IPv4 addresses became scarse so we will not waste any for the host systems virbr1 or eth0. The following diagram illustrates my IPv4 setup of a simple arp proxy utilizing ipv4 forwarding. The guests use their public ipv4 addreses and the ips of the hosts gateway. -![](/DATA/kvm/ipv4.png){.img-fluid} +![](ipv4.png){.img-fluid} There is no need to save address space in case of IPv6 since we have a complete /64 IPv6 subnet at our disposal. While only a few guests are accessible by their IPv4 public addresses directly, we have virtually an infinite number of IPv6 addresses. Sidenote: One single /64 IPv6 subnet consists of 2^64 different addresses, which is over four billion times more than there are IPv4 addresses in the whole world! I use just the lower /65 half of our /64 subnet for the guests while the IPv6 address of the hosts NIC lies in the upper half. diff --git a/080_blog/00090_Miguels-KVM-Adventures/ipv4.png b/080_blog/00090_Miguels-KVM-Adventures/ipv4.png new file mode 100644 index 0000000..3dac4ed Binary files /dev/null and b/080_blog/00090_Miguels-KVM-Adventures/ipv4.png differ diff --git a/080_blog/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md b/080_blog/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md deleted file mode 100644 index 12afa86..0000000 --- a/080_blog/00100_Monospaced-Font-and-Pixel-Display-for-Space-Engineers/index.md +++ /dev/null @@ -1,325 +0,0 @@ -###>>>KWD Space Engineers Pixel Display, Space Engineers Font, Monospaced -###>>>DSC A Pixel precise Display for Space Engineers including a custom monospaced Font. -# Monospaced Font and Pixel Display for Space Engineers -

    September 23, 2016

    -
    -![](/images/Space-Engineers/Space-Engineers-Pixel-Display.png){.img-fluid .rounded alt="Closeup of standard Space Engineers LCD Panel, showing pink letters. Single Pixels can be determined." title="Pink is the color of passion"} -
    -Standard LCD Panel displaying monospaced text. -
    -
    - -## Pixel Precise Font - -For everyone suffering from the lack of monospaced fonts and pixel-based -displays in Space Engineers here I share my simple, yet effective solution: -A simple helper class in C#, which I wrote yesterday night to solve this -particular problem. As a bonus this also enabled using the LCD Screens -for arbitrary pixel-precise output, even with animations, as you will -see later. - -Have fun and feel free to improve it! - -The class can be easily embedded in your programmable blocks and allows simulating pixel-precise displays on the LCD and Text Panels. The class also ships with a beautiful set of retro-style compile time mono-spaced fonts. - -First admire a few screenshot to get a first impression: - -
    -![](/images/Space-Engineers/Space-Engineers-ASCII-Bars.png){.img-fluid .rounded alt="A Space Engineers Console showcasing our Font. It displays some ASCII styled bars." title="The Monospaced Font in Action."} -
    -Status bars showing normal and inverted font. -
    -
    - -
    -![](/images/Space-Engineers/Space-Engineers-LCD-Panels.png){.img-fluid .rounded alt="Two adjacent Space Engineers Consoles. One shows a sinus wave, demonstrating pixel precise output."} -
    -The Display to the right demonstrates animated pixel precise output. -
    -
    - -The class exposes the following public methods: - -* Screen constructor -* pixelOn -* draw_rect -* put_letter -* put_letter_inv // inverted single letter -* put_text -* put_text_inv // inverted text -* update // updates lcd or text panel - -## Pixel Display supports Animations - -
    -![](/images/Space-Engineers/Space-Engineers-Animated-Display-Setup.png){.img-fluid .rounded alt="Complete setup with 3 Panels a timer block and a programmable block"} -
    -A complete Setup featuring 3 LCD Panels and supporting blocks. -
    -
    - -With a timer block this approach can be used for beautiful animations too! - -The solution is based on emulating pixels using very small fonts ~0.2 on regular LCD Panels. I use ‘[‘ and ‘.’ here, since they both have the same widths and work quite well to emulate on/off pixels. - - -Usage of the class is easy and straigth forward from your Main function: - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} -// construct a new Screen class instace providing -// the label of your panel and dimensions. -Screen s = new Screen("Your_LCD_1",215,59,this); - -// put text on specified pixel coordinates -s.put_text(10,10," Welcome to the Machine "); - -// refresh the LCD Panel -s.update(); -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -## C Sharp Class for the Space Engineers Font - -And this is the C# class behind it. You will have to copy it into your programmable blocks. (Let me know if there is a more elegant way?) - -Sidenote: If you wonder how I generated this numbers inside the letters array, you can read it in this seperate post about bitmap fonts generation. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} -class Screen -{ - - public int width; - public int height; - - IMyTextPanel panel; - - char mark_pixel='['; - char mark_empty='.'; - - static MyGridProgram programm; - string output; - - public Screen(string panel_name, int _width, int _height, MyGridProgram programRef) - { - width=_width; - height=_height; - programm=programRef; - panel=programm.GridTerminalSystem.GetBlockWithName(panel_name) as IMyTextPanel; - - output=new string(' ',0); - for(int y=0;y=(letter & (int)Math.Pow(2,24-(i+j*5)) )) - pixelOn(x+i,y+j); - } - - public void update() - { - panel.WritePublicText(output, false); - } - - // monospace fonts starting from 0x20 (space) - static readonly int[] letters = - { - 0,4329476,10813440,11512810,16398526,17895697,6632015,4325376,2232450,8523912, - 22483413,4357252,68,31744,4,1118480,15390382,4608142,15239320,31504446, - 1841462,33060926,33062463,32540808,33095231,33094719,131200,131208,2236546, - 1016800,8521864,32051204,15392270,33095217,32045630,33047071,32032318, - 33061407,33062416,33050175,18415153,14815374,14748236,20673235,17318431,18732593,18667121, - 15255086,32045584,15259213,32045779,33299071,32641156,18400814,18393412,18405233,18157905,18157700, - 32575775,14950670,17043521,14747726,4539392,31,6389760,33095217,32045630, - 33047071,32032318,33061407,33062416,33050175,18415153,14815374,14748236, - 20673235,17318431,18732593,18667121,15255086,32045584,15259213,32045779,33299071, - 32641156,18400814,18393412,18405233,18157905,18157700,32575775,2240642,4329604 - 8525960,14016, - }; - -}; - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -## Source Code used for Example Screenshots above - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} -static int cnt=0; // programm counter - -public void Main(string argument) -{ - // increase programm counter - cnt+=1; - if (cnt>100) cnt= 0; - - // init our screen class: new 438x59 screen - Screen s = new Screen("Miguel_LCD_1",(int)(438*1.5),(int)(59*1.5),this); - - // draw some rectangles - s.draw_rect(0,0,s.width,s.height); - s.draw_rect(2,2,s.width-4,s.height-4); - - //draw more rectangles (stress testing only) - // for(int i=4; i<35; i+=2) - // { - // s.draw_rect(i,i,s.width-2*i,s.height-2*i); - // } - - // write counter value - s.put_text(8,5,"counter: "+cnt); - - // inverted text - s.put_text_inv(8,12,"SOME INVERTED TEXT --- "); - - - // paint a sinus wave - for(int i=0;i200)s.pixelOn(i,(int)(s.height/2+s.height/3*Math.Sin((i+cnt)/25.0))); - } - - // paint individual letters along a sinus - string txt=new string(' ',0); - txt="! software fools rules the waves!"; - - for(int i=0;i<=;'~^\n"+ - " %#@!~?{}[]-+*&`.,:'"); - - s3.draw_rect(0,0,s3.width,s3.height); - s3.draw_rect(2,2,s3.width-4,s3.height-4); - - s2.put_text(10,1, -"Something......[|||||||||| ] 10%\n"+ -"Foo............[||| ] 33%\n"+ -"Bar............[||| ] 99%\n"+ -"Something else.[||||||||||I ] 05%\n" -); - -s2.put_text_inv(10,35, -"Something......[|||||||||| ] 10%\n"+ -"Foo............[||| ] 33%\n"+ -"Bar............[||| ] 99%\n"+ -"Something else.[||||||||||I ] 05%\n" -); - -s2.put_text(10,65, -"copyright by softwarefools.com" -); - - s2.update(); - s3.update(); -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -## Helpful Comment on improving Performance - - JR Raynal - December 13, 2017 at 9:29 am - -Hi, I was playing with your script, and found it super slow… which is odd given the performances of other scripts out there. Turns out by switching the output from a string to a StringBuilder, you don’t need to copy them around as much. I assume this is the fix because I experienced a serious speed increase with that! - -Here is the rewritten snippet: - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.csharp .numberLines} - - StringBuilder output; - - public Screen(string panel_name, int _width, int _height, MyGridProgram programRef) - { - width = _width; - height = _height; - programm = programRef; - panel = programm.GridTerminalSystem.GetBlockWithName(panel_name) as IMyTextPanel; - - output = new StringBuilder(); - for (int y = 0; y < height; y++) - { - output.Append(mark_empty, width); - output.Append('\n'); - } - } - - public void pixelOn(int x, int y) - { - output[y * (width + 1) + x] = mark_pixel; - } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -## TODOS - -cleanup and optimize code!!, move sources to git repo, use some kind of syntax highlihter on this post. allow other font-sets with other sizes and let the user adjust spacing, publish python font converter in another post. diff --git a/080_blog/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md b/080_blog/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md deleted file mode 100644 index 01bbb09..0000000 --- a/080_blog/00105_GNU-Screen-Multiplexer-Keyboard-Shortcuts/index.md +++ /dev/null @@ -1,41 +0,0 @@ -GNU Screen - multiplexer - Keyboard Shortcuts ------------------------------------------ - - March 12, 2015 - - Invocation - $ screen [-S session_name] # simply start new session - $ screen -ls # lists sessions - $ screen -r session_name # resume detached session - $ screen -d -R session_name # resume session (also detach or create) - $ screen -d -RR #resume first session - - Shortcuts - ctrl-a c NEW WINDOW - ctrl-a n / ctrl-a p NEXT/PREVIOUS - ctrl-a d DETACH - ctrl-a D D DETACH and LOGOUT - - ctrl-a S SPLIT HORIZ. - ctrl-a | SPLIT VERTICAL - ctrl-a tab NEXT REGION - ctrl-x REMOVE REGION - ctrl-a q REMOVE ALL OTHER REGIONS - ctrl-a F FIT WINDOW - - ctrl-a c CLEAR SCREEN - ctrl-a k KILL WINDOW - ctrl-a \ QUIT - - ctrl-a esc COPY/SCROLLBACK MODE - - Layout Commands - ctrl-a : #enter command mode - :layout new [title] - :layout remove [n|title] - :layout next - :layout prev - :layout show #list layouts - - Ref - [1] $ man screen diff --git a/080_blog/0010_The-Old-Times/attack.png b/080_blog/0010_The-Old-Times/attack.png deleted file mode 100644 index 7c83d63..0000000 Binary files a/080_blog/0010_The-Old-Times/attack.png and /dev/null differ diff --git a/080_blog/0010_The-Old-Times/attack.zip b/080_blog/0010_The-Old-Times/attack.zip deleted file mode 100644 index 2d09784..0000000 Binary files a/080_blog/0010_The-Old-Times/attack.zip and /dev/null differ diff --git a/080_blog/0010_The-Old-Times/high1.png b/080_blog/0010_The-Old-Times/high1.png deleted file mode 100644 index 93ebf07..0000000 Binary files a/080_blog/0010_The-Old-Times/high1.png and /dev/null differ diff --git a/080_blog/0010_The-Old-Times/high2.png b/080_blog/0010_The-Old-Times/high2.png deleted file mode 100644 index c94a5ef..0000000 Binary files a/080_blog/0010_The-Old-Times/high2.png and /dev/null differ diff --git a/080_blog/0010_The-Old-Times/highway.zip b/080_blog/0010_The-Old-Times/highway.zip deleted file mode 100644 index ffc7d7b..0000000 Binary files a/080_blog/0010_The-Old-Times/highway.zip and /dev/null differ diff --git a/080_blog/0010_The-Old-Times/index.md b/080_blog/0010_The-Old-Times/index.md deleted file mode 100644 index 192a1c7..0000000 --- a/080_blog/0010_The-Old-Times/index.md +++ /dev/null @@ -1,54 +0,0 @@ -Games from the past -=================== - - 1990ies - -## About this games - -I recently found this simple and stupid games from times long gone. -I coded them in the 90ies as a teenager. Their source code was fortunatelly lost. - -This DOS MZ exacutables will run fine in a DOSBox. - -## Highway - - Coded: 1999 - Tech: C, DJGPP compiler, Allegro library - -A unique combination of Frogger and the original GTA, which it was probably -inspired by. Control your vehicle with the arrow keys without crashing, -as long as possible. - -Download: [highway.zip](highway.zip) - -![](high1.png){.img-fluid style="width:300px;"} -![](high2.png){.img-fluid style="width:300px;"} - -## Under Attack - - Coded: Early 90ies - Tech: QBasic - -Originally I coded this game for the TI-83 caluclator, later reimplementing -it for my PC **in colors**. As the commander of a the mighty battleship _HMS Miguel_ you need -to use the arrow keys to evade enemy missiles fired from the deepness of the ocean, -by enemy submarines. - -Download: [attack.zip](attack.zip) - -![](attack.png){.img-fluid style="width:300px;"} - -## Operation Naval Storm - - Coded: 1996 - Tech: QBasic - -Another naval warfare classic, based on the well known *Sea Battle* game, played on -paper grids. In this advanced version every player places only one single -ship, measuring 1x1 in size. Try to outperform the brilliant AI. - -![](naval1.png){.img-fluid style="width:300px;"} -![](naval2.png){.img-fluid style="width:300px;"} - -Download: [naval.zip](naval.zip) - diff --git a/080_blog/0010_The-Old-Times/naval.zip b/080_blog/0010_The-Old-Times/naval.zip deleted file mode 100644 index 6155a1e..0000000 Binary files a/080_blog/0010_The-Old-Times/naval.zip and /dev/null differ diff --git a/080_blog/0010_The-Old-Times/naval1.png b/080_blog/0010_The-Old-Times/naval1.png deleted file mode 100644 index d351629..0000000 Binary files a/080_blog/0010_The-Old-Times/naval1.png and /dev/null differ diff --git a/080_blog/0010_The-Old-Times/naval2.png b/080_blog/0010_The-Old-Times/naval2.png deleted file mode 100644 index fb45276..0000000 Binary files a/080_blog/0010_The-Old-Times/naval2.png and /dev/null differ diff --git a/080_blog/00110_Midnight-Commander-Cheatsheet/index.md b/080_blog/00110_Midnight-Commander-Cheatsheet/index.md deleted file mode 100644 index 5f9ed13..0000000 --- a/080_blog/00110_Midnight-Commander-Cheatsheet/index.md +++ /dev/null @@ -1,74 +0,0 @@ -###>>>KWD midnight commander cheatsheet, mc cheatsheet, mc shortcuts, midnight commander shortcuts -###>>>DSC Cheatsheet for Midnight Commander summarizing the most useful shortcuts. -Midnight Commander Cheatsheet -============================= - - June 07, 2018 - -A short cheatsheet summarizing midnight commander's most useful shortcut keys. - -Basic Navigation ----------------- -
    -
    tab
    -
    switch active panel
    -
    - -
    -
    up/down
    -
    select previous/next rown
    -
    -
    -
    return
    -
    open selected directory
    -
    -
    -
    alt-o
    -
    open selected directory on other panel
    -
    - - -View ----- -
    alt-. toggle hidden files
    -
    ctrl-o toggle console
    -
    alt-t toggle listing mode
    -
    alt-i sync with other panel
    -
    ctrl-u swap panels
    - -Miscellaneous -------------- - shift-f6 rename filling in the current name - insert/ctrl-t/+/\/* - selections - esc-tab auto complete - ctrl-enter / alt-enter - copy currently selected filename to console - Ctrl + Shift + Enter - copy full path - enter/f3/f4 - ??? how to have full control over behaviour.. debian? notes./. - xdg-mime default evince.desktop application/pdf - alias mc='EDITOR=vim' - - alt-shift-h show dir history - alt-y/alt-u (navigate history?) - - alt+?/alt-s/ctrl-s search - - ctrl-space calc size - ctrl - x c chmod - ctrl - x o chown - - alias mc='. /usr/libexec/mc/mc-wrapper.sh' - will stay in dir after exit - - Ref: http://klimer.eu/2015/05/01/use-midnight-commander-like-a-pro/ - man mc - ... - -NOTE: I run mc inside tmux and the shifted function keys did not work as -expected. Use midnight commanders Learn Keys dialog to fix this diff --git a/080_blog/00120_Lambda-Calculus-(Haskell)/index.md b/080_blog/00120_Lambda-Calculus-(Haskell)/index.md deleted file mode 100644 index 25c6b83..0000000 --- a/080_blog/00120_Lambda-Calculus-(Haskell)/index.md +++ /dev/null @@ -1,38 +0,0 @@ -Lambda Calculus -=============== - - May 2, 2018 - -Playing with Type Quantifiers and Haskell's Rank 2 Type Polymorphsim, -implementing Boolean logic from scratch. We use the conventional -definitions for `True` an `False` also known as Church booleans, after Alonzo Church, who -intruced them along Lambda Calculus in the 1930s [1]. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} -{-# LANGUAGE Rank2Types #-} - -fTrue :: forall a. a->a->a -fTrue x y = x - -fFalse :: forall a. a->a->a -fFalse x y = y - -fAnd :: (forall a. a->a->a)->(forall a. a->a->a)->(forall a. a->a->a) -fAnd p q = p q p - -fOr :: (forall a. a->a->a)->(forall a. a->a->a)->(forall a. a->a->a) -fOr p q = p p q - -fNot :: (forall a. a->a->a)->(forall a. a->a->a) -fNot p = p fFalse fTrue - -ifThenElse :: (forall a. a->a->a)->(forall a. a->a->a) - ->(forall a. a->a->a)->(forall a. a->a->a) -ifThenElse p a b = p a b - --- Example -- - -main = print $ (ifThenElse fFalse fFalse $ fAnd fTrue $ fNot fFalse) "T" "F" -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - [1] https://en.wikipedia.org/wiki/Lambda_calculus diff --git a/080_blog/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md b/080_blog/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md deleted file mode 100644 index 9701481..0000000 --- a/080_blog/00130_Calculator-on-Parsec-and-GTK-(Haskell)/index.md +++ /dev/null @@ -1,29 +0,0 @@ -Simple Calculator on Parsec and GTK -=================================== - - May 3, 2018 - -![](/DATA/haskell/calc/calc.png){.img-fluid .border} - -Today I implemented this simple stupid calulator as a side effect of playing -around with parsec [1] and haskells gtk3 [2] bindings, as well as glade [3] - -an interactive user interface designer. - -Source Files ------------- - -* [calc.hs](/DATA/haskell/calc/calc.hs) -* [calc.glade](/DATA/haskell/calc/calc.glade) - -calc.hs Listing ---------------- - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} -{BEGIN:SOURCE} -./DATA/haskell/calc/calc.hs -{END:SOURCE} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - [1] https://hackage.haskell.org/package/parsec - [2] https://hackage.haskell.org/package/gtk3 - [3] https://glade.gnome.org/ diff --git a/080_blog/00140_Minimalistic-SVG-Generator-(Haskell)/index.md b/080_blog/00140_Minimalistic-SVG-Generator-(Haskell)/index.md deleted file mode 100644 index b03fe16..0000000 --- a/080_blog/00140_Minimalistic-SVG-Generator-(Haskell)/index.md +++ /dev/null @@ -1,40 +0,0 @@ -A Minimalistic SVG Generator -============================ - - May 11, 2018 - - -A minimalistic SVG generator for my humble requirements. -They might grow someday however... - -The SVG in the following screenshot was generated from the following code -to demonstrate a simple use case. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} -svgExample1 = svgAddList (svgEmpty (svgShGray 200) 300 200) $ - [ svgRedLine (0,0) (200,200) - ,svgRedLine (300,0) (100,200) - ,svgBluePoint (33,133) - ,svgBluePoint (33,22) - ,svgBluePoint (66,25) - ,svgFilledTriangle svgBlack svgWhite (20,20) (100,100) (10,90) - ,svgFilledCircle svgWhite svgGreen (150,120) 30 - ]++ - map (svgBluePoint . (,) 250) [50,60..150] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -![](/DATA/haskell/svg/svg.png){.img-fluid .border} - -Source Files ------------- - -* [SimpleSvg.hs](/DATA/haskell/svg/SimpleSvg.hs) - -SimpleSvg.hs Listing ---------------- - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} -{BEGIN:SOURCE} -./DATA/haskell/svg/SimpleSvg.hs -{END:SOURCE} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/080_blog/00_Old-And-Outdated/00010_Monospace-Font-Bitmap-Generator/index.md b/080_blog/00_Old-And-Outdated/00010_Monospace-Font-Bitmap-Generator/index.md deleted file mode 100644 index 3df7719..0000000 --- a/080_blog/00_Old-And-Outdated/00010_Monospace-Font-Bitmap-Generator/index.md +++ /dev/null @@ -1,64 +0,0 @@ -monospaced font bitmaps -======================= - July 4, 2017 - -Since once in a while I have the need to generate my own simple bitmap fonts, which I might embed directly in my code (as in this little class, for example), today I publish this simple python script that will convert a textfile filled with ‘X’es and spaces into an array of integers - -* space = bit off -* ‘X’ = bit on - -![Example usage of bitmap fonts in my simple experimental FoolOS Operating System, which I might write about some other time.](/DATA/foolos.png){.img-fluid} - - -The script has some severe limitations but easily can be extended: - -* works for 5×5 bitmaps only -* every 6th lines is skipped (used for commenting) -* reads a file called “fonts.txt” from same directory - -~~~~~~~~~~~~~~~~~~~~~ {.bash .numberLines} -# filename: convert.py -f = open('fonts.txt','r'); - -i=0; -value=(2**25)-1; - -for line in f: - if (i % 6 ==0): - c=0; - if(i>0): - print(str(value)+","); - value=0 - else: - for j in range(0,5): - if j Account Settings -* In the Account-Actions Dropdown select New eMail Account -* Enter your full Name, your email address (also aliases work) and your password and click Continue -* Thunderbird will now try out typical mailserver settings, if this processis not succesfull or if you want to configure yourself click Manual Setting -* For the Incoming mailserver select IMAP. As server address Thunderbird will use the domain of the Mail adress entered above, complete it to imap.softwarefools.com (alternativly imap.yourdomain will also work). As Security Method select SSL/TSL at the Standard Port: 993. The Authentification Method should be set to: Password,normal. -* The Outgoing mailserver is of course an SMTP server, just complete the server address to smtp.softwarefools.com (alternativly smtp.yourdomain). As Security Method select STARTTSL at Port: 587. Authentification Method again should be set to: Password,normal -* The Usernames used for both servers are the full email address (e.g. name@domain), aliases will not work. - -#### Android Mail Client - -To add a new mail account to your Android mail client open settings and click on Add Account. Enter your mail-address and password and click Continue. The client will now ask what type of Mail account you would like to set up. Again we emphasize using IMAP.This choice is final in Android Mail Client, if you want to change the method you have to delete the mail account and create a new one. Android will now propose some settings for the Incoming Mailserver (the serveraddress will be composed of your method and the mails domain, the username will be the mailname,etc.), yet these are not yet correct. Complete the usernameto your full email address and select Securitytype SSL (accept all certificates) (on port 993). When clicking Continue the client will try out the settings and if correct continue to the outgoing mailserver settings. Again the client will propose some settings such as using the same username and password and again precompose the serveraddress. The only thing left to do is selecting the securitymethod: TLS (accept all certificates) (Port should be 587). On some newer Android Systems (5+) its possible to get repeated “Server not responding” messages if you try SSL (accept all certificates) on the incoming server directly. This can be fixed by using strict SSL once to get a “Certificate not valid” note and Then select SSL (accept all certificates). Same applies for TSL on the outgoing server. - -As accessing your mails with your mobile can be data intensive android mail client offers some additional settings on the next page of the configurator. You can select in what frame of time the mails should be synced with your phone and how often this synchronisation take place (ordinarily and in rush hours). The starting and ending time of your rush hours can be set for all your accounts in the clent properties. On the last page of the configurator you can name the mail account on your phone to better recognize it, and you have to enter the name displayed to an recipient of your mails. - -#### iPhone Mail Client - -Setting up a new Mail account on your iPhone works pretty much like on android device. Visit [1] for more information. - -#### Claws Mail - -The following was tested on my debian-wheezy system with Claws Mail version 3.8.1. - -* Configuration -> Create new account -* Basic: Name of Account: whatever -* Basic: Full name: whatever -* Basic: Mail address: user@domain.com -* Basic: Protocol: IMAP4 -* Basic: Server for receiving: mail.softwarefools.com -* Basic: SMTP server (send): mail.softwarefools.com -* Basic: User ID: user@domain.com -* Basic: Password: secret_password -* Receive: Authentication method: LOGIN -* Send: SMTP Authentication (SMTP AUTH): LOGIN -* SSL: IMAP4: Use SSL for IMAP4 connection -* SSL: Send (SMTP): Use STARTTLS command to start SSL session - -It might be necessery to rebuild your folder-tree: proceed as follows: - -* Right mouse-click on account main-folder -> -* Rebuild folder tree -> -* YES - -#### Mutt - -Ideally mutt will serve only the purpose of a MUA, outsourcing the retrieval of emails to a MRA (e.g. fechmail) and the relaying of emails to a MTA (e.g. postfix). Configuration is trivial in that case. Adapt your .muttrc as follows: - - set spoolfile=/var/mai/username - -You can also access your imap mails directly from within mutt: - - set imap_user=user@domain.com - set imap_pass=secret_password - set spoolfile=imaps://mail.softwarefools.com/INBOX - -#### Fetchmail - -For the simplest configuration of fetchmail as your MRA, add the following line to your .fetchmailrc (adapt user@domain.com, secret_password and local_username): - - poll mail.softwarefools.com protocol IMAP user "user@domain.com" there with password "secret_password" is local_username here ssl sslfingerprint '02:B0:72:78:F7:F1:28:40:C4:DB:37:3F:18:BB:E1:AF' fetchall - -#### Postfix - -In many scenarios it is recommended to use a seperate MTA (e.g. postfix) to relay your outgoing emails to remote hosts. If you decide to use postfix read on here: http://www.postfix.org/ - - diff --git a/080_blog/00_Old-And-Outdated/index.md b/080_blog/00_Old-And-Outdated/index.md deleted file mode 100644 index 3055918..0000000 --- a/080_blog/00_Old-And-Outdated/index.md +++ /dev/null @@ -1,5 +0,0 @@ -Old and Outdated -================ - -Here you can find some some old and outdtdated articles, please do not read them. -They are kept here only for historical reference reasons. diff --git a/080_blog/00_garbage/00010_Monospace-Font-Bitmap-Generator/index.md b/080_blog/00_garbage/00010_Monospace-Font-Bitmap-Generator/index.md new file mode 100644 index 0000000..3df7719 --- /dev/null +++ b/080_blog/00_garbage/00010_Monospace-Font-Bitmap-Generator/index.md @@ -0,0 +1,64 @@ +monospaced font bitmaps +======================= + July 4, 2017 + +Since once in a while I have the need to generate my own simple bitmap fonts, which I might embed directly in my code (as in this little class, for example), today I publish this simple python script that will convert a textfile filled with ‘X’es and spaces into an array of integers + +* space = bit off +* ‘X’ = bit on + +![Example usage of bitmap fonts in my simple experimental FoolOS Operating System, which I might write about some other time.](/DATA/foolos.png){.img-fluid} + + +The script has some severe limitations but easily can be extended: + +* works for 5×5 bitmaps only +* every 6th lines is skipped (used for commenting) +* reads a file called “fonts.txt” from same directory + +~~~~~~~~~~~~~~~~~~~~~ {.bash .numberLines} +# filename: convert.py +f = open('fonts.txt','r'); + +i=0; +value=(2**25)-1; + +for line in f: + if (i % 6 ==0): + c=0; + if(i>0): + print(str(value)+","); + value=0 + else: + for j in range(0,5): + if j Account Settings +* In the Account-Actions Dropdown select New eMail Account +* Enter your full Name, your email address (also aliases work) and your password and click Continue +* Thunderbird will now try out typical mailserver settings, if this processis not succesfull or if you want to configure yourself click Manual Setting +* For the Incoming mailserver select IMAP. As server address Thunderbird will use the domain of the Mail adress entered above, complete it to imap.softwarefools.com (alternativly imap.yourdomain will also work). As Security Method select SSL/TSL at the Standard Port: 993. The Authentification Method should be set to: Password,normal. +* The Outgoing mailserver is of course an SMTP server, just complete the server address to smtp.softwarefools.com (alternativly smtp.yourdomain). As Security Method select STARTTSL at Port: 587. Authentification Method again should be set to: Password,normal +* The Usernames used for both servers are the full email address (e.g. name@domain), aliases will not work. + +#### Android Mail Client + +To add a new mail account to your Android mail client open settings and click on Add Account. Enter your mail-address and password and click Continue. The client will now ask what type of Mail account you would like to set up. Again we emphasize using IMAP.This choice is final in Android Mail Client, if you want to change the method you have to delete the mail account and create a new one. Android will now propose some settings for the Incoming Mailserver (the serveraddress will be composed of your method and the mails domain, the username will be the mailname,etc.), yet these are not yet correct. Complete the usernameto your full email address and select Securitytype SSL (accept all certificates) (on port 993). When clicking Continue the client will try out the settings and if correct continue to the outgoing mailserver settings. Again the client will propose some settings such as using the same username and password and again precompose the serveraddress. The only thing left to do is selecting the securitymethod: TLS (accept all certificates) (Port should be 587). On some newer Android Systems (5+) its possible to get repeated “Server not responding” messages if you try SSL (accept all certificates) on the incoming server directly. This can be fixed by using strict SSL once to get a “Certificate not valid” note and Then select SSL (accept all certificates). Same applies for TSL on the outgoing server. + +As accessing your mails with your mobile can be data intensive android mail client offers some additional settings on the next page of the configurator. You can select in what frame of time the mails should be synced with your phone and how often this synchronisation take place (ordinarily and in rush hours). The starting and ending time of your rush hours can be set for all your accounts in the clent properties. On the last page of the configurator you can name the mail account on your phone to better recognize it, and you have to enter the name displayed to an recipient of your mails. + +#### iPhone Mail Client + +Setting up a new Mail account on your iPhone works pretty much like on android device. Visit [1] for more information. + +#### Claws Mail + +The following was tested on my debian-wheezy system with Claws Mail version 3.8.1. + +* Configuration -> Create new account +* Basic: Name of Account: whatever +* Basic: Full name: whatever +* Basic: Mail address: user@domain.com +* Basic: Protocol: IMAP4 +* Basic: Server for receiving: mail.softwarefools.com +* Basic: SMTP server (send): mail.softwarefools.com +* Basic: User ID: user@domain.com +* Basic: Password: secret_password +* Receive: Authentication method: LOGIN +* Send: SMTP Authentication (SMTP AUTH): LOGIN +* SSL: IMAP4: Use SSL for IMAP4 connection +* SSL: Send (SMTP): Use STARTTLS command to start SSL session + +It might be necessery to rebuild your folder-tree: proceed as follows: + +* Right mouse-click on account main-folder -> +* Rebuild folder tree -> +* YES + +#### Mutt + +Ideally mutt will serve only the purpose of a MUA, outsourcing the retrieval of emails to a MRA (e.g. fechmail) and the relaying of emails to a MTA (e.g. postfix). Configuration is trivial in that case. Adapt your .muttrc as follows: + + set spoolfile=/var/mai/username + +You can also access your imap mails directly from within mutt: + + set imap_user=user@domain.com + set imap_pass=secret_password + set spoolfile=imaps://mail.softwarefools.com/INBOX + +#### Fetchmail + +For the simplest configuration of fetchmail as your MRA, add the following line to your .fetchmailrc (adapt user@domain.com, secret_password and local_username): + + poll mail.softwarefools.com protocol IMAP user "user@domain.com" there with password "secret_password" is local_username here ssl sslfingerprint '02:B0:72:78:F7:F1:28:40:C4:DB:37:3F:18:BB:E1:AF' fetchall + +#### Postfix + +In many scenarios it is recommended to use a seperate MTA (e.g. postfix) to relay your outgoing emails to remote hosts. If you decide to use postfix read on here: http://www.postfix.org/ + + diff --git a/080_blog/00_garbage/00025_Open-Source-Gaming-on-Linux/index.md b/080_blog/00_garbage/00025_Open-Source-Gaming-on-Linux/index.md new file mode 100644 index 0000000..38a6311 --- /dev/null +++ b/080_blog/00_garbage/00025_Open-Source-Gaming-on-Linux/index.md @@ -0,0 +1,33 @@ +Open Source Linux Games +======================= + +May 22, 2015 + +Some of my favourite games from the 90ies are reimplemented as open-source software and work natively on Linux. + +## OpenTTD (Transport Tycoon Deluxe) +My beloved Transport Tycoon with many extra features and high resolution graphics. + +![](/DATA/linuxgames/ttd.png){style="width:50%"} + + +## Jagged Alliance 2 (ja2-straciatella) +“No cops, no courts, no jails, no law. You can count me in!” + +![](/DATA/linuxgames/ja2.jpg){style="width:50%"} + +## ScummVM +Script Creation Utility for Maniac Mansion! This supports a multitude of Lucas Arts (and not only) games. + +![](/DATA/linuxgames/sammax.png){style="width:50%"} + +## OpenRA +Supports a variety of the classical Westwood real-time strategy games. + +![](/DATA/linuxgames/ra.png){style="width:50%"} + +## More +Check out this external pages for even more games: + + [1] https://wiki.debian.org/Games/ + [2] http://osgameclones.com/ diff --git a/080_blog/00_garbage/index.md b/080_blog/00_garbage/index.md new file mode 100644 index 0000000..3055918 --- /dev/null +++ b/080_blog/00_garbage/index.md @@ -0,0 +1,5 @@ +Old and Outdated +================ + +Here you can find some some old and outdtdated articles, please do not read them. +They are kept here only for historical reference reasons. diff --git a/080_blog/0100_Webkit-Keyboardless-Navigation/index.md b/080_blog/0100_Webkit-Keyboardless-Navigation/index.md index a56a377..5299563 100644 --- a/080_blog/0100_Webkit-Keyboardless-Navigation/index.md +++ b/080_blog/0100_Webkit-Keyboardless-Navigation/index.md @@ -10,9 +10,9 @@ as a web extension. I use simple unix pipes for communication between the main thread and my webextension. -Please note that this is a work in progress! +__Please note that this is a work in progress!__ -You can take a look at both branches at my github repo: [https://github.com/miguelclean/surf-webext-dom](https://github.com/miguelclean/surf-webext-dom). +You can take a look at both branches at my git repo: [https://gitweb.softwarefools.com/?p=miguel/surf-webext-dom.git](https://gitweb.softwarefools.com/?p=miguel/surf-webext-dom.git). The DOM is manipulated on the fly by the browser without any JavaScript involved. diff --git a/080_blog/100_Static-Page-Maker-in-Haskell/index.md b/080_blog/100_Static-Page-Maker-in-Haskell/index.md deleted file mode 100644 index 0619078..0000000 --- a/080_blog/100_Static-Page-Maker-in-Haskell/index.md +++ /dev/null @@ -1,121 +0,0 @@ -# Static Haskell Website Creator - Miguel's Lair - - April 12, 2018 - -About two weeks ago, for personal reasons, I decided to switch my homepage -from a well known PHP driven CMS solution, to a light and static set -of html pages. - -I used this fact as a pretence to write my own simple static website -generator. And, Yes.. I know there are already hundereds of such genertors -out there, but I wanted to practice haskell and my masturbatory solution -fits in under 100 lines of code. (Including comments and type signatures) - -I use pandoc for all the heavy work, as syntax highlighting and conversion of -markdown to html, anyway. - -## Features - -* No Documentation -* No Database -* Sitemap derived from Directory Tree -* Simple Markdown Files for Content - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} --- --- Staticus WWW - A minimalistic yet undocumented static website generator --- coded in April 2018 by Michal Idziorek --- - -module StaticusWWW where - -import Control.Exception -import Control.Monad.Reader -import Data.List -import Data.List.Split -import Data.List.Utils -import Data.Maybe -import Data.Text(pack,unpack) -import Data.Tree -import System.Directory -import Text.Pandoc - --- generate a HTML link from a href & title -htmlLink :: String -> String -> String -htmlLink href title=""++replace "_" " " title++"" - --- generate HTML breadcrumbs from a list of page titles -genBrc :: [String] -> String -genBrc b | length b < 2 = "" - | otherwise = fst $ foldl lnk ("",0) b - where lnk (a,c) v = (a++" / "++html c v,c+1) - html c = htmlLink (concat (replicate (length b-c-1) "../")) - --- pure function that generates a single HTML page from: --- a html template, description, keywords, breadcrumbs, topMenue & submenue -genPage :: String->String->String->[String]->[String]->[String]->String->String -genPage tmpl dsc kw brc top chld md = - foldr rplc tmpl (replacers content (menu "/" top) (menu "./" chld) (genBrc brc) title dsc kw) - where content = either (const "error") unpack res - where res = runPure $ do doc <- readMarkdown def{readerExtensions=(enableExtension Ext_raw_html pandocExtensions )} $ pack md - writeHtml5String def doc - rplc v = replace ("##" ++ fst v ++ "##") (snd v) - title = if null brc then "Home" else replace "_" " " $ last brc - menu p = foldr (fm p) "" - fm p s a = "
  • "++htmlLink (p++s) s ++"
  • "++a - replacers c m m2 b t d k= - [("CONTENT", c) - ,("LOGO", "/DATA/logo.png") - ,("STYLESHEET", "/DATA/style.css") - ,("SITE_TITLE", "Miguel's Lair") - ,("SITE_SUBTITLE", "
    where information sleepzzZZZzz ...") - ,("TITLE", t) - ,("DESCRIPTION", d) - ,("KEYWORDS", k) - ,("AUTHOR", "Michal Idziorek") - ,("MENU", m) - ,("SUB_MENU", m2) - ,("BREADCRUMBS", b) - ,("FOOTER", "(c) by Miguel 2018")] - --- get list of subdirectories in given directory, with full relative path -getDirList :: FilePath -> IO [FilePath] -getDirList d = map ((d++"/")++) <$> listDirectory d - >>= filterM doesDirectoryExist - --- sequence IO Action 'f' for each subdirectory of 'fp' recursively -trvDirTree :: FilePath -> (FilePath -> [FilePath] -> IO()) -> IO () -trvDirTree fp f = unfoldTreeM unf fp >>= sequence_ - where unf p = getDirList p >>= \s -> f p s >>= \l -> - return (return l, s) - --- write the HTML page generated from current diectory by 'genPage' -wrtPage :: FilePath -> FilePath -> String -> [FilePath] -> FilePath -> [FilePath] -> IO () -wrtPage idx out tmpl top p chld = do - - when (not home) (createDirectory outdir) - - md <- readFile $ p ++ "/index.md" - cfg <- (map ((\(x:xs) -> (x,unwords xs)).words).lines) - <$> catch (readFile $ p++"/config") - ((\_ -> return "") :: IOException -> IO String) - - writeFile (outdir++"/index.html") - (genPage tmpl (lkp cfg "dsc") (lkp cfg "kwd") - brc (menu top) (if home then [] else menu chld) md) - - where home = outdir==out++"/" - remUnder = filter (not.null) . map (dropWhile(=='_').dropWhile(/='_')) - lkp cfg k = fromMaybe "" (lookup k cfg) - menu = remUnder . filter (not . isPrefixOf "00_") . map (last.splitOn "/") . sort - outdir = out ++ "/" ++ intercalate "/" brc - brc = remUnder $ splitOn "/" (drop (length idx) p) - --- Main IO action: traverses index recursively and calls wrtPage in each --- subdir, which in turn generates the output directories and html pages -main :: IO () -main = do tmpl <- readFile "./DATA/template.html" - top <- getDirList "./INDEX" - trvDirTree "./INDEX" (wrtPage "./INDEX" "./OUT" tmpl top) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - diff --git a/favicon.ico b/favicon.ico index 3a82451..01a4632 100644 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/template.html b/template.html index 6e7b232..bd66b91 100644 --- a/template.html +++ b/template.html @@ -2,7 +2,7 @@ - + ###TITLE### -- cgit v1.2.3