Search and copy .olm files from systems running macOS

Exporting to a Mac Data File (.olm) allows macOS users running Outlook to create a copy of their email messages, contacts, and other items. These files are not mountable and can be thought of as backup to your mailbox.

export to Archive file (.olm)

Like .pst’s found on Windows systems, .olm’s often create problems for organizations.

Continue reading

Quickly find files on macOS via the Terminal using mdfind

Spotlight Search

MacOS users can use Spotlight to help them find apps, documents, and other files on a Mac computer. Spotlight builds and maintains an index containing all this information which makes it easy to quickly find what you are looking for.

But did you know the Spotlight index is also used by mdfind, which is a command designed to be run from the terminal?

Continue reading

Run rkhunter from a crontab

Rootkit hunter is an open source Unix/Linux based tool that scans for backdoors, rootkits and local exploits on your systems. It scans for suspicious files and works like a file integrity checker.

The team behind rkhunter recommends installing same-class tools like Chkrootkit or OSSEC-HIDS which compliment the overall security of a system. On this entry today we are going to review:

  • How to install rkhunter
  • Create a bash script that can be executed from a crontab
  • Setup the crontab to run daily scans
  • How to prep rkhunter

Continue reading

xprintidle script

Below is a simple bash script I developed which checks to see whether a user is using the X Window System before attempting to do something. Basically it checks to see if the system is idle. This can be useful if you want to run a backup or a virus scan without impacting a user that may interacting with the desktop environment.

In this example we will consider the system idle if no user interaction with the X Window System has occurred for 10 minutes. Afterwards the system will shut itself down (ideal following a backup)

Continue reading

Expect scripts

Expect is an extension to TCL scripting that can automate interactions with programs that expose a text terminal interface. This is useful for situations where you wish to automate a task but encounter certain prompts that cannot be bypassed.

In the example below we will use a password as the prompt we wish to programmatically bypass when authenticating to an sftp server. Then we will copy all the local files to a destination directory and then purge the original copies.

Continue reading

© 2019 revelset

Theme by Anders NorénUp ↑