Category Archives: Linux

CLI – history

CLI – How often have you gone to the command line to run a command, one you just ran a few days earlier, but you don’t remember all of the options that gave you that perfect result? One way of being able to peer back at those commands you have entered at the command line is through the history command.

Just enter history at the command line and on a macOS system the last 512 commands entered will be shown in your terminal window from oldest to most recent. This is a command built into the default bash shell. With so many commands listed you will probably want to pipe the output of the history command into more or tail or grep to more easily find what you are looking for:

  • history | more
  • history | tail
  • history | grep <search term>

To learn a lot more about how to use apropos, take a look at “Linux history Command Tutorial for Beginners (8 Examples)“. Yes, this is a Linux article, but the history command as implemented on macOS is fundamentally the same.


See my other CLI and macOS articles


 

Advertisements

CLI – apropos

Screen Shot 2018-07-12 at 12.37.28 PM

You know what you want to do, but you are not sure what the command line command is that you should use. This is where the apropos command may help. While the man command gives you the details of a command, apropos searches the descriptions of all of the commands for the keyword used (in the example image above I used ‘apropos disk’ to obtain the list shown) and gives you a list of all commands that contain that keyword.

The macOS man page for apropos says:

apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output.

To learn a lot more about how to use apropos, take a look at “Linux apropos Command Tutorial for Beginners (5 Examples)“. Yes, this is a Linux article, but the top command as implemented on macOS is fundamentally the same.


See my other CLI and macOS articles


 

CLI – top

Screen Shot 2018-07-10 at 11.49.10 AM

If your system seems to be slow or there are running Apps (processes) that you want to know more about, you can enter top at the command line to see more. This command is part of almost every Unix, Linux, and macOS system.

This is similar to the Apple Utility “Activity Monitor”, though there are options you can invoke at the command line to give you more control over what you are seeing. This is a good tool to use if you are wanting to know why your Mac seems to bog down (which process is consuming CPU cycles and/or memory).

The macOS man page for top says:

The top program periodically displays a sorted list of system processes. The default sorting key is pid, but other keys can be used instead.  Various output options are available.

To learn a lot more about how to use top, take a look at “Linux top Command Tutorial for Beginners (8 Examples)“. Yes, this is a Linux article, but the top command as implemented on macOS is fundamentally the same.

See Apple’s Mac OS X Manual Pages for further command details.


See my other CLI articles


CLI – Netstat

If you are having problems with your network or just want to learn a little more about it, the netstat command is a good way to start. The netstat command lets you print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

The macOS man page for netstat says:

The netstat command symbolically displays the contents of various net-work-related data structures.  There are a number of output formats, depending on the options for the information presented.  The first form of the command displays a list of active sockets for each protocol.  The second form presents the contents of one of the other network data struc- tures according to the option selected. Using the third form, with a wait interval specified, netstat will continuously display the information regarding packet traffic on the configured network interfaces.  The fourth form displays statistics for the specified protocol or address family. If a wait interval is specified, the protocol information over  the last interval seconds will be displayed.  The fifth form displays per-interface statistics for the specified protocol or address family. The sixth form displays mbuf(9) statistics.  The seventh form displays routing table for the specified address family.  The eighth form displays routing statistics.

To learn a lot more about how to use netstat, take a look at “Linux netstat Command Tutorial for Beginners (8 Examples)“. Yes, this is a Linux article, but the netstat command as implemented on macOS is fundamentally the same.

See Apple’s Mac OS X Manual Pages for further command details.


See my other CLI articles


 

World Backup Day 2018

Saved Image 2018-03-31 at 11.39.26 AM.png

I can’t really say much more than I did last year, so I am reposting the article I wrote for Backup Day 2017.

If you have an electronic device (computer, phone, tablet), chances are that it can be backed up. Today, World Backup Day, serves as a reminder that you should be backing up those devices on a routine basis.

Backing up your data means making a second (and a third copy is recommended) of all of the data on your device. The 3-2-1 strategy is best – always three copies of your data, data stored on two different media, and one copy off-site.

You should backup because losing data is not as uncommon as you might think. Devices can be lost or stolen. Or they may simply suffer a hardware failure. Increasingly too there is the threat of the data on your device being held for ransom.

Start a habit today of making routine backups. You can even go to the World Backup Day website and take the pledge to back up your data.

One new thing I would like to add is this quick video by Bob “Dr. Mac” Levitus:

macOS New App Release – Mailspring

hero_graphic_mac@2x

Product Announcements – Foundry376 of San Francisco, California has released Mailspring, a desktop email client designed for macOS High Sierra. With modern features like unified inbox, snoozing, reminders, templates, offline search, and support for Gmail labels, Mailspring will breathe life back into your tired inbox! A clean, modern interface and six built-in themes make Mailspring a perfect fit for macOS High Sierra, and mail rules and customizable keyboard shortcuts bring inbox zero within reach. Say goodbye to Apple Mail and discover a better way to manage your email.

Mailspring is absolutely free and supports all IMAP providers, including Gmail, Office 365 and iCloud. Rich integration with macOS makes Mailspring shine: swipe to triage mail, see Quicklook thumbnails for attachments, and reply to emails directly from Notification Center! Mailspring’s email sync has been built from the ground up to use macOS features like App Nap, ensuring it keeps your mailbox up to date without draining your battery.

Pro Pricing:
If your work revolves around email, Mailspring Pro adds even more features, supercharging the app with read receipts, link tracking, send later, reminders, contact profiles, email analytics and more. At $8/mo, Mailspring Pro is an affordable alternative to sales and business email extensions and the first tool to bring all these powerful features to any IMAP providers. Leave the confines of webmail and Chrome extensions behind! Mailspring Pro is your unstoppable email sidekick for sales and business.

Open Source:
Mailspring builds on years of open source development and combines the innovative interface of Nylas Mail with a sync engine built on Sparrow’s Mailcore2 framework. Since 2012, thousands of contributors have helped drive innovation around email in these projects, and Mailspring brings it all together in beautiful, refined desktop experience for macOS that is also open source! See the GitHub link below for more.

Mailspring features include:

  • Unified Inbox – See all your email in a single view
  • Powerful Search – Use Gmail-style search syntax across all your accounts
  • Swipe Gestures – Swipe to archive right from the thread list
  • Signatures – Create as many signatures as you like and set defaults per-account
  • Aliases – Send email from aliases you’ve configured with your providers
  • Quicklook Integration – See previews of attachments and PDFs right inside the app
  • Notifications – Get rich notifications and reply directly from Notification Center
  • Drag and drop – Move emails, add attachments, and more with drag and drop supported everywhere
  • Gmail Labels – Label threads and add, remove, and manage labels right within the app
  • Customizable Keyboard Shortcuts – Choose from popular presets or create custom keyboard shortucts
  • Message Templates – Save emails as templates-complete with variables-and quickly autofill replies and new messages

Mailspring Pro brings even more:

  • Snooze – Dismiss messages until you’re ready to handle them
  • Reminders – Be reminded when emails you send haven’t received replies
  • Tracking – See when recipients open your messages and click links to send timely follow-up
  • Contact Profiles – See bios, profile pictures, and more for people you email
  • Scheduling – Schedule emails to be sent at a particular date and time
  • Undo Send – Never accidentally send an email again
  • Company Info – View company size, location, local time and more at a glance
  • Pre-send Checks – Warns you about omitted attachments, incorrect salutations, and more
  • And many more – see the Mailspring website for a full list of Pro features

Availability:
Mailspring is free and is available exclusively through the Mailspring website. For more information, visit the Mailspring website.

Today is “World Backup Day”

If you have an electronic device (computer, phone, tablet), chances are that it can be backed up. Today, World Backup Day, serves as a reminder that you should be backing up those devices on a routine basis.

Backing up your data means making a second (and a third copy is recommended) of all of the data on your device. The 3-2-1 strategy is best – always three copies of your data, data stored on two different media, and one copy off-site.

You should backup because loosing data is not as uncommon as you might think. Devices can be lost or stolen. Or they may simply suffer a hardware failure. Increasingly too there is the threat of the data on your device being held for ransom.

Start a habit today of making routine backups. You can even go to the World Backup Day website and take the pledge to back up your data.

DON’T Plug in Just Any USB Drive!

Unknown

We have been aware of the threat of USB devices with auto-run malware for some time. More recently a worse device has surfaced, a USB Killer. This sounds like some fictional device you would see in a movie, but it is real.

This looks like any other USB drive, but the hardware is such that seconds after inserting it into a USB port, a disabling charge will be delivered. The USB Killer device charges up an internal capacitor from the 5V power supplied by the USB port. Once the charge reaches a high level (more than 200 volts) the capacitor is discharged back into the port. This process is repeated for as long as the device receives power. The power surge is fatal for most systems. The USB Killer device can then be unplugged and used again and again.

Not only have these devices been designed and tested, you can order one on-line from a Hong Kong company for less than $60. The product is advertised to “test USB ports for vulnerability”. Now at $60 each someone isn’t going to be buying and spreading the devices around, but it is cheap enough that someone up to no-good could purchase and then fry several several devices. How often do you see a laptop left unattended for a few minutes in a cafe?

The manufacturer claims “Our tests reveal that more than 95% of all devices using USB ports will be damaged permanently or completely destroyed by a USB power surge attack.” They do go on to say that “To date [August 16, 2016], the only hardware that resisted … tests was the latest model Macbooks ­which optically isolate the data lines on the USB ports.

If the evil doer is more creative, they can build their own device. I found one YouTube video where a $3 USB device was purchased on-line then modified to deliver a killing charge. Explicit “how to” instructions were given on how to weaponize the device.

What makes this scary and dangerous is that a recent study conducted by the University of Illinois, Urbana-Champaign, the University of Michigan and Google indicated that ‘found’ USB drives are often plugged into a computer. In this particular test 297 devices were spread around the University of Illinois, Urbana-Champaign campus. The result was that they found “that users pick up and connect an estimated 45%–98% of the drives we dropped.

Keep in mind that these USB Killer devices can affect any system with a USB port – computers, TVs, entertainment systems, autos, etc.

How do you protect yourself? If you find a USB drive do not plug it in!


See my other cyber security articles


 

macOD -MacHTTP.js

Product AnnouncementMacHTTP.Org of Leesburg, Virginia has released MacHTTP-js Preview for macOS, a full-featured Web server for 21st century desktops and servers. MacHTTP-js is a modern take on the classic stand-alone, desktop computer Web server plus a whole lot more, using current state-of-the-art technology while derived from the core ideas that went into the creation of the original Mac Web server, MacHTTP.

MacHTTP-js eliminates the need to understand arcane command line tools or to be an expert in deploying Linux-based servers. Instead, it returns to its roots as a double-clickable application with a friendly user interface allowing anyone technical enough to operate a text editor to set up a web server or create compelling Web applications on their desktop which can be migrated to public servers.

Implemented with modern technologies like node.js, Express.js, and Electron, MacHTTP-js is designed for upcoming versions to run on multiple different operating systems and computers, from Macs running macOS to Windows 10, various flavors of Linux (Ubuntu, Debian, RHEL, etc.), and even Raspberry Pis running Raspbian or container-based systems like Docker. These other versions will be released as part of the final release of MacHTTP-js, coming soon. This software is a Free Opens Source Software (FOSS) project.

The Preview version of MacHTTP-js runs on any version of macOS that is actively supported by Apple. For more information on MacHTTP-js, or to download the fully functional MacHTTP-js Preview version on macOS, free of charge, visit their web site.