How to Set Date Time from Mac Command Line / / No Comments Working on a web extension that ships to an app store and isn’t immediately modifiable, like a website, can be difficult. Since you cannot immediately deploy updates, you sometimes need to bake in hardcoded date-based logic. Testing future dates can be difficult if you don’t know how to quickly change the date on your local machine. To change the current date on your Mac, execute the following from command line: # Date Format: MMDDYYYY sudo date -I 06142024 This command does not modify time, only the current date. Using the same command to reset to current date is easy as well! The post How to Set Date Time from Mac Command Line appeared first on David Walsh Blog. David Walsh... more → Posted in: JavaScript Tagged with: Command, date, from, line, time
Live from the Sundhnúkur Eruption / / No Comments 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 Tagged with: Eruption, from, live, Sundhnúkur
Extract a Number from a String with JavaScript / / No Comments 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 Tagged with: Extract, from, JavaScript, Number, String
Coins Hoards from the Roman Empire / / No Comments 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 Tagged with: Coins, Empire, from, Hoards, Roman
How to Get Mac Battery Level from Command Line / / No Comments 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 Tagged with: battery, Command, from, Level, line
How to Blur Faces in a Video from Command Line / / No Comments 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 Tagged with: Blur, Command, faces, from, line, video
Restart Mac From Command Line / / No Comments 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 Tagged with: Command, from, line, Restart
The First Images from EUMETSAT MTG-I1 / / No Comments 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 Tagged with: EUMETSAT, first, from, images, MTGI1