six demon bag

Wind, fire, all that kind of thing!

2020-06-11

Installing Discourse on Devuan

Before deciding on setting up my Q&A site with Question2Answer I evaluated several programs, one of them being Discourse. And even though I ultimately decided against Discourse (because the setup was too complex and it doesn't have all the features I wanted) I don't want my experiences go to waste, so I'll publish them here.

See more ...

Posted 19:57 [permalink]

2020-02-29

Non-interactive MongoDB Commandline

MongoDB provides an interactive command shell for working with the database. Which is all nice and dandy, but from an admin and automation perspective it's desirable to also be able to run commands non-interactively. The mongo commandline tool does have a parameter --eval that kind of allows you to do that:

--eval <javascript>
Evaluates a JavaScript expression that is specified as an argument. mongo does not load its own environment when evaluating code. As a result many options of the shell environment are not available.

except that it doesn't play nice when you also want to automatically authenticate via the config file .mongorc.js.

See more ...

Posted 01:29 [permalink]

2017-04-01

Reset VSS Writers

VSS writers are application-specific components for Microsoft's Volume Shadow Copy Service, which ensure the consistency of application data when a shadow copy is created. That's quite useful for creating consistent backups of a system. However, some of these writers go into error states more or less frequently. And Microsoft did not deem it necessary to document how to reset writers without rebooting the entire system (or at least I didn't manage to find that piece of information).

See more ...

Posted 16:19 [permalink]

2015-06-07

Using the DB2 Command Line Processer from PowerShell

Even for DB2 10.5 the official documentation says to use the db2cmd command for a Command Line Processor enabled environment on Windows:

On Windows operating systems, db2cmd command opens the CLP-enabled DB2® window, and initializes the DB2 command line environment.

However, being able to use PowerShell instead of db2cmd would be much nicer, since the former is far more versatile in practically every respect (control structures, output processing, file handling, etc.).

See more ...

Posted 01:38 [permalink]

2015-03-12

Repairing a Suspect msdb Database

Sometimes a situation arises where an SQL Server instance comes back up with a database tagged as "suspect". Apparently there is a number of possible causes for this, like transaction log corruption, insufficient memory or disk space, or unexpected shutdowns due to hardware or power failure. In our case the reason was probably a hardware failure, since the database resides on an iSCSI volume, and we were making changes to our iSCSI network. And to make things a little bit more interesting, our msdb database just had to be among the affected databases.

See more ...

Posted 19:07 [permalink]

2014-03-26

Cleanup of DB2 Backups Fails with Return Code 136

Recently I encountered a rather weird problem with the cleanup of backups of some of our DB2 databases. The database backups are done via TSM by running the following command:

db2 "backup db DBNAME online use tsm"

Cleanup of obsolete backups is done by running the following commands via a scheduled task.

db2adutl delete full older than TIMESTAMP db DBNAME without prompting
db2adutl delete logs between S0000000.LOG and S(xxxxxxx-1).LOG db DBNAME without prompting
db2 "connect to DBNAME"
db2 "prune history DATE and delete"
db2 "prune logfile prior to Sxxxxxxx.LOG"
db2 "connect reset"

Sxxxxxxx.LOG is the oldest log of the oldest backup to be kept, which is extracted from the output of db2adutl query full db DBNAME. S(xxxxxxx-1).LOG is that log number minus one.

Although this setup had been working for several years without problems and no changes were made to the system, the log cleanup step suddenly started to fail for some databases while it still worked fine for the others.

See more ...

Posted 21:10 [permalink]

2010-05-30

Backscatter protection

What is backscatter?

When mail servers accept mail and later discover that for some reason they are unable to actually deliver it, RFC 821 specifies that a Non-Delivery Notification (NDN, also known as "bounce") must be sent to the originator of the mail.

However, the "From" address can be spoofed most easily, so there is no guarantee whatsoever that the mail actually originated from that address. In case of a spoofed address, the NDN will be sent to someone who hadn't sent the original mail to begin with. These bounces going back to someone else but the original sender are called "backscatter".

Why is that a problem?

Because spammers tend to send their bulk e-mails to anything that looks even remotely like an e-mail address, the "To" addresses usually include lots of invalid addresses. Therefore spam-runs can cause massive waves of backscatter flooding the mailboxes of those people whose addresses were spoofed in the "From" field. However, it's not sensible to simply block all incoming bounces, because there are legitimate bounces as well.

See more ...

Posted 22:41 [permalink]