Skip to main content

Posts

Showing posts with the label macOS

User Notification & a Talking Mac

  In today's world where social media has become part of our lives like never before, things have started to make more sense when they are personalized with emojis & GIFs. Cyberpsychologist (oh, it's funny if you've never heard of them?) argue that just by sending emojis we can change someone's state of mind. We can discuss more how your girlfriend or boyfriend didn't let you sleep all night with that one emoji she sent you. How about adding much-loved emojis & talking personally to the logged-in user? The human tendency is to act better in when things are familiar to them. But, this post isn't about Cyberpsychology, so we'll go back to Mac. So, when we know this personalization & emoji works so well, why the notifications that are sent to the users so damn boring? Well, maybe no one thought about it, or maybe we don't care enough. Well, for the ones who want to break the taboo, here is a quick HealthCheck framework that will talk to the user

macOS Automation & Scripting

Here are the resources we all use. Give it a try: guillaumegete/dmg2pkg: Make DMG from PKG Positioning a window in macOS – Alexis Bridoux Automating automatic login for macOS – brunerd Piping stdout and stderr to Preview – Erica Sadun Programmatically logout a user in Swift – Alexis Bridoux Troubleshooting “zsh: operation not permitted” – Alan Siu Simplifying pkg recipes with AppPkgCreator – Elliot Jordan Using diskutil to find secure token users on a Mac – Alan Siu Logic Pro scripty bits: tracking current Input device – Charles Edge Allow standard users to manage printers with a Munki NoPkg – Kevin M. Cox Trusting Certificates in System Keychain without Prompting – Twocanoes Software

Welcome the new macOS - Mojave

Apple has released 3rd Beta verion of their macOS Mojave, so we thought to give it a try. What we found is that the product is really promising. They have improved many things that we never realized is actually a need.  Instead of writing what we loved, we prefered to collect posts that include all new features. If anyone needs Mojave Beta release, please send an email to:  Laeeq.Humam@hcl.com , we would be glad to share it.    List of new features: https://gizmodo.com/all-the-new-features-coming-in-macos-10-14-mojave-upda-1826531489 https://appleinsider.com/articles/18/06/09/90-new-changes-features-in-macos-mojave https://fieldguide.gizmodo.com/10-useful-new-features-hidden-in-the-macos-mojave-beta-1826603113

How to get current loggedin user on Mac via script

I won't waste time wiring details. This works as of today, but what will Apple do in future, only God knows.  🤓  It's always suggested to run the command without variable to ensure it work, but you probably know that.  CurrUser=$(echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }')

Java Packaging for Mac

What changed with Java 8u65 is that Oracle changed its installer from .pkg to .app Why you should not waste time taking snapshots of Java because you already have the deployable package stuffed insde the Java installer.app. When you open the dmg, you would see the following. This is .app and you can install it by double click, but you would not do if you are packaging for mass deployment.  So here is what you can do to get the retro Java installer in .pkg format so that you can deploy it right away in the entire enterprise: Right click and select 'Show Package Contents' Navigate to this path 'Content > Resources > and look for JavaAppletPlugin.pkg This can be used to deploy in your organization and it is ready to be used.

Creating NetBoot, NetInstall & NetRestore Images

Everyone has a different reason for writing a blog. I do it for the newbees who can step into the world of Mac but at the same time, I use the blogs as reference manual for myself and use then when needed. Since quite some time I had been thinking on writing a document on this but I came across this Apple KB. Please visit here:  HT202061 This will help you as starter to create NetBoot, NetInstall and NetRestore images. If you are even newer and need to understand these terms, you can visit here:  https://support.apple.com/en-us/HT202652 And if you want to do it via command line, visit this KB article:  https://support.apple.com/en-us/HT202770 I follow the non Apple way when it comes to Imaging the OS, its personal preference. Hope these articles will lead you to much advance and helpful ones as well. Cheers!!!

Creating MS Office Package & Updates

  Hello Composer Lovers! :) So lets see how is it done using Composer or any other tool for that matter. The major steps remain same in all packaging tools, its just the post install work that might change a little bit. However, if you get stuck with any other tool like Packager, PackageMaker, Luggage or  AutoPKG, feel free to write back to me. Steps would sound same as in FileWave, just few of the things will change. Install the required version Install the available MS updates Locate all the files mentioned below In Composer, click on New and take a blank snapshot or do via Monitor FileSystem Changes Delete everything that got captured Drag & drop the Files and Folders mentioned below in Composer Item 15 should be sent to /tmp/ Add a Post Install script to run the installer from /tmp/ -  Volumes/Microsoft Office 2011/Office Installer/Contents/Packages/Office2011_en_dock.pk g. See the inline for hint. ​  ​<sudo> installer -pkg /tmp/Office2011_en_dock.pkg -target / Export int

How to create OS X image for deployment

Although there are various tools that works successfully but I would want to cover one at a time. This image creation is done for NetInstall or NetRestore purpose, that means, after doing a netboot, you can use this image to install a fresh OS on your Mac. Its simple, its quick and all you need to know is how to use mouse. Before you begin, make sure that the current running OS and the OS you want to build should be same. Lets begin :) What you need: OS X 10.9 from App Store (well, any OS you want). Steps are given in other post  here . AutoDMG  app from this  link Simple Steps: Launch AutoDMG. There is nothing to install. The downloaded file can be double clicked to open and then double click on AutoDMG icon. Drag the Install OS X Mavericks.app (you had downloaded from App Store) on AutoDMG. It will examine the files and then show you the list of updated available for this version. Select if you want to install all updates. If done, it will download it online and add in the applicatio

How To: Trace a Packet on WiFi using OS X

If you dont know what would be the use of this article and what can be done by tracing packets, then probably this article is not for you. :) So lets begin! Find out what is the BS Device ID of your WiFi by going to System Profiler. Let me grab a screenshot here: Now lets use the command  tcpdump  to get what we are looking for. Also, there is another command  airport  to do similar job but we will cover details of that tool in upcoming post. sudo tcpdump -i en0 -s 0 -B 524288 -w ~/Desktop/TracePacket1.pcap It should display the details as - tcpdump: Listening... Once this is complete, close down the process. You have a TracePackage.pcap ready with the packets. Now we need to read what has it got. So we will leverage tcpdump again: tcpdump -s 0 -n -e -x -vvv -r ~/Desktop/TracePacket1.pcap Using this you can do network troubleshooting, debug a network problem. If you find yourself dumb enough to do this, you have some helpers out there, watch out for these tools, they will do the same

How To: Bash Script to add AD User & Group to SSH in Mac

Today morning I got a request from Green IT folks to enabled SSH on all the Macs that we have in Enterprise. Currently SSH is not enabled on clients and not even the Admins are allowed to do so. As it was against InfoSec policy of the client, they needed a solution that ensures SSH is not enabled for anyone except couple of Service Accounts that does background job. So what I proposed was simple, to create a Security Group in AD and add all Service Accounts to that Group and grant SSH access to that group. Now, no one else will be able to access via SSH except the members of this group. So here is what I wrote for them. In this script Joulix is the AD account and HM Admin Mac SSH is the AD group that needs SSH access.:   #!/bin/bash   # To add the User / Group to be able to do ssh. # Created by Laeeq Humam | 10.10.2014 | for HCL # Wrote for Green IT via Cisco Joulix. UN="Joulix" MACSSHGROUP="Admin Mac SSH" # Will use this group and user probably once or twice. Varia

Tips: How to List Folder Size on Mac

  Hello Again! I have 99 folders inside /Documents/Scriptology/ and I wanted to see the size of all folders and see what can I delete from there. Unfortunately, by default, Finder does not show you size of a Folder on Mac. So had to find out alternative to get the information. Its pretty simple command that unix folks already know. Try this:  du -sh /Users/laeeqhumam/* | sort -n Very practical and very useful, you will get the information as the image below:

Tip: Get more info on WiFi by a click

If you ever, for any reason wanted to get more information and do a network diagnostic of your WiFi connection, you can do it just by a click. Hold down Option key and click / tap on WiFi option in the menu bar at the top. It would show you following window: You can see details of the WiFi network you are connected and also would give you option to 'Open Wireless Diagnostics' at the bottom of the menu.

How To: Delete Cache in Safari - Only Cache

So, if you already know about Safari, you might be knowing how to Reset Safari and probably that's how you delete the cache while troubleshooting. Right? Well, lets learn beyond this. Let the Helpdesk do Reset Safari for deleting Cache. Today we will cover the advance and more accurate ways that will just delete the Cache and not touch anything else. Let's begin: Launch Safari Go to Safari Menu > Preferences Under Advanced tab you will see a check box for Show Develop in menu bar Close this and go to Develop menu and select Empty Cache - you are done. Let me know if you need screenshot for this post :) If you want to take this Cache deleting thing to the next level, I have more to show you. Navigate to this location:  /Users/Library/Cache/com.Apple.Safari/Cache.db This Cache.db file should be trashed and there would not be any cache left over. Relaunch Safari and it will create a new Cache.db file. Drop a line if you are interested in learing more about handling Cache on Mac

How To: Sleep, Restart & Shut Down using Terminal

I will make this a quick post with three options of  shutdown  command. There are different command for this purpose but  shutdown  is cool to remember. In order to shutdown, type the following command: sudo shutdown -h now On enter it will begin the shutdown process. It is a rather severe shutdown process. It will not tell you to save documents if they are open. You can replace the word ‘now’ with a time in the 24 hour format. To restart use the following command: sudo shutdown -r now To put your Mac to sleep use the following: sudo shutdown -s now You can do more by entering time in 24hrs format. Do a  man shutdown  to learn more.

How To: Enable / Disable FileVault via Command Line

If you are reading this post, I assume that you know what is FileVault and when you need to enable or disable it. When free, I would try to write a post explaining FileVault. How to Check Status To check the status of file vault within Terminal type the following: fdesetup status This should tell you the status of FileVault How to Enable Filevault To enable FileVault type the following: sudo fdesetup enable You will need to enter your admin password. After this you will be guided through steps to complete it. This key has to be written somewhere as this key will help you to recover your disk incase you forget your password. Once done, you can reboot it. This is to create on a specific user account. How to Disable Filevault If you want to disable FileVault you can. Type the following into Terminal: sudo fdesetup disable This will disable FileVault. So if you are interested to know more about this command, do a man check: man fdesetup

How To: Enable Remote Management via Terminal

I try to mention the situations and issues that I face in my daily life to ensure the knowledge is spread in fixing real time issues. I was in a situation where I had to turn on Remote Management from CLI. My colleague turned off the Remote Management and he lost the remote session while troubleshooting and there was no one to turn it ON at user's end. Fortunately, we use BOMGAR (remote support tool) and it is capable of running commands on user's machine even Remote Management is turned off. So in order to turn Remote Management On, I ran the following commands in the Command Line of BOMGAR: cd /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources and then: sudo ./kickstart -activate -configure -access -on -privs -all -restart -agent and you are done. The Mac will be ready and you can take remote session again. You can run this command directly on the Mac to enable 'Remote Management'.

Fixing MS Lync Error OC_KeyContainer_user@hcl.com

Last week I came across this problem and deleting the default keychain did not fix it but somehow could not devot much time to fix it. As the solution was not available on Google, I thought to post it here. The error was:  Microsoft Lync wants to use  OC_KeyContainer_username@company.com . Please enter the keychain password  prompt appeared. Unfortunately I forgot to take the screenshot of the error message but it somehow looks like the regular keychain popup window. Worst thing about this error was that Keychain login screen was not accepting any password that I could think of, even though it was the correct one, which actually made it a strange issue for the people who are into the world of Troubleshooting Mac OS. So lets have a look at Root Cause and then at the Fix. The Cause: Microsoft Lync creates a keychain file to store encryption keys. The file is physically stored in  /Users/username/Library/Keychains  and is named something similar to  OC_KeyContainer_LaeeqA@hcl.com .  This

Troubleshooting: Reply / Forward Button not Responding in Outlook 2011

When you click new message, reply, or forward in Outlook for Mac 2011, nothing happens. Following is the recommended solution from Microsoft. Not all of them will work for you, in my case I had to go all the way to step #5 to make it work and I did not follow step #3 i.e. to validate fonts.  Step 1: Reinstall Safari  To reinstall Safari, contact Apple support:  https://www.apple.com/support/contact/ Safari is a browser installed on your computer. If the browser is not working correctly, Outlook will not function. Therefore, you need to reinstall your browser. You can reinstall Safari browser on your own but if you for any reason can't, contact Apple support. To reinstall Safari, visit  Apple Safari  web site, enter your email address and click Download Now. Follow directions on your screen, then open .dmg file.    Step 2: Download and install the latest Apple software update Click the Apple menu, and then select  Software Update . The Software Update window will open and check for