• Mac OS X,  Unix

    Quick Script Backups In OS X

    When I’m working on a little bash script, I’ll often make a backup, each time I save and test. Then I can revert back, if I need to. The syntax I’ll use is to cp and then curly-bracket the output into .bak files (that’s a 90s era file extension I use for such nonsense): cp filename.sh{,.bak} So if I’m writing a script called MYSCRIPT.sh: cp MYSCRIPT.sh{,.bak} The resultant backup of the script is MYSCRIPT.sh.bak.

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

    iOS 9.3 Update Now Available

    iOS 9.3 is out, with lots of new, cool features. For a list of them: With this update your iPhone, iPad and iPod touch gain improvements to Notes, News, Health, Apple Music and a new feature called Night Shift that may even help you get a better night’s sleep by shifting the colors in your display to the warmer end of the spectrum at night. New features, improvements, and bug fixes include: Night Shift When enabled, Night Shift uses your iOS device’s clock and geolocation to determine when it’s sunset in your location, then it automatically shifts the colors in your display to the warmer end of the spectrum and may even help you get a better night’s sleep. Notes improvements Protect notes…

  • Mac OS X,  Mac OS X Server,  Programming

    25 Time Saving Bash Tips

    Use the following keys to do fun things when typing a command in bash (mostly keybindings): Use the up arrow to run the previous command Continue using the arrow to scroll to commands further in the history Use Control-r to search through your command history Control-w deletes the last word Control-u deletes the line you were typing Control-a moves the cursor to the beginning of the line Control-e moves the cursor to the end of the line Control-l clears the screen Control-b moves the cursor backward by a character Control-u moves the cursor forward by a character Control-_ is an undo “man readline” shows the bash keybindings (ymmv per OS)…

  • personal

    The Top 25 Animated Cartoons From The 80’s

    I don’t know why, but I decided to put this article up on Medium. Experimenting with different stuffs. Hope you enjoy. People who were kids in the 80’s often reminisce and declare the fact that there are no longer any good cartoons these days. They say this with a look of nostalgia always on their faces as they watch modern cartoons (often with the kids). The 1980’s was a period where animated cartoons were just beginning to gain popularity — the rise of the Saturday morning cartoon. And unlike today’s animated offering, they were filled with deep, rich content that parents were comfortable with. Not to say that the cartoons these days…

  • SQL

    Use the Slow Query Log in MySQL

    Slow queries can cause poor database performance. MySQL has a slow query log, which lets you log queries that take too long (with too long a user-configurable setting). This allows you to quickly find craptastic queries in your logs. To enable the slow query log, use SET GLOBAL and then set the slow_query_log option to ON: SET GLOBAL slow_query_log = 'ON'; By default, the slow query log identifies any query that takes 10 seconds or longer. To change long_query_time using SET GLOBAL. Here, we’ll set it to 7 seconds: SET GLOBAL long_query_time = 7; You can also set the log file to something other than the default location of /var/lib/mysql/hostname-slow.log.…

  • personal

    My Article On 17 Parallels Between House of Cards and Real Politics On Medium

    House Of Cards Debuted on Netflix in 2013, and was immediately a fan-favorite, capturing audiences instantly due to its high-drama situations, scandal, lying, cheating, the sheer power of the characters, the wonderful acting, and everything in between. Chances are, House Of Cards appeals so much to people in the U.S. because it’s a dramatized version of our own politics; politics that especially this election season seem completely foreign to most Americans. It feels somewhat like a peek behind closed doors, even though it’s fiction. …Or is it? Read More On Medium, here.

  • Mac OS X

    Make Empty Files Of A Certain Size In OS X

    Previously, I’ve used a few methods to create files in OS X using touch, dd, etc. But the easiest way to create empty files is using the mkfile command, which instantly creates a file of any size. To use the mkfile command, use the following general syntax: mkfile -n size[b|k|m|g] filename Using the above, to create a 2GB file called “TESTFILE” on the desktop, use the following command: mkfile -n 2g ~/Desktop/TESTFILE The file is created instantly and occupies the desired space on the disk. If you cat the file you should see a whole lot of zeros. I use dd for testing throughput (e.g. to large storage arrays) as…

  • Mac OS X

    Command Line Calendaring

    When I need to look at what day a date is on, I typically open the Calendar app. But sometimes I’m in the middle of a task in the command line and don’t want to do so. Luckily, there’s a cal binary in OS X. To use cal, simply invoke it and ask for a julian calendar using the -j option: cal -j Which outputs a calendar view: March 2016 Su Mo Tu We Th Fr Sa 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 The days…