Decompile Non-ReadOnly AppleScripts

Forgot to save the source code of those AppleScripts in a place you can find it again before you compiled? Quick and dirty, provided you didn’t save it as ReadOnly, you can grab the source of an AppleScript using osadecompile. Just feed it the app (not the applet or the main.scpt btw), as I do with /Users/charlesedge/Documents/ below: osadecompile  /Users/charlesedge/Documents/ Easy peasy.

Some Reasons Not To Pay Down Tech Debt

Every development organization has tech debt. Modern development projects have gotten so large and complex that there are now dozens of libraries, frameworks, and services implemented in a modern solution. Additionally, there are always new techniques, new modules, new frameworks, new skills, and new perspectives. Applications are now ecosystems, constantly evolving, and our perspectives about them must evolve as well. Yes, a burn down chart looks better when you pay down the debt. Yes, security flaws can force you to pay down technical debt. Yes, most developers always want to fix all the things, including impending dead technology. Modern solutions have many stakeholders. The modern roadmap has to include benefits for existing customers, senior management, the people you send into the field, and net-new customers, coming in based on new features that need to get implemented. You can’t implement new features that help to retain customers and acquire new customers if you are always paying down technical debt. Here are 10 good ways to tell if you need to re-evaluate plans to pay down some technical debt:
  • There’s a new version coming out. Let’s face it, there’s always a new version just around the corner. But a release can be imminent. Take into account the timeline of a new release and choose where to spend your precious development capital, being careful of frameworks, libraries, and services that have a new version about to come out.
  • A version is too new. A cooling off period is necessary with any new technology. Otherwise, you’re learning about all the bugs and limitations of a new solution in real-time. The larger a development organization, the longer it takes to develop the institutional assets required to perform a large-scale effort to implement new technology. And the greater the risk if you go the wrong direction. For example, if you are already updating production applications to Angular 2, are you sure that’s a good idea?
  • You have to retrain an entire team. Retooling an entire scrum team, or larger efforts require you to rethink how you approach various problems, and can require hundreds of hours of training for engineers. When you are looking at larger projects, consider how much time the new tools will save versus the cost to bring in experts to train your staff, as well as the hours required to actually do the work.
  • You can’t hire talent that know the new technology. This is a huge red flag. Maybe you can’t hire someone to help you out because the supply is tapped, maybe you’re trying to implement a framework that’s too new, maybe the library is too old, or maybe it just plain sucks. Either way, if you can’t find engineers willing or able to implement, rethink the whole situation.
  • The cost of doing the project is greater than the cost of other efforts if you do not do the project. Not paying down technical debt accrues interest. That interest can build up over time. But what if it doesn’t? What if the new project makes others more complicated, or doesn’t simplify others? Consider the impact to other initiatives, both positively and negatively when prioritizing your technical debt; especially smaller projects.
  • You have to replace other parts of the solution to make the new parts work. We’ve all been there. You have 4 libraries that don’t work with the new framework. If you start the implementation of new technology, you’ll want to check on each interconnected framework and library prior to beginning to do so, if only so you can properly estimate the time required.
  • Solutions come with new licensing requirements. As noted, most modern projects are ecosystems of dozens of open and closed source libraries (if not more). Many teams now keep a document, or entire database, of the types of licensing used for each of the building blocks that make up the stack of a given application. Each time you update to a new version, you’ll want to first validate that you aren’t entering into an entirely new set of licensing terms.
  • Initial tests go poorly. OK, so you don’t need to scrap a project just because projects where you attempt to scratch the surface go poorly. I like to start with some small wins, stick my toes in the water, and then re-evaluate timelines based on how the initial tests go. You want to get some nice momentum on the burn down chart before you head into deeper waters when doing larger development projects.
  • You can’t compartmentalize the new technology. Let’s say you’re implementing React Native into an application. You already have a user interface that users have been using for, in some cases, several years. Can you implement React on a screen-by-screen basis, or given the architecture of your existing app, will you have to do the whole thing at once? If you can’t compartmentalize the new technology, is it really right for you?
  • You are spending more to pay down technical debt than on new features. Mature products often get you into a place where you’re spending more to keep up with your existing code base than you spend to implement new features in your tools. When you get into this kind of scenario, you definitely need to stop accruing technical debt; however, you should re-evaluate whether a much larger rewrite would be more appropriate than fixing little things here and there.
  • Your goal can be accomplished in another way. Let’s say you have an API, and you never bothered to ship documentation on using the API. This is actually pretty common. There are tools like HATEOAS ( that can allow you to basically self-document the API within the API. Is it better to do that or publish a quick PDF on using the API? Either way, you need the PDF. Most of us would, if time allowed, prefer to go the HATEOAS route; however, again, we have to be judicious with our time.
Ultimately, we all have a limited pool of resources. And as our solutions grow, the amount of effort required to update parts of the code will grow as well.  A lot of these tips involve taking into account the resources required to update the building blocks of a larger application, or project or timing. There’s no doubt that the longer you incur the debt on each of your initiatives, the more interest each incurs. But sometimes, it’s important to keep a larger picture in mind. With limited resources, there is no right answer when it comes to keeping your code modern. You don’t want to accrue too much technical debt. Otherwise code will become unwieldy and developers will run away from your organization when they realize just how much of a hurdle it will be to update your code. But you have to implement new technology in order to keep from keeping up with 30+ year old FORTRAN code in 2016. Next time product management and developers compete for prioritization, check these tips, and see if you’re going down the FORTRAN route, or keeping too modern; hopefully it’s somewhere in the middle.

151 Awful Computer Jokes

It all began with: “There are 10 types of people in the world: those who understand binary, and those who don’t.” It’s awful. But these days, there are soooooo, sooooooo many awful computery jokes to choose from. Such jokes. All the laugh. I’ve been collecting silly nerdy jokes about computers in a sticky for years. Now, you can read some of them! You’ll laugh, you’ll cry. Enjoy! What did the computer have at lunchtime? A byte What do computers snack on? Microchips There are no shortcuts in life, unless you right click and find one… Why was there a bug in the computer? Because it was looking for a byte to eat Program, noun: A magic spell cast upon a computer to enable it to turn input into error messages. Don’t anthropomorphize computers. They hate that! One day, a prince goes to a lair to kill the dragon. The prince cuts off his head but two new heads appear. The prince cuts off the two heads and four appear, after cutting those off 16 appear. Then 32, 64, 128, and finally after the prince cuts off 256 heads the dragon dies. Why? It was an 8 bit dragon What’s a programmer’s favorite place to hang out? Foo bar Computers let you make more mistakes than any other invention in history. With the possible exception of handguns and tequila. What do you get when you cross a computer and a life guard? A screensaver The closest I’ve been to a diet this year is erasing food searches from my browser history. I have a huge problem. A friend has placed a screen saver on my computer, but every time I move the mouse, it disappears. Getting a SCSI chain working is perfectly simple if you remember that there must be exactly three terminations: one at each end of the cable, and one for the goat, terminated over the SCSI chain with a silver-handled knife burning black candles. If it weren’t for C, we’d all be programming in BASI and OBOL. Why did the computer keep sneezing? It had a virus What is a computer virus? A terminal illness Is the aT symbol lower or uppercase? Why did the concurrent chicken cross the road? The side other To to get Why did Microsoft name their new search engine BING? Because It’s NOT Google! Optimist : The glass is half full. Pessimist : The glass is half empty. Coder: The glass is twice as big as it needs to be. “The cool part about naming you kid is you don’t have to add six numbers to make sure the name is available.” -Bill Murray “I’m not interrupting you, I’m putting our conversation in full-duplex mode.” – Antone Roundy C++ and C walk into a bar. C++ tells C it has no class. WWJD? JWRTFM! Three developers go into a bar and sit down at a table. The first holds up two fingers and says “Three beers”. 3 developers walk into a NoSQL bar. They left because they couldn’t find a table. Why did the devops developer quit his job? He didn’t get arrays The trouble with programmers is that you can never tell what they’re doing until it’s too late How did the computer get out of prison? Used the escape key What did the spider make on the computer? A website A developer had a problem and decided to use Java. They now have a ProblemFactory. Once upon a time, a computer programmer drowned at sea. Many were on the beach and heard him cry out, F1! F1!, but no one understood. What does a proud computer call his little son? A microchip off the old block. Algorithm: A word used by programmers when they don’t want to actually explain what it is that they did. A man shouts “Can you hear me?” to his son. The son says “What happened, did you run out of toilet paper?” The dad then yells back “No, restart the router, please!” Enumerator? I barely knew her… How many programmers does it take to change a light bulb? None. It’s a hardware problem. How many UX developers does it take to change a light bulb? None, they just make darkness a standard and tell everyone “this behavior is by design” When does a Boolean evaluated expression change a light bulb? After a while How many programmers does it take to screw in a lightbulb? None. Lightbulb is a class with method screw() so it can screw itself. How many technical writers does it take to change a lightbulb? None, the customer will figure it out How many developers does it take to change a light bulb? You’re still thinking procedurally. A properly designed light bulb object would inherit a change method from a generic light bulb class, so all you would have to do is call the light-bulb-change method. How many software engineers does it take to change a light bulb? None. The light bulb works just fine on the machine at my desk… How many IT Support people does it take to change a lightbulb? Have you tried turning it Off and On again? Child: When I grow up I want to be a Ruby programmer. Parent: You’ll have to make you’re mind up. You won’t be able to do both. What’s the object-oriented way to get rich? Inheritance The shortest joke about programming: I’m nearly done! What are the 2 kinds of SQL developers? Those who know how COUNT() treats NULLs, those who don’t, and those who don’t care When your hammer is bash, everything looks like a thumb. The sign of a compulsive programmer is somebody who can count up to 1023 on their fingers (OMG terrible binary joke) What do you mean, it needs comments!? If it was hard to write, it should be hard to understand–why do you think we call it code? //motto if (sad() == true) {sad.stop.();beAwesome();} Why do they call it hyper text? Too much Java Chuck Norris writes code that debugs itself. A Java architect, a .NET developer, and a COBOL graybeard walk into a bar. The barkeeper does a double-take and says… what is this, some kind of joke? Why don’t programmers pray? They don’t like throwing null pointer exceptions! Save the mallocs, free them all! [“hip”,”hip”] Kleeneliness is next to Gödeliness A programmer puts two glasses on his bedside table before going to sleep. A full one, in case he gets thirsty, and an empty one, in case he doesn’t. Why did the fly never land on the computer? He was afriad of the world wide web. How long does it take to copy a file in Vista? I don’t know either; I’m still waiting to find out. Why shouldn’t Facebook have paid $1 billion dollars for Instagram? They could’ve downloaded it for free! What do you call a Swedish software developer? Nerdic Why did the computer act crazy? It had a screw loose RFC 2324: When Shakespeare asked “To be, or not to be?”, he did not provide the answer. But 2B |~ 2B is FF Hardware: The part of a computer that you can kick. Walking on water and developing software from a specification are easy if both are frozen. ASCII stupid question, get a stupid ANSI There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors. Why was the JavaScript developer sad? She didn’t Node how to Express herself KDE is like eating bugs. It’s all right once you get used to it… What sits on your shoulder and goes “Pieces of 7! Pieces of 7!”? A Parroty Error! XML is like violence. If it doesn’t solve your problem, you’re not using enough of it. A couple that does SEO work had twins. For the first time they were happy with duplicate content. What computer sings the best? A Dell If at first you don’t succeed; call it version 1.0! In C we had to code our own bugs. In C++ we can inherit them. What is the difference between a programmer and someone that doesn’t write code? A non-programmer thinks a kilobyte is 1000 bytes while a programmer is convinced that a kilometer is 1024 meters What do airports and computers have in common? Terminals Two threads walk into a bar. The barkeeper looks up and yells, “hey, I want don’t any conditions race like time last!” 0 is false and 1 is true, right? 1 It’s been said that if you play a Windows DVD backwards, you’ll hear Satanic chanting…worse still if you play it forwards, it installs Windows. A Turing machine walks into a bar. The bartender asks, “what will you have?” After waiting a while for an answer, the bartender becomes impatient. “Cmon, what’s taking you so long?” The Turing machine replies, “I can’t decide.” How can you tell the difference between an introverted software engineer and an extroverted software engineer? The extrovert looks at your shoes when talking to you I’m nervous about programming in an untyped language—my penmanship is awful! There’s no place like There’s no place like ::1 I’m not bald, I just have “margin-top: 200px;” How many consultants does it take to kill a cockroach? Two: One to hold it still, the other to install Windows on it What does a baby computer call its father? Data There’s a band called 1023MB. They haven’t had any gigs yet. The word “algorithm” was coined to recognise Al Gore’s contribution to computer science. Cross platform apps are like unisex underwear. How do you keep a programmer in the shower all day? Give them a bottle of shampoo that says “lather, rinse, repeat” .NET is called .NET so that it wouldn’t show up in a Unix directory listing. Computers are high-speed idiots, managed and developed by by low-speed idiots. My password is “incorrect” because if I type it in wrong my computer will remind me, “Your password is incorrect.” Why did the Windows machine lose its trust relationship with the domain? Because it was corrupted in active directory and needed to be removed and added again! Old Dvorak had a farm, . c . c r All programs are poems; not all programmers are poets Yo momma is so fat, when she sat on an iPod, she made the iPad! Unix IS user-friendly, it just chooses its friends very carefully If you put a million monkeys on a million keyboards, one of them will eventually write a python script. The rest of them will write bash scripts. Why can’t computers play tennis? They just surf the net. A programmer goes to the store and asks “Do you have brown eggs?” The clerk says “Yes” The programmer then says “Then give me 10 sausages, please.” Waiter: Do u have any questions about the menu? What kind of font is this? “Knock, knock. Who’s there?” very long pause… “Java.” What’s Forrest Gump’s password? 1forrest1 Why are Assembly programmers always soaking wet? They work below C-level. A SQL statement walks into a bar and sees two tables. It approaches, and asks “may I join you?” Why is it that programmers always confuse Halloween with Christmas? Because 31 OCT = 25 DEC A developer is sent to the grocery store with instructions to “buy butter and see whether they have eggs, if they do, then buy 10.” Returning with 10 butters, the developer says, “they had eggs.” What happened when the web developers met? Love at first site! Why was the computer cold? It left it’s Windows open What does a computer scientist wear on Halloween? A bit-mask Why do developers go broke? They use up all their cache If Java is the answer, it must have been a really verbose question. Two bytes meet. The first byte asks, “Are you ill?” The second byte replies, “No, just feeling a bit off.” If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. Nothing seems hard to the people who don’t know what they’re talking about. Why was the computer late to work? He had a hard-drive. What do you get when you cross a computer with an elephant? Lots of memory What do you call 8 hobbits? A hobbit I would tell you a UDP joke, but you might not get it. An SEO expert walks into a bar, bars, pub, tavern, public house, Irish pub, drinks, beer, alcohol Computers are like air conditioners, they stop working when you open too many Windows Who is this Mailer Daemon? And why is he sending my emails back to me?!?! The man who invented autocorrect has died. His funfair is next Monkey. I’m sorry for my terrible English, but my native language is Perl. What is an alien’s favorite place on a computer? The space bar! If I wanted a warm fuzzy feeling, I’d antialias my graphics! Why do Java developers wear glasses? Because they can’t C# C++, where your friends can touch your private parts. If brute force doesn’t solve your problems, then you aren’t using enough. What do you get when you cross a computer with an elephant? A 1000 lb know-it-all. Why doesn’t the elephant use the computer? Because it is afraid of the mouse! Why did the computer squeak? Because someone stepped on it’s mouse Why did the cat sit on the computer? To keep an eye on the mouse Why couldn’t the dinosaur play games on the computer? Because he ate the mouse Where do all the cool mice live? Mousepads Why can’t cats use computers? Because they only want to chase the mouse How does a tree get on the computer? It logs on! What did the computer say to the cookie? Can I have your chocolate chip? A girl asked her mother, a software developer, why the sun rises in the east, and sets in the west. Her response? It works, don’t touch! Programmers are tools for converting caffeine into code Yes, I’m sure I used the right password, I saw Bob next to me enter it on his computer. And then of course, “In order to understand recursion you must first understand recursion.” Now, what are your favorites?!?! And feel free to pop in an image of your favorite shirt as well, like “I failed the Turing Test” or “Go Away Or I Will Replace You With A Very, Very Small Shell Script!”

25 Time Saving Bash Tips

Use the following keys to do fun things when typing a command in bash (mostly keybindings):
  1. Use the up arrow to run the previous command
  2. Continue using the arrow to scroll to commands further in the history
  3. Use Control-r to search through your command history
  4. Control-w deletes the last word
  5. Control-u deletes the line you were typing
  6. Control-a moves the cursor to the beginning of the line
  7. Control-e moves the cursor to the end of the line
  8. Control-l clears the screen
  9. Control-b moves the cursor backward by a character
  10. Control-u moves the cursor forward by a character
  11. Control-_ is an undo
  12. “man readline” shows the bash keybindings (ymmv per OS)
  13. Tab completes an argument
  14. !! repeats the last command. Useful when using sudo in front of the last line from bash
  15. !$ repeats the last argument for a command
  16. $_ shows the last word from the previous command
  17. “cd -” is like a back button
  18. !!:p outputs the last command with arguments
  19. cd !!:* cd into the argument from the previous command
  20. Escape-. expands the argument from the last command
  21. pbcopy and pbpaste accesses the clipboard from Terminal
  22. Use ; to separate commands in a single line
  23. Use | to pipe output to another command
  24. Use > to send output to a new file, or >> to append output to the end of a file or < to bring input from a file
  25. “Open .” opens the current working directory in a Finder window

Mac DevOps Conference

There’s another new conference in town! Well, not my town, but Vancouver. MacDev Ops is a hot topic. One that will only increase in the coming years. Thanks to Mat X and Brian Warsing for bringing about a brilliant conference. Screen Shot 2015-03-23 at 10.43.50 PM The conference will be held on June 19, 2015 and is an easy $99 if you sign up soon. Also, submit a talk if DevOps is your thing. They’re looking to bring the following topics to the table:
  • Puppet, Chef and other automation from Desktop to Cloud and back
  • Software deployment with Munki and AutoPkg: the app ecosystem surrounding it
  • Cool tools: demo of awesome Mac Admin projects from GitHub
  • DevOps: How to adopt Automation and Best practices in IT operations
  • Dev skills: workshops on Ruby, Git, Python, Javascript for Mac Admins
  • MDM: Profiles and Mac configuration management in the cloud
This is sure to be a good one. Check it out here!

Opposite Day: Reversing Lines In Files

The other day, my daughter said “it’s opposite day” when it was time to do a little homework, trying to get out of it! Which reminded me of a funny little command line tool called rev. Rev reads a file and reverses all the lines. So let’s touch a file called rev ~/Desktop/revtest and then populate it with the following lines: 123 321 123 Now run rev followed by the file name: rev ~/Desktop/revtest Now cat it: cat !$ Now rev it again: rev !$ You go go forward and back at will for fun, much more fun than homework… Enjoy!

Get The Current Logged In User From The Windows Command Line

You can get the currently logged in user from a powershell script by using $env:username. But most deployment scripts use elevated privileges. Therefore, you need to be a tad bit craftier. Continue reading Get The Current Logged In User From The Windows Command Line