• Mac OS X,  Mac OS X Server,  Mac Security

    systemstats in OS X

    Ever wonder what your computer is up to? Ever wanted to know how much time the computer was awake for, how much battery was left, the exact percentage of use each core was taking up, how much CPU CrashPlan is using, etc? Well, lucky you, there’s systemstats. You just run it: systemstats And it tells you all kinds of juicy stuff. Summary ======= System Version: 13A598 Total Time: 195:13:01 Usage ===== Time on A/C: 165:42:24 Time on Battery: 29:30:35 Wake Time: 181:18:08 User Active: 46:46:18 User Idle: 134:31:49 Dark Wake Time: 00:01:15 Sleep Time: 13:53:37 Standby Time: 00:19:57 Battery ======= Time on Battery: 29:30:35 -10.2 %/hr -21576 mAh -7112 mW Wake:…

  • Mac OS X

    Repair Permissions From The Command Line

    I’ve long been a supporter of building tools in self service portals such as those provided by JAMF and Munki to provide users who don’t have administrative permissions to perform tasks that wouldn’t typically otherwise be destructive. One such example is a simple repair permissions. An administrator can simply open Disk Utility, select their disk and then click Repair Disk Permissions But if you want to do this as a user who doesn’t have administrative privileges you would need to elevate your privileges before doing so. In a larger environment this would be incredibly annoying for dozens, hundreds, thousands or even tens of thousands of users to bring their computer…

  • Active Directory,  Windows Server

    Obtain UPN from PowerShell

    A UserPrincipalName (or UPN) is an attribute that contains an Internet-style login name for a user based on the Internet standard RFC 822. The UPN is used for a lot of different tasks, notably for Kerberos/Single Sign-On. As such, there are a lot of scripts that can now key off of a UPN. You can use the Get-ADUser cmdlet to query accounts for the UserPrincipalName attribute. To do so, we’re going to -Filter our results to display everyone (although we could include a username to only get one user) and then define the Search Base (using -SearchBase) to refine where in the query that the search will begin. Use the –Properties parameter…

  • Active Directory,  Windows Server

    Rename a Windows 2012 Server Using PowerShell

    When you are creating a bunch of Server 2012 Virtual Machines (or physical machines for that matter) it is helpful to programmatically change their names. To do so, use the Rename-Computer PowerShell cmdlet followed by the name you want the computer to have, as follows (assuming a name of 2012.krypted.com): Rename-Computer 2012.krypted.com Before you do anything else (e.g. bind to AD) you should then reboot the host, using the Restart-Computer cmdlet: Restart-Computer

  • Home Automation,  Mac OS X,  Minneapolis,  sites

    Control the Weather Using Curl

    Wait, did I say control, I meant query… Sorry to disappoint! I am a home automation nerd. Recently I’ve noticed that as it gets closer to warmer or cooler extremes that it takes longer for my hvac system to bring my house to the temperature I want. I’ve also noticed that NEST claims to automatically learn these factors. Not to be outdone by the Griswolds, I decided to look at building this into my system. I had been experimenting with using the weather.com site to pull this data but then someone pointed out that NOAA (the National Oceanic and Atmospheric Administration) actually publishes this information on their site. I was…

  • Mac OS X

    Units

    Go figure, there’s a command that can convert some units to other units. The units command is able to take a number of one type of units and then convert them to another. For example, to convert a mile to feet: units "1 mile" feet Or to convert 2 hours to seconds: units "2 hours" seconds For a full listing of the formats supported, check out /usr/share/misc/units.lib.

  • Windows Server

    Configure Volume Shadow Copy on Windows Server

    Working with Shadow Copy requires elevated privileges. I usually access Shadow Copy through vssuirun. This prompts for elevating privileges. Once open, use the Settings pane to select the volume you’d like to schedule backups to. Then choose how much space shadow copies can use. Click on the Schedule button to configure how frequently backups run. I usually try to time these things for when the server isn’t slammed. Otherwise you might run into issues. By default, Shadow Copy keeps 64 versions of each file. Running snapshots every hour. You can restore easily, by selecting a volume, although volume-based restores are not supported on system derives. Restores can be done using…

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment

    Who Needs Root When You Can Have Simple Finder

    Here’s the thing: I’m not very good with computers. So to keep me from hurting myself too badly, I need the simplest interface available that allows me to run multiple applications. But most of the command keys shouldn’t work in this interface and I should only have Finder, file and Help menus. Luckily for my poor MacBook Airs, Apple thought of people like me when they wrote the Finder and invented something called Simple Finder which makes OS X even simpler than it is by default to use. To enable Simple Finder, just go to Parental controls, enable controls for a user and then check the box for Simple Finder.…

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment

    A Well Caffeinated Command Line

    One of the big things in OS X Mountain Lion is how the system handles sleeping and sleeping events. For example, Power Nap means that now, Push Notifications still work when the lid is shut provided that the system is connected to a power source. This ties into Notification Center, how the system displays those Push Notifications to users. Sure, there’s tons of fun stuff for Accessibility, Calendar, contacts, Preview, Messages, Gatekeeper, etc. But a substantial underpinning that changed is how sleep is managed. And the handling of sleep extends to the command line. This manifests itself in a very easy to use command line utility called caffeinate. Ironically, caffeinate…