Live from the Sundhnúkur Eruption

The Reykjanes peninsula in Iceland has been experiencing a period of heightened volcanic activity since December 2023. This follows an increase in seismic activity that began in late 2019. The most recent eruption started on March 16th in Sundhnúkur near the town of Grindavík.You can view a live webcam of volcanic activity in Sundhnúkur on Live from Iceland.  This webcam shows a live Maps Mania… more →
Posted in: Interactive Maps

Extract a Number from a String with JavaScript

User input from HTML form fields is generally provided to JavaScript as a string. We’ve lived with that fact for decades but sometimes developers need to extract numbers from that string. There are multiple ways to get those numbers but let’s rely on regular expressions to extract those numbers! To employ a regular expression to get a number within a string, we can use \d+: const string = "x12345david"; const [match] = string.match(/(\d+)/); match; // 12345 Regular expressions are capable of really powerful operations within JavaScript; this practice is one of the easier operations. Converting the number using a Number() wrapper will give you the number as a Number type. The... more →
Posted in: JavaScript

Coins Hoards from the Roman Empire

Ancient Rome had significant trade links with India, particularly during the Roman Empire under the rule of Augustus and onwards. The Silk Road and Indian Ocean trade routes facilitated the exchange of goods to Rome from India, including textiles, spices, gems, and other luxury items. You can find evidence of this trade between the Roman Empire and India on this interactive map of Maps Mania… more →
Posted in: Interactive Maps

How to Get Mac Battery Level from Command Line

I’m a big fan of having as much information as I can get within the command line. I couldn’t go without knowing which git branch I’m on, for example. Another important piece of information I like having is my current battery percentage. To get the current battery level from command line, you can run: pmset -g batt | grep -Eo "\d+%" Since I get lost in command line for hours at a time, having the percentage present saves me the labor of shifting my eyes outside of shell. What information do you like having in your command line? The post How to Get Mac Battery Level from Command Line appeared first on David Walsh Blog. David Walsh Blog… more →
Posted in: JavaScript

How to Blur Faces in a Video from Command Line

Privacy is always incredibly important, especially with visual media where you may not have the permission of individuals in the video. If you’re filming something in public, it’s likely you’ll catch someone’s face who simply doesn’t want or need to be identified. This recently got me to thinking: what’s the easiest way to blur faces in a video via command line? The best open source utility I found for blurring faces in a video was deface. Let’s have a look at how you can use deface to blur faces in videos! Start by downloading Python-based via pip: python3 -m pip install deface With deface installed, simply provide the video name and get the output... more →
Posted in: JavaScript

Restart Mac From Command Line

Restarting and shutting down a computer remotely is a frequent task for remote system administrators. As someone that writes many shell scripts, I also find myself automating system restarts. Let’s look at a few ways to restart Mac systems from command line! Restart a Local Mac To restart a local Mac system from command line, you can execute: sudo shutdown -r now Restart a Remote Mac To restart a remote Mac system, you can execute: ssh -l {AdminSystemAddress} sudo shutdown -r now Restart at a Specific Time You can specify a restart at a specific time: # Format: sudo shutdown -r hhmm # Restart at 11:30pm local time sudo shutdown -r 2330 System restarts are good after massive updates... more →
Posted in: JavaScript

The First Images from EUMETSAT MTG-I1

The first high quality image from Europe’s newest weather satellite has been released. The European Organisation for the Exploitation of Meteorological Satellites (EUMETSAT) operates a fleet of satellites with which it monitors weather, climate, and the environment from space. EUMETSAT’s newest satellite, Meteosat Third Generation – Imager 1 (Meteosat-12) was launched in December 2022 and is Maps Mania… more →
Posted in: Interactive Maps

How to Get a Base64 Version of a File From Command Line

A while back I wrote an article on how to Convert Image to Data URI with JavaScript. It’s a neat trick developers can use for any number of reasons. Instead of abusing canvas, however, why not simply get the base64 data from command line? You can use base64 and pbcopy to convert a file to base64 and copy it to the clipboard: # base64 gets data, pbcopy copies to clipboard base64 -i logo.jpeg | pbcopy Once you have the file data copied in base64 format, the URL format to use the data is: # data:{mime-type};base64,{data} data:image/jpeg;base64,/9j/4AAQSkZJRgAB...... While base64 data and data URIs do look cryptic, they’re useful to avoid making requests to other files. I use them... more →
Posted in: JavaScript
1 2 3 6