The ffmpeg command is pretty rad. I’ve written about it before, but now I’m using it to rip the audio out of video podcasts that don’t need video. Extracting an mp3 from video that doesn’t need any video means I can have way more on my iPhone. So here goes: ffmpeg -i randopodcast.flv -vcodec mpeg2video randopodcast.m2v -acodec copy randopodcast.mp3 The video is pretty irrelevant for what we’re trying to do, but it’s great to have smaller files and more of ’em!
-
-
Create 10,000 Empty Directories for Testing
The mkdir command is used to create directories. Sometimes, in testing, you need to have a lot of directories. So, you can use the following command to create 10,000 5 digit directories, named 00001 to 10000: mkdir $(printf '%05d\n' {1..10000})
-
Remove Empty Lines From A File
The following command will remove all empty lines from a file called badcommand.sh: sed '/^$/d' badcommand.sh
-
Using odutil with opendirectoryd
The options for Open Directory continue to get more refined, aligning with opendirectoryd. The odutil command is becoming more and more useful with each version of OS X. Let’s inspect the directory service cache, using odutil with the show verb and the cache option: odutil show cache You can also view statistics for opendirectoryd using that show verb but with the statistics option: odutil show statistics And to see everything, use odutil with the show verb and the all option to get plenty of data to grep through: odutil show all The final show option we’ll look at is configuration. Here, you will also need to feed a directory nodename…
-
Edit NetBoot Sets Without Creating New Images
Mac admins spend a lot of time building images. In System Image Utility this can mean baking an image that just looks for a path of a NetRestore source and restores an operating system. Constantly making these is a pretty duplicative task. The goal of this article is to take a generic NetRestore NetBoot image and augment it in such a way that you don’t need to create new NetBoot images unless there’s a new build train. Instead, all you need to do is edit a file that changes the path (uri) of your image so that it can be restored. Using this, you can just stop the NetInstall service in…
-
Ask serveradmin If an Open Directory Certificate Authority is Available
The serveradmin command has an option to run commands. I’ve talked about these in past articles, for doing tasks like asking how many concurrent NFS connections are open on a host. Well, here’s another, and it’s a simple command. Here, we’re going to look at whether the Open Directory server has a CA. To do so, we’ll use the serveradmin command, along with the command verb. Then, we’ll add the certs option, followed by command= and then the payload of the command. In this case that’s isODCAPresent: sudo serveradmin command certs:command = isODCAPresent This is a simple, informational command, similar to the web:command of getSites or the mail:command of getConnectedUsers.…
-
Bypass the Application Downloaded From the Internet Warning in OS X
___ “is an application downloaded from the Internet. Are you sure you want to open it?” is a warning dialog that appears when you open an application that you downloaded from the Internet. When you install those software titles with automation, you can clear the attribute that causes the prompt, so you don’t get a lot of confusion from end users. TO do so, use the xattr command, using -d to delete the com.apple.quarantine attribute. Here, we’re going to do so recursively, using the -r option and finally defining the application: sudo xattr -d -r com.apple.quarantine /Applications/iExplorer.app
-
More Command Line Service Control In OS X
The serverctl command can be used to start and stop services in OS X Server. Use serverctl with a list verb to show a list of services: serverctl list Grab a service (without the quotes) and feed it back into serverctl with the enable option and a service= option to identify the service: serverctl enable service=com.apple.servermgrd.xcode Or disable, using the disable verb: serverctl disable service=com.apple.servermgrd.xcode
-
Restart Macs Down Immediately in OS X
You can shut (and restart) Macs down immediately using the shutdown command. To do so, run the following command: shutdown -r now
-
Use the textutil Command To Query Office Files For Metadata
You can use the textutil command to pull metadata information from Office documents. Here, we’ll use the -info option to do so: textutil -info hello.docx The output would be as follows: It might display: Type: Word format Size: 44068 bytes Length: 4234 characters Title: Author: Charles Edge Last Editor: Charles Edge Subject: Keywords: Created: 2015-06-28 08:21:00 -0900 Last Modified: 2015-06-28 10:02:00 -1200 Contents: Hello world