• Mac OS X,  Mac OS X Server,  Mass Deployment,  Ubuntu,  Unix

    Kill Processes With Open Handles on PIDs

    You can kill a process using the kill command. You can use lsof with -n to see the processes that have connections to a file. So, here, you can see lsof showing all files with an open connection: lsof -n You can also use the-c option to constrain output to a specific string. The kill command can then use the lsof command to kill all those processes, as follows: kill -HUP $(lsof -n -c /tty/i -t) Free your files…

  • Mac OS X,  Mac OS X Server,  Ubuntu,  Unix

    Basic bash Looping

    In bash, there area number of ways you can write loops. Here, we’ll look at putting a single line with a loop in it. This will be done using the for command. For requires a do and a done. The do is what we’ll do for each iteration. Here, we’ll just run a loop from 1 to 10 and then we’ll do an echo on that variable so it displays on the screen as well loop: for i in {1..10} ; do echo $i; done The output would then be as follows: 1 2 3 4 5 6 7 8 9 10

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

    Sell Some Bushel

    So one of the projects I’m very involved in is a simple, new Apple Device Management (or MDM really) solution, called Bushel. By default, we give people 3 devices for free. If you’re in a position to refer people to Bushel, you can also use links that you send to people that will get you even more free devices (up to 10). But some people want to sell things and earn commissions from them. And we fully support that. So you can become a Bushel affiliate and earn commissions from any referrals you send us. To sign up to become a Bushel affiliate at http://www.bushel.com/affiliates. There, you can find links…

  • Mac OS X,  Mac OS X Server,  Ubuntu,  Unix

    Separate commands on one line in Bash

    In bash, you can run multiple commands in a single line of a script. You do so by separating them with a semi-colon (;). The great thing about this is that if you end up using a variable, you can pass it on to subsequent commands. Here, we’re going to string three commands together and then echo the output: a=1;b=2;c=$a+$b;echo $c because we told c to be $a + $b, the $a expands to 1 and the $b expands to 2, we throw them together and then echo out the contents of c$ which appears as follows: 1+2 Now, we could have this thing do math as well, by wrapping…

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

    Use scp To Connect To A Remote Mac And Copy A File

    Use scp to connect to a remote host and copy a file. To do so, use the -E option, followed by the source file, in this case the path for that file is ~/elcap.dmg. Then do the username followed by a : and then the password. Those credentials are then being used on the server defined by the @ symbol and then the fqdn of the host, all together here being krypted:mrrobot@imaging.krypted.com where krypted is the username, mrrobot is the password and imaging.krypted.com is the hostname of the target box running ssh. Then just list the path and filename of the target. In this case, it would be /Users/krypted/Desktop/elcap.dmg: scp…

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

    Mavericks Server: Enable APNS Debug Logging

    Troubleshooting push notification communications between OS X Server and Apple’s Push Notification can be a challenge. Especially with Profile Manager. One great tip I’ve learned over the years is that the APNS daemon, apsd, has a debug mode. To enable APNS debug logging, run these commands: defaults write /Library/Preferences/com.apple.apsd APSLogLevel -int 7 defaults write /Library/Preferences/com.apple.apsd APSWriteLogs -bool TRUE killall apsd Then use tail -f to watch the apsd.log file at /Library/Logs/apsd.log. Be wary, as this can fill up your system. So to disable, use these commands: defaults write /Library/Preferences/com.apple.apsd APSWriteLogs -bool FALSE defaults delete /Library/Preferences/com.apple.apsd APSLogLevel killall apsd

  • Bushel,  iPhone,  JAMF,  Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment

    Make Bushel’s Open Enrollment URL Easier To Use

    Many choose a pretty long company name when signing up for Bushel. The Open Enrollment link is generated based on the shortened version of this company name. This link can then be supplied to your users to make it quick and easy for them to enroll (or add) devices into your Bushel. Some end up with a company name that’s difficult to tell others or difficult for others to type. Many of our customers would also like a link on their site that customers can be pointed to. There are a few ways of achieving shorter, easier, or custom links. We’ll go through two, but there are a lot of other strategies you…