![]() ![]() Note that it’s not a timezone, like GMT (Greenwich Mean Time), but rather a term referring to mean solar time at the Royal Observatory, Greenwich, England. UTC – Universal Coordinated Time – is the shared abstract time reference that came into being with atomic clocks. Note that on a multi-core computer the percentage can be over 100%. Under macOS, the command I use to see a one-time list of the top CPU consumers and the percentage each uses, sorted with hungry apps above, is: ps -racwwwxo "command %cpu" | head -20 Top CPU usage, as simple as possible, sorted To get the next or past month(s), use something like: cal `date -v 1m " %m %Y"` ![]() Generates a one-month calendar block with the current day highlighted, if your terminal supports that sort of thing. Monthly calendar blocks cal_head=`cal | head -1` cal_tail=`cal | tail -7` today=`date " %e"` echo "$cal_head" echo "$" Want to see how long since your last reboot, your “up time”, in an easy-to-read natural language style, like 2 days 16 hours 38 minutes? The following very long command does the trick: uptime | cut -d ' ' -f 4- | rev | cut -d ' ' -f 8- | rev | sed -e 's/,$//' -e 's/:/ hours /' -e 's/\($\)/\1 minutes/' -e 's/,/ /g' For the computer I was using at the time, at about seven swapfiles things started swapping, paging, and hanging, so I kept track of their count and rebooted before I revisited that bad place. There was a time when macOS did a bad job of cleaning up swap files. This required a bit more than a stock macOS get GNU date with brew install coreutils (and if you didn’t know about the homebrew package manager, now’s the perfect time to learn). How to calculate – on one line – the number of days that have passed since a particular date? The stock macOS date can’t do it echo \( `/usr/local/bin/gdate %s -date=today` - `/usr/local/bin/gdate %s -date=` \) / 86400 | bc If you display multiple timezones you’ll quickly come to realize that the minutes portion of the time is the same across most timezones, so what I actually use is TZ=America/Los_Angeles date "PST %H" TZ=America/New_York date "EST %H" TZ=Asia/Dubai date "Dubai %H" TZ=Asia/Kolkata date "Kolkata %H:%M" TZ=Asia/Jakarta date "Jakarta %H" TZ=Asia/Shanghai date "Chengdu %H" So when you pick up your laptop and travel through a bunch of timezones (and your local time changes) the hardcoded offset doesn’t steer you wrong. TZ=":Asia/Calcutta" date "India %a %H:%M" So I hardcoded the offset values: date -j -v 12H -v 30M "India %a %H:%M"Ī better, proper, portable way is to specify the actual timezone in which you’re interested. Time elsewhereĬoworkers in India – how to keep track of their day and night? They’re 12.5 hours ahead of where I lived (in California). Note please there’s a significant difference between a straight quote ' and a back-quote (or back-tick) `. Specify an appropriate refresh interval, in seconds. Within GeekTool drag a “shell” object onto the desktop and paste the UNIX command line into the “command” field. Alpine can get you a better mail client, and Geektool can provide better notices.GeekTool is a fabulously easy way of displaying images from the web and the output of UNIX commands on your Mac’s desktop. OS X only has the mail program built-in, and its GUI mail client hasn’t been able to add simple mail accounts since about OS X 10.2. Command-line mail on OS X: re-alpine and Geektool If you do a lot of automated command-line scripts, you probably also generate a lot of mail to /var/mail. GeekTool, TaskPaper, and XML A script to convert a TaskPaper file to XML so as to filter it for specific tags and display the results on the Desktop. Apple Mail on the Desktop with GeekTool Here’s a simple AppleScript to use with GeekTool to put your inbox on the Desktop. Here’s how to do it with Python and GeekTool. But sometimes you just want to know if the time is today, or yesterday, or two days ago. Put a relative clock on your Desktop with GeekTool There are a lot of desktop clocks that show the absolute time. Rather than “tomorrow at time” use “time tomorrow”. Best Geektool Scripts More GeekTool Geektool Scripts 2019 icalBuddy and eventsFrom/to Ali Rantakari’s icalBuddy has an error in the documentation for the “eventsFrom/to” command-line option. ![]() Zenoss is built in Python and, at least on OS X, was very easy to set up. Zenoss “Open Source Server and Network Monitoring”. It lets you display on your desktop different kind of informations, provided by 3 default plugins.” The plugins let you monitor files (such as error logs), view images (such as live graphs), and display the results of command-line scripts. ANSI escape code “ANSI escape sequences are used to control text formatting, color, and other output options on text terminals.” GeekTool “GeekTool is a System Preferences module for Mac OS 10.5. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |