Web Excursions 2021-11-22
Running scripts at login as another user
there are multiple ways to run commands as another user at login, but it's important to do it safely.
startup and shutdown scripts
are run as the root user or another special user account that has been granted the privileges necessary to run the script.
Scripts that are run at login time are usually run as the user who is logging in.
Usually functions that need to be set up by the user (or for them) are handled by a user's own login script.
These login scripts can be stored in a variety of locations, and the location may vary depending on which shell (or desktop) they are running.
Typically
scripts which are run at login time are executed as the regular user and stored in the /etc/profile.d/ directory.
Scripts to be run at logoff are specific to the shell or desktop used.
For the popular bash shell, commands to be run when the user logs out can be run from the ~/.bash_logout script.
There are exceptions though where an administrator will really want to run a script as another user (such as root) when someone logs in.
This can be accomplished on most Linux distributions through a Pluggable Authentication Module (PAM).
run the command /etc/my-special-script when the user logs in and the script will be run as the root user instead of the person who is signing in:
auth optional pam_exec.so seteuid /etc/my-special-script
The Be Book - Classes and Methods - The Kernel Kit
The following functions, types, and structures are used to convey basic information about the system, such as the number of CPUs, when the kernel was built, what time it is now and whether your computer is on fire.
int32 is_computer_on();
Returns 1 if the computer is on. If the computer isn't on, the value returned by this function is undefined.
double is_computer_on_fire();
Returns the temperature of the motherboard if the computer is currently on fire. Smoldering doesn't count. If the computer isn't on fire, the function returns some other value.
Is There a Future for the ‘Chinese School of Animation’?
audiences raised on the classics often complain that contemporary animation lacks the beauty of those earlier films —
as well as their innovative approach to adapting traditional aesthetics.
But is this really a fair criticism?
Animators today are working in a far more international context.
Their target audience of young Chinese have grown up in a very different cultural landscape
[Two golden ages of Chinese animation]
The first, stretching from the 1950s to the early 1960s, peaked with films like “Havoc in Heaven,” “Where is Mama?” and “The Proud General.”
In that era, Chinese animators were driven by strong, top-down directives to cultivate nationalism and nationalist imagery.
[The second started] after a screening of “Feeling From Mountain and Water” at the inaugural Shanghai International Animation Film Festival in 1988,
John Halas — the animator of the 1954 adaptation of “Animal Farm” — hailed the discovery of a new world of Chinese animation.
Building off Halas’ praise for Chinese animators’ unique style, within months, local critics and scholars were talking about a “Chinese school of animation”
characterized by a mix of traditional Chinese art styles, opera, and vernacular literature.
All but three screenplays selected for an anthology of animated films between 1949 and 1979 drew material from ancient Chinese legends and folk stories.
In terms of style, Chinese animation was influenced by traditional techniques such as paper-cutting, paper-folding, and ink wash painting.
Many craft and fine artists were drafted to help with the design process, creating images based on historical art and artifacts like bronze implements, lacquerware, frescoes, and Chinese New Year paintings.
The stories, meanwhile, borrowed heavily from the stylized performances of Peking opera and other local opera styles, including features like the use of gongs and drums to open the show.
Despite second-wave animators’ frequent use of China’s “national legacy,” they also borrowed widely from a range of non-Chinese sources, including classic Hollywood, expressionism, and film noir.
For example, the first-wave animated film “Havoc in Heaven” includes an intense fight between the Monkey King and the Chinese deity Erlang Shen.
Mirroring the martial arts scenes found in Peking opera, the editing team employed slow, long shots to visualize their confrontation.
But when the protagonist of 1979’s “Prince Nezha’s Triumph Against the Dragon King” dies by suicide at the film’s climax,
the animators instead make a series of fast cuts between Nezha, his father, and the Dragon King
to disrupt the action and emphasize the scene’s emotional impact.
[Sealed Book]’s real conflict
is found in the battle of wills between the Jade Emperor and Yuangong, a side character tasked with guarding the emperor’s heavenly scriptures.
Yuangong comes to believe that the emperor is monopolizing the scriptures’ power for his own ends while allowing the human world to suffer.
So he brings them to the mortal plane, only to be seized and returned to the heavenly court for punishment.
the film’s visuals were also grounded in the everyday life of 1980s China.
For instance, the film’s presentation of the county magistrate draws on both comic archetypes from Peking opera and toys like jack-in-the-boxes that were popular with Chinese kids at the time.
All this is to say that “Sealed Book” is remembered as a classic
not only because of its abstract aesthetics or its presentation of traditional Chinese culture,
but also because of how it connected with the era in which it was created
Even the film’s use of opera elements has more to do with opera’s relatively mainstream status in the 1980s than a tribute to traditional Chinese culture.
Despite what surface-level readings might suggest, the “Chinese school of animation”
was never simply about incorporating elements of China’s “national legacy” like opera, painting, or paper-cutting.
Culture isn’t static, and neither is art.
Proponents of a traditionalist revival of guoman would do best to leave the rigid reproductions of the past to a museum, and the making of art to the artists.
More Memory Leaks in Monterey 12.0.1: How to Avoid Them – The Eclectic Light Company
Coloured pointers
If you open the custom pointer controls in the Pointer tab of the Display item in the Accessibility pane, and set the pointer to be larger than normal using the Pointer size control, and set custom outline and fill colours, each time that your pointer changes type, such as from an arrow to an I-beam, the memory allocated for the previous type isn’t freed, but leaks.
This appears to be triggered specifically by the custom colour settings, but the size of the leak grows as the pointer size is increased.
Finder File/Find
Each time that you type characters into its search box, triggering a search, Finder memory use will increase, but won’t return to normal even when that window is closed.
the only way to recover it is to force the Finder to be relaunched using the Force Quit dialog (Command-Option-Escape).
Control Centre (not reproduced)
Control Centre apparently uses extremely large amounts of memory, often more than 20 GB,
but my testing suggests that any leak in Control Centre is small and slow.
avconferenced (FaceTime) (not reproduced)
the avconferenced process, used in FaceTime, can use tens of GB of memory during long FaceTime calls.
Why is Monterey so prone to memory leaks?
They stand out in 12.0.1 because, unlike major new versions in previous years,
there are relatively few major bugs in Monterey,
indeed there are many bugs which have been fixed.
Chromium’s URL Blocklist Can Now Prevent Viewing Page Source — Pixel Envy
Future Chromium-based browsers under administrative control will be able to prevent users from viewing webpage source code for specific URLs,
a capability that remained unavailable to enterprise customers for the past three years until a bug fix landed earlier this week.
The rationale for this bug seems pretty weak. If exam software is revealing answers in the page source, it should be rewritten.
In this case, it was Google Forms, which makes this bug fix from Google’s Chromium project look especially hinky.
If the web were still primarily a venue for document viewing, as I naïvely believe it ought to be, I would see this through a more debilitating lens.
But the web is basically an operating system and viewing the source tells you little these days.
I think that is a bigger regression, but it is only tangentially related to this bug.
This is a big, scary pile of nothing.