Today I found myself stuck: I couldn’t delete a directory from my Mac, no matter what I tried, sudo or not.
Turns out, for some reason the
schg flag was set on that folder.
schg, or “system immutable” flag, prevents even root from doing anything with that file. Fortunately, root is allowed to remove that flag, and then delete the file.
sudo chflags noschg undeletable_file_or_folder
sudo rm -rf undeletable_file_or_folder
(Always be careful copying and pasting
sudo rm -rf commands from the internet.)
Today I helped my brother with a Keyboard Maestro macro he needed. Basically, he wanted to take some text from a PDF created by Notability, which inserts new lines to have text flow around images, and remove these new lines.
Pretty easy, I thought:
tr and remove
\n. Nope. For some reason, maybe some old Mac OS 9 heritage, when copying text from Preview new lines are saved as carriage returns, i.e.
This stupid behavior means that if you try to pbpaste something which contains line breaks in your terminal, you only get the last line. You can view the full output by replacing
This lame thing had me waste some time, so I hope this short post makes your life easier.
P.S.: The full command I had my brother put in Keyboard Maestro is:
pbpaste | tr '\r' ' ' | pbcopy
Followed by a Paste action. This replaces line breaks with spaces and pastes the result.
Since the introduction of iCloud in many OS X apps in Mountain Lion, we’ve had to live with the pointless “Open from iCloud” window every time we launched these apps. I’m speaking mainly of TextEdit and Preview, but recently even more apps got this useful feature, such as Automator and AppleScript Editor.
This. We all hate this.
But last month Apple released Mavericks, which came to save us from this hell. It offers a great solution: the ability to enable/disable iCloud on a per-app basis, thus allowing us to only have it on apps that benefit from it (Pages and Byword, for example).
Without further ado, let’s go and kill iCloud for TextEdit & co.
It’s pretty easy: just go to System Preferences/iCloud and click the “Options…” button next to “Documents & Data.
A nice popover will appear and it will let you chose the apps in which iCloud documents will be available. Deselect any apps you wish, and then click “Done”.
Freedom. Enjoy the sense of freedom that comes from your apps being iCloud-free again, like in the good ol’ days.
Now, the next time you open TextEdit, you will be greeted with a glorious empty document, ready to be filled with your awesome words.
Today, when I booted my Mac I noticed it was really unresponsive, and the fans immediately started going up like crazy. Through Activity monitor, I found the cause for this: coreaudiod was using 100% of my CPU. And force quit did not help.
Core Audio is the framework that manages audio on OS X, and it’s awesome, except when it suddenly decides to go crazy and suck all my CPU.
After some googling, I found this post by Axel Jensen, and it literally saved my day.
Basically, for some unknown reason, my /Library/Preferences/Audio/ folder had disappeared, and that really angered coreaudiod. As Axel found, the solution is pretty simple: recreate the folder and set the correct permissions, with just two terminal commands.
sudo mkdir /Library/Preferences/Audio
sudo chown -R _coreaudiod:admin /Library/Preferences/Audio
I did some additional research and found out that it’s also safe to restore that folder from a Time Machine backup, or any other backup really, just make sure to set the proper permissions with the second command above. This way I was able to get my aggregated audio interfaces back, and I did not have to re-create them in Audio MIDI Setup.
A friend of mine and I host a weekly podcast and, as it often happens, we speak with our guests via Skype. For a while we had everyone record his own audio, since we wanted to have a separate track for each person in order to get the best possible audio quality. But that was inconvenient, both for our guest and for us, as we had to wait everyone to send us his audio before mixing and editing the episode. Recording Skype’s group call in a conventional way wasn’t a better solution. We’d only have two separate tracks: mine and everybody else’s, This is fine if there is only one person other than me, but it’s not with more guests.
So I started to think on possible solutions, and the best one that came to my mind was to have a separate instance of Skype running for each guest (I’ll explain how to do this later on) and use Ableton Live to record each track and to manage the audio routing.
Ableton Live is quite expensive, though, and if you don’t already have some experience with it that justifies purchasing a license, I’d advise you to check out snkl’s post that explains in detail how to achieve the same result with a much cheaper (but still great) app: Rogue Amoeba’s Audio Hijack 3.
My awesome hand-drawn scheme
To manage the audio, we need some sort of virtual audio cables to connect Skype to Ableton Live. The best tool is SoundFlower, so head over to their site, download and install it. However, it is not ready for our purpose right out of the box: we need 2 “virtual audio cables” for each Skype instance, and Soundflower only ships with 2 of them enabled by default (and only one of which, the 2 channel one, is suited for our needs). I managed to edit Soundflower’s plist file to get more.