The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for March, 2018

Ben, blogging: Show the complete apache config file

Posted by jpluimers on 2018/03/20

Quite a while back, I got attended to Ben, blogging: Show the complete apache config file:

If you really want to see all the complete config settings, there is no existing tool for that. This Stack Overflow page  answered this question pretty well: You can use apachectl -S to see the settings of Virtual Host, or apachectl -M to see the loaded modules, but to see all settings, there is no such tool, you will have to go through all the files , starting from familiar yourself with the  general structure of the httpd config files.
… script …

The usage is simple: Run it as python  CombineApacheConfig.py . Since there is no additional parameters given, it will retrieve the default Ubuntu apache config file from  /etc/apache2/apache2.conf and generate the result complete config file in /tmp/apache2.combined.conf. If your config file is in different location, then give the input file and output file location.

Note: Apache server-info page http://127.0.0.1/server-info also provide similar information, but not in the config file format. It is in human readable format. The page works only when it is open from the same computer.

Since I could not find how to post comments there, and it works better for me having a repo, I put it into a gist with attribution to hist post: https://gist.github.com/jpluimers/fd300f3a500cbc78cd862d2a248e7b03
I need to adapt it for OpenSuSE; until then run it as this:
python CombineApacheConfig.py /etc/apache2/httpd.conf /tmp/apache2.combined.conf

–jeroen

 


#!/usr/bin/python2.7
# CombineApacheConfig.py
__author__ = 'ben'
import sys, os, os.path, logging, fnmatch
def Help():
print("Usage: python CombineApacheConfig.py inputfile[default:/etc/apache2/apache2.conf] outputfile[default:/tmp/apache2.combined.conf")
def InputParameter():
if len(sys.argv) <> 3:
Help()
return "/etc/apache2/apache2.conf", "/tmp/apache2.combined.conf"
return sys.argv[1], sys.argv[2]
def ProcessMultipleFiles(InputFiles):
Content = ''
LocalFolder = os.path.dirname(InputFiles)
basenamePattern = os.path.basename(InputFiles)
for root, dirs, files in os.walk(LocalFolder):
for filename in fnmatch.filter(files, basenamePattern):
Content += ProcessInput(os.path.join(root, filename))
return Content
def RemoveExcessiveLinebreak(s):
Length = len(s)
s = s.replace(os.linesep + os.linesep + os.linesep, os.linesep + os.linesep)
NewLength = len(s)
if NewLength < Length:
s = RemoveExcessiveLinebreak(s)
return s
def ProcessInput(InputFile):
Content = ''
if logging.root.isEnabledFor(logging.DEBUG):
Content = '# Start of ' + InputFile + os.linesep
with open(InputFile, 'r') as infile:
for line in infile:
stripline = line.strip(' \t')
if stripline.startswith('#'):
continue
if stripline.lower().startswith('include'):
match = stripline.split()
if len(match) == 2:
IncludeFiles = match[1]
IncludeFiles = IncludeFiles.strip('"') #Inserted according to V's comment.
if not IncludeFiles.startswith('/'):
LocalFolder = os.path.dirname(InputFile)
IncludeFiles = os.path.join(LocalFolder, IncludeFiles)
Content += ProcessMultipleFiles(IncludeFiles) + os.linesep
else:
Content += line # if it is not pattern of 'include(optional) path', then continue.
else:
Content += line
Content = RemoveExcessiveLinebreak(Content)
if logging.root.isEnabledFor(logging.DEBUG):
Content += '# End of ' + InputFile + os.linesep + os.linesep
return Content
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s][%(levelname)s]:%(message)s')
InputFile, OutputFile = InputParameter()
try:
Content = ProcessInput(InputFile)
except Exception as e:
logging.error("Failed to process " + InputFile, exc_info=True)
exit(1)
try:
with open(OutputFile, 'w') as outfile:
outfile.write(Content)
except Exception as e:
logging.error("Failed to write to " + outfile, exc_info=True)
exit(1)
logging.info("Done writing " + OutputFile)

Posted in *nix, *nix-tools, Apache2, Development, Linux, openSuSE, Power User, Python, Scripting, Software Development, SuSE Linux | Leave a Comment »

Just in case you are wondering what these %TEMP%\_MEI* folders are about: Google Drive does not cope well with Windows logoff/shutdown…

Posted by jpluimers on 2018/03/19

From a while back, but still not fixed: [WayBack] Just in case you are wondering what these %TEMP%_MEI* folders are about: Google Drive apparently doesn’t clean up correctly when it exits because you l… – Daniela Osterhagen – Google+

Just in case you are wondering what these %TEMP%\_MEI* folders are about: Google Drive apparently doesn’t clean up correctly when it exits because you log off or shut down Windows.

This is ridiculous. It’s not as if there weren’t any options to let Windows do that cleanup if the program fails.

It is still not fixed:

[WayBack] Just in case you are wondering what these %TEMP%_MEI* folders are about: Google Drive apparently doesn’t clean up correctly when it exits because you l… – Jeroen Wiert Pluimers – Google+

Adrian Meacham:

Still doing it all these years later – only the size of the garbage left behind has changed (Size: 58.4 MB (61,303,879 bytes) Size on disk: 67.7 MB (71,061,504 bytes) 1/3 of which is icons) – why this isn’t committed to Chrome instead of held open in %TEMP% is beyond reasoning +Google Drive

Original forum source: [Archive.is] _MEI folder created at windows start – Google Product Forums

by Martin Friedl 3/17/13

Hi,
I just found out that on windows the google drive tool creates a ‘_MEIxxxxx’ folder on every startup of windows. The xxxxx is a number that differs at every startup. On my PC (with windows 7) this folder is created on ‘C:\’ and has a size of about 35MB. SO with every start of windows google drive occopies 35 additional MB. It looks as the content of the folder is mainly Pyhton-files.

Is there a way to prevent google drive from creating an additional folder with every start of windows?

Best regards
Martin

10/21/13
Klint said:
If you exit Google Drive by right-clicking the Google Drive icon in your Windows 7 notification area, and selecting Exit, then Google Drive shuts down properly and correctly deletes the _MEIxxx folder. Unfortunately, it leaves the folder behind if you leave Google Drive running when you log out or shut down. So, yes, it is a bug in Google Drive. It ought to terminate properly when the user logs out.

–jeroen

Read the rest of this entry »

Posted in Google, GoogleDrive, Power User, Windows | Leave a Comment »

Understanding how Design Thinking, Lean and Agile Work Together | ThoughtWorks

Posted by jpluimers on 2018/03/19

Many more things to learn and practice, especially on how these concepts interact, how to make things quantifiable and especially practice them in ways that people intrinsically understand how to:

The ideas of agile are great. It’s the way it has been codified into rituals and certifications and rolled out mindlessly that misses the point. When people talk about Lean, the conversation often ends at process optimization, waste, and quality, and misses so much of what the Lean mindset offers. Design Thinking is held high as the new magic trick of design facilitators.

Source: [WayBackUnderstanding how Design Thinking, Lean and Agile Work Together | ThoughtWorks.

The article has some nice graphics to illustrate the points (some are below) and points to a lot more links for further learning.

Via [WayBackThoughtWorks on Twitter: “Instead of focusing on applying a process, teams ought to challenge how they think and try new things, embrace the things that work, and learn from the things that don’t. #Agile #DesignThinking “

–jeroen

 

Posted in Agile, Development, Software Development | Leave a Comment »

macos – How can I list all user accounts in the terminal? – Ask Different

Posted by jpluimers on 2018/03/19

With system account starting with underscore:

dscl . list /Users

Without underscore, so only regular accounts:

dscl . list /Users | grep -v ^_.*

Source: [WayBackmacos – How can I list all user accounts in the terminal? – Ask Different

–jeroen

Posted in Apple, iMac, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, macOS 10.12 Sierra, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.9 Mavericks, Power User | Leave a Comment »

A beginner’s guide to beefing up your privacy and security online

Posted by jpluimers on 2018/03/19

Want to protect your security and privacy? Here are some places to start:

via: [WayBackI think I’ll keep this article somewhere where I can easily share it with the famz the coming days :) – Roderick Gadellaa – Google+

–jeroen

 

 

Posted in Power User, Security | Leave a Comment »

Wolfgang Rupprecht on Dennis H. Klat, Carlos Hawking and Deeklatt – Google+

Posted by jpluimers on 2018/03/18

Wow: [WayBackWolfgang Rupprecht – Google+:

Dennis H. Klatt 1938 – 1988

I knew him at MIT. He was my undergraduate thesis advisor and was a kind and gentle person. When I knew him around 1980 he was about to build the prototype for the first Klatt Talker as it was called then. He had speech samples generated by running his mathematical model of the vocal tract on a large mainframe, but no way to generate speech in real time. I remember being quite happy years later when I heard he had convinced DEC to produce it. The local Boston radio stations would sometimes use it on air when they were goofing around. The initial voice (and the only voice early on) had a bug that made it sound like a Mexican accent to most people. It wasn’t intentional and was a bit of a surprise that a vocal tract modeled from first principles would sound that way. Going with that observation and figuring it was best to advertise bugs as features, the voice was often called “Carlos”. I didn’t realize that Hawking’s voice was also based on the Klatt models (and Klatt’s own voice at that!)

Poking around Google to see what else Google had on him dredged up one more interesting tidbit. There was a character in a TV cartoon called Deeklatt that used his voice. I wonder how many people realize that Deeklatt was a play on D. Klatt. Dennis, we should all be so lucky as to leave a legacy like yours.

–jeroen

Posted in History, LifeHacker, science | 1 Comment »

Opinion needed: DIY or branded scanner for scanning film negatives and slides?

Posted by jpluimers on 2018/03/16

I’ve a ton of slides, negatives and photos to scan and want to automate the process as much as possible. Think thousands.

Opinions are welcome on both the hardware to use and the process.

It looks like for slides and negatives the opinions vary between building your own rig, fiddling with flatbed lighting or buying a tad more expensive one.

But that was 3 years ago. How’s the state of the art right now?

–jeroen

via: [WayBack] Guess I’ve got a lot to do over the holidays… I’m pretty sure #Google…

Posted in LifeHacker, Power User | Leave a Comment »

0x8024400E error with WSUS SP2

Posted by jpluimers on 2018/03/16

From a note a very long time ago: [WayBack0x8024400E error with WSUS SP2

TL;DR:

  1. ensure you have at least KB2938066 installed.
  2. while upgrading WSUS, ensure you reboot the server after each update.

Related: [WayBackwindows – WSUS clients failing to get updates with error 80072EE2 – Server Fault

–jeroen

Posted in Power User, Windows, Windows Server 2008, Windows Server 2008 R2 | Leave a Comment »

Tumbleweed on Raspberry Pi 3 – Bug 1084419 – Glibc update to 2.27 causes segfault during name resolution

Posted by jpluimers on 2018/03/15

Need to watch these:

A few notes:

  • It is inside the glibc name resolution
  • IPv6 is OK, IPv4 fails.
  • ping/nslookup (which do not depend on glibc) are OK
  • there is an intermediate fix requiring direct osc downloads

A simple test case

Failing situation

$ curl --silent --show-error http://example.org > /dev/null
Segmentation fault (core dumped)

Succeeding situation

$ curl --silent --show-error http://example.org > /dev/null

Non related, but in hindsight my own stupid fault during a similar update: a post mortem

Most important bits of my external infrastructure - page 1

Most important bits of my external infrastructure – page 1

I thought I had forgot about the SuSEfirewall2 changes (On my research list: migrate from OpenSuSE SuSEfirewall2 to firewalld) so assumed that was the reason I broke one of my secondaries (which runs on a Raspberry Pi 2):

Mistakes like these are the reason to have secondaries in the first place https://infrastatus.wiert.me and do port-mortems.

Which is kind of odd, as the SuSEfirewall2 didn’t throw any warnings like at this similar one:

This one still works because it is on the firewall in front of the Raspberry Pi 2:

(Screenshots of the above URLs are below).

In fact it was another mistake: I had forgotten to make the DHCP lease static, which resulted in a wrong IP address to be assigned upon reboot, instantly making the firewall rules invalid:

I could have fixed this remotely when I had thought about this.

–jeroen

Read the rest of this entry »

Posted in *nix, Development, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, SuSE Linux, Tumbleweed | 3 Comments »

EmbarcaderoMonitoring – monitoring the Embarcadero internet related services

Posted by jpluimers on 2018/03/15

Over time, there are lots of complaints about Embarcadero related internet services (like forums, QC, Appanalytics, docwiki, blogsweb site, maintenance) so to track uptime, I’ve created a set of EmbarcaderoMonitoring pages:

This is preliminary work based on my own lists of Embarcadero endpoints combined with some research like [WayBack] dnsdumpster embarcadero.com.png and [WayBack] IdentIPSpy

Underneath, they run on the uptimerobot.com infrastructure which has a limit of 50 free monitors.

It means I have to:

  • trim this down for relevancy
  • better document the endpoint
  • find correct endpoint targets for the black (disabled) and red (down) entries as a few of them might need tweaking
  • maybe split off an insecure and secure version (now most subdomains have both http and https monitored)

Any ideas on improving this are welcome: please post a comment here on on the resulting G+ thread.

Note it likely won’t show cases like when the website was hacked or TLS certificate issues like in SSLLabs security reports for some embarcadero subdomains. I need to think about a means for those, as it will certainly help monitoring my own infrastructure in a similar way.

–jeroen

Read the rest of this entry »

Posted in *nix, Cloud, Development, DevOps, Infrastructure, Monitoring, Power User, Software Development, Uptimerobot | Leave a Comment »