Eduard Lebedyuk · Dec 8, 2022 go to post

Great find, Tani!

You can also use the same trick to remove roles temporarily (for example if you need to execute untrusted code):

Class User.Role
{

/// do ##class(User.Role).Test()
ClassMethod Test()
{
    do ..SecurityContext("Test before")
    do
    . new $roles
    . do ##class(%SYSTEM.Security).Login("UnknownUser") // has no roles
    . do ..Untrusted()

    do ..SecurityContext("Test after")
}

ClassMethod Untrusted()
{
    do ..SecurityContext("Untrusted")
}

ClassMethod SecurityContext(context)
{
    w "Context: ", context, !
    w "Roles: ", $roles, !
    w "User: ", $username, !, !
}

}

Produces this output:

Context: Test before
Roles: %All
User: _SYSTEM
 
Context: Untrusted
Roles:
User: UnknownUser
 
Context: Test after
Roles: %All
User: _SYSTEM
Eduard Lebedyuk · Dec 7, 2022 go to post

This is probably a question to raise in the WRC.

What's the MD5 hash of your InterSystems IRIS Community 2022.2.0.368.0 installation file (original exe, not the unpacked msi)?

Eduard Lebedyuk · Dec 6, 2022 go to post

This database stores audit information (actions users took during the instance lifetime).

Depending on your specific situation you might have to keep it for a while due to a contract or compliance reasons.

When DB grows unexpectedly these are the general steps:

1. Check that DB is actually full and not over-expanded. To do that go to SMP-> System Operation -> Databases -> HSAudit. Check % Free Space - that is a space allocated to IRIS.DTA but not used. You can reclaim it by truncating the database.

2. Run ^%GSIZE to get global report and see which globals are the largest. In your particular case, however, you can just go into Globals (from the Databases page) and check IRIS.AuditD which presumably consumes all the space (in details you can calculate space consumption).

3. Based on (2) results do something about the largest globals. In your case, if it's indeed IRIS.AuditD check which system events are logged most often and either fix that (if it's a PROTECT error for example), disable auditing for that particular event. Note that usually old audit entries are purged by a task, maybe something is wrong with that.

Eduard Lebedyuk · Nov 30, 2022 go to post

No, the entire menu is hardcoded as is.

You can use DeepSee/BI User Portal (advantage: public items are available for everyone, disadvantage: requires navigation to a specific ns), but real SMP menu modification requires editing code you shouldn't edit.

Why not favorites? You can autopopulate it on ZSTART.

Eduard Lebedyuk · Nov 24, 2022 go to post

InterSystems is aware of the issue, it will be fixed soon.

UPD: Should be working now.

Eduard Lebedyuk · Nov 23, 2022 go to post
Great!

How does:

As of 2022.2 releases, ARM and Intel platform containers are published under the same name.

So on an Intel machine "docker pull containers.intersystems.com/intersystems/iris:1111.2.3.456.0" will return the intel image, on an ARM machine that same pull will return the ARM image automatically, without needing to have a special .../iris-arm image.

relate to

  • docker pull containers.intersystems.com/intersystems/iris-community-arm64:2022.3.0.545.0
  • docker pull containers.intersystems.com/intersystems/irishealth-community-arm64:2022.3.0.545.0

?

Eduard Lebedyuk · Nov 18, 2022 go to post

2016.1 to anything

System Methods! Search your codebase for ".$from" and ".$to".

You'll have to change your application code if there are System Methods present present.

Other than that, you might want to update to 2017.1 to take an advantage of Frozen Plans.

Is it possible to test update procedures on dev/test deployment first?

Eduard Lebedyuk · Nov 18, 2022 go to post

This question has been discussed with an AWS SWE and their answer is that as long as we're using a main route table for a VPC, it should survive an AZ failure and so we could update it even in the case of an AZ failure.

Additionally, this scenario has been tested (as far as we're able to simulate a failure) and it does work as expected.

While there is an endless variety of how things can fail, I'm reasonably sure that the approach outlined in the article is resilient to an AZ failure.

Eduard Lebedyuk · Nov 14, 2022 go to post

Here's an example, but it looks like you have tried these settings.

Does your Gmail mailbox allow SMTP? It must be explicitly enabled I think.

Eduard Lebedyuk · Nov 12, 2022 go to post

possible word delimiters weren't specified (space, tab, etc.)

Single whitespace

no specification about punctuation marks (allowed or disallowed)

No punctuation

no specification about empty words (allowed or disallowed) and how to handle them, if allowed

No empty words in input.

"O2K. I'1m" --> "I'm OK."
"spac4es are2    1There     ma3ny" --> "There are many spaces."

Not a valid input for this golf.

Eduard Lebedyuk · Nov 8, 2022 go to post

Adapters cannot exist outside of BHs so you can use ##class(Ens.Director).IsItemEnabled(component) on the BH adapter belongs to.

Eduard Lebedyuk · Nov 3, 2022 go to post

Something like this:

#define USE_CALLIN_CHAR

#define ZF_DLL  /* Required only for dynamically linked libraries. */
#include <cdzf.h>
#include <windows.h>
#include <wand/magick_wand.h>

#ifdef __linux__
	#include <dlfcn.h>
#endif

void resize(char *file, char *fileOut)
{
	MagickWand *m_wand = NULL;
	
	int width,height;
	
	MagickWandGenesis();
	
	m_wand = NewMagickWand();
	// Read the image - all you need to do is change "logo:" to some other
	// filename to have this resize and, if necessary, convert a different file
	MagickReadImage(m_wand, file);
	
	// Get the image's width and height
	width = MagickGetImageWidth(m_wand);
	height = MagickGetImageHeight(m_wand);
	
	// Cut them in half but make sure they don't underflow
	if((width /= 2) < 1)width = 1;
	if((height /= 2) < 1)height = 1;
	
	// Resize the image using the Lanczos filter
	// The blur factor is a "double", where > 1 is blurry, < 1 is sharp
	// I haven't figured out how you would change the blur parameter of MagickResizeImage
	// on the command line so I have set it to its default of one.
	MagickResizeImage(m_wand,width,height,LanczosFilter,1);
	
	// Set the compression quality to 95 (high quality = low compression)
	MagickSetImageCompressionQuality(m_wand,95);
	
	/* Write the new image */
	MagickWriteImage(m_wand, fileOut);
	
	/* Clean up */
	if(m_wand)m_wand = DestroyMagickWand(m_wand);
	
	MagickWandTerminus();
	return ZF_SUCCESS;
}

ZFBEGIN
	ZFENTRY("resize","cc",resize)
ZFEND

You can now also use Embedded Python to resize images.

Eduard Lebedyuk · Nov 2, 2022 go to post

Sure:

set db = ##Class(SYS.Database).%OpenId(dir,,.sc)
write db.Mirrored

where dir is a directory with IRIS.DAT.

Eduard Lebedyuk · Oct 31, 2022 go to post

Here's how:

  • Install ghostscript system-wide (Linix: apt install ghostscript, Windows)
  • Download fonts, for example here's some cyrillic fonts (you need another font - it's just an example): PT Courier - Cyrillic
  • Extract TrueType font CRR35__C.TTF into any gs font folder
  • To list gs font folders execute: gs -help, in Windows its usually %ProgramFiles%\gs\gsVERSION\fonts, in Linux /usr/share/ghostscript/fonts
  • Add MyFont info sourcing it from CRR35__C.TTF into gs font table: /MyFont (CRR35__C.TTF) ;
  • Font table in Windows: %ProgramFiles%\gs\gsVERSION\lib\Fontmap.GS, Linux: /usr/share/ghostscript/current/Resource/Init/Fontmap.GS

Nevermind, that's only if you want to use gs directly. For FOP follow these instructions.

Eduard Lebedyuk · Oct 13, 2022 go to post

Not sure about the last one:

	{
		"StartDate": "2022-12-01T00:00:00",
		"EndDate": "2022-11-30T23:59:59"
	}

Anyways, I usually use this logic:

  • Get 1st day of month
  • DATEADD 1 Month
  • DATEADD -1 Day

Accounts for year breaks, leap months, everything.

Eduard Lebedyuk · Oct 12, 2022 go to post

Awesome news!

How does:

As of now, ARM and Intel platform containers are published under the same name. So on an Intel machine "docker pull containers.intersystems.com/intersystems/iris:1111.2.3.456.0" will return the intel image, on an ARM machine that same pull will return the ARM image automatically, without needing to have a special .../iris-arm image.

relate to

  • docker pull containers.intersystems.com/intersystems/iris-arm64:2022.2.0.356.0
  • docker pull containers.intersystems.com/intersystems/irishealth-arm64:2022.2.0.356.0

?