Jan 8 2020

Best Homebrew Formulae

Homebew is convenient package manager for the OS X. Once you install Homebrew on your Mac, you can then easily intall and uninstall tools, libraries, and applications through the brew command. The brew command accepts an install and unistall option, as well as list option that prints all currently installed applications.

You can install an application through a brew formula. There is a plathora of homebrew formulae.

The following homebrew formulae are the ones that I’ve found most useful as a software developer.

Best Homebrew Formulae

  • brew install mysql
    • Installs MySQL database
  • brew install awscli
    • Installs AWS CLI
  • brew install sqlite
    • Installs SQLite CLI
  • brew install groovy
    • Installs Groovy scripting language
  • brew install jq
    • Installs jq command to process JSON content
  • brew install jo
    • Installs jo command to generate JSON content
  • brew install bats
    • Installs test framework for Bash scripts
  • brew install wget
    • Installs wget command to fetch HTTP content
  • brew install markdown
    • Installs text-to-HTML converter
  • brew install hugo
    • Installs hugo static site generator


Dec 15 2019

Useful Bash Commands

Every programmer should be well versed with Bash, from finding files to schedule tasks.  The following are some of the most common Bash commands that I use on a weekly basis.

  • grep -i aBc <FILE>
    • Grep ignore case
  • grep –color abc <FILE>
    • Color highlight matching pattern
  • grep -v ABC <FILE>
    • Ignore any lines that include ABC
  • grep abc $(find . -mtime 0 -type f)
    • Grep recently modified files
  • grep “abc xyz” <FILE> | grep “02/03/19 09”
    • Find all lines that contain “abc xyz” and then find the remaining lines that contain the following timestamp
  • ps -ef | grep java
    • Find Java processes
  • history | grep git
    • Find all commands in the history that contain the word git
  • history -cw
    • Clear history
  • wc -l <FILE>
    • Number of lines in file
  • ls -1 | wc -l
    • Count the number of files in the current directory
  • ls -lh
    • Show the size unit of the file, such as K for kilobyte, M for megabyte, etc
  • ln -s <SOURCE_FILE> <LINK_FILE>
    • Create a symbolic file link reference to <SOURCE_FILE>
  • df -P <FILE>
    • Find free disk space and if it’s mounted
  • du -hs
    • Find disk usage for each file in current directory
  • cat /dev/null > <FILE>
    • Clear/wipe file
  • zip -r <FILE>
    • Zip all contents in current directory into the specified zip file
  • zip -er <FILE> <DIRECTORY>
    • Zip and encrypt all contents in given directory into the specified zip file
  • zip -d <FILE> “file.txt”
    • Remove file file.txt from the specified zip file
  • unzip -l <FILE>
    • List contents of given zip file
  • diff -rq <DIRECTORY_ONE> <DIRECTORY_TWO>
    • Recursively diff two directory structures
  • crontab -l
    • List cron rules for current user
  • crontab -e
    • Open crontab for editing
  • at -f <COMMAND> -t 201906160701
    • Schedule a command or batch file to run at the specified time
  • atq
    • List current scheduled tasks
  • atrm
    • Remove a scheudle task
  • uuidgen
    • Create a 128-bit UUID
  • date | md5
    • Use md5 on a date to generate a UUID based on a hash
  • $RANDOM
    • Create a random number between 0 and 32k
  • tcpdump -ni eth0 -vvv -s0 -w capture.pcap
    • Listen to eth0 interface in verbose mode and write out to file
  • tcpdump -ni eth0 port 1812 or port 1813 -vvv -s0 -w capture.pcap
    • Listen to eth0 interface for only ports 1812 and 1813

Nov 23 2019

Apple’s Pricing Genius

Laptops are designed to travel with. We taken home, to the coffee shop, to the library, when we travel, everywhere. It is not uncommon to misplace your power adapter when travel, or equally as bad forget it at home after you left for a trip. And of course, the cable used by the power adapter does wear and tear and would need to be replaced.
I must have been about 3 years when I last needed to replace the power adapter to a MacBook Pro. I remember the sticker shock when I picked up a replacement power adapter and found it cost $69, but I needed it so I paid the Apple tax and bought it.
Recently I had left behind at the office the power adapter for current MacBook Pro, 2016 model. I haven’t been in the office since and I needed charge my laptop. Luckily, so I thought, I have an Apple Store two blocks away from home. This time around, the full cost of a power adapter was $79, but Thunderbolt cable or batteries not included, I needed to shell out an additional $39 for a 0.8M USB-C cable.

Apple Store Receipt for MBP Power Adapter
Apple Store Receipt for MBP Power Adapter

This is truly Apple’s genius. To take a technology, like electricity, that was invented over a hundred years ago. A commodity technology that is found in products priced at $10 and below, like power cords. Change the connectors in such a way that others can’t legally copy your design. Break a product down to their essential components, the actual power adapter from the cable. Charge as much as possible for each component that is sold as a product.


Mar 6 2008

iPhone and iPod Touch SDK

At a press conference earlier today, Apple released the much anticipated native SDK for the iPhone.

iPhone applications will be created using Cocoa. To develop native applications for the iPhone, developer will be using the XCode IDE and the newly released iPhone SDK and iPhone simulator. Third party applications will be made available through an iPhone App Store. The applications developed on the iPhone SDK also work on the iPod Touch.

The App Store is the exclusive distribution channel to deliver applications to the iPhone. From the press conference, it is reported that the developer picks the price of the application and get to keep 70% of the sales. The developer can release applications for free to the end user, Apple will not put charge fee for free applications.

The SDK is available right now, but the App Store might not be released to end users until sometime after June, perhaps in the next upgrade release of the iPhone kernel and software.

The iPhone SDK is free but Apple has a iPhone Developer Program starting at $99. At this point it is not entirely clear what you get from the iPhone Developer Program, but I imagine that you need to be in the program for you to actually sell your applications on the App Store.

At the press conference, John Doerr of the Kleiner Perkins Caufield & Byers venture capital firm said, “best way to predict the future is to invent it. At Kleiner, we say the second best way is to fund it.” Doerr announced a $100 million iFund to fund companies and ventures developing application for the iPhone and iPod touch.

Apple had a few demos at hand at the press conference, which all seemed to make use of the iPhone’s great touch ui, touch gestures, and accelerometer.

Back in July of last year, I was at the iPhone Dev Camp where I had a small part in developing Tilt, perhaps the first iPhone motioned controlled game for the iPhone. Having full access to the accelerometer and location data will open the possibilities for a wide array of new applications.

Prior to the SDK being freely available, the only option for custom applications for the iPhone was web development.

Technorati Tags: , , , , , , , ,


Dec 11 2007

TechKnow Year In Review 2007

It is that time of year where we reflect on the accomplishments of the passing year and look forward to the one to come. Here is a window into the past year in technology through this year’s popular posts on TechKnow Juixe.

Top 5 Top Lists

Software Development

Java

JavaScript

Ruby

Ruby Shoes

Ruby on Rails Plugins

Windows Tips

Mac OS X Tips

Year In Review

Seasons Greetings

Technorati Tags: , , , , , , , , , , , ,


Nov 4 2007

Mac OS X Boot Camp

Boot Camp allows you to run Microsoft Windows on your Mac, natively just as you would on any laptop from Dell or HP. In essence, boot camp allows you to start and run either OS X or Windows on your Apple hardware.

Boot Camp is easy to set up and configure and perhaps that is why I was unable to find any tutorials or instructions on how to set it up, so that is why I am writing this post.

Before you begin, I would recommend you back your data.

If you are using Mac OS X Leopard, just launch Boot Camp Assistant located under the Applications | Utilities folder. Select ‘Create or remove a Windows partition’ to create a separate disk partition to install Windows on. Select the size for the Windows partition.

Once you have created the partition, you can insert an ‘authentic’ Windows installation CD and restart your system. You should use Windows XP with SP2 or Windows Vista. When your computer restarts, it will ask to load from the CD which takes you through the Windows installation process. Before the installation can begin, you will be prompted to select the partition to install Windows to, select the partition with BOOT CAMP in the name. Be careful not to delete or install over you Mac OS X partition.

Once you have installed Windows, insert your OS X Leopard installation CD to install the required drivers for your Apple hardware. At this point, you should have both Windows and Mac OS X installed on your Mac. To switch from one operating system to another, restart you computer and hold down the Option key. Holding down the Option key will allow you to choose which system to start. If you don’t hold down the Option key you will boot using the default system.

It is also a good idea to update your Windows installation with the latest security patches. After I installed Windows I had to restart Windows twice; once to get 86 patches including IE 7, and the second time to get additional patches for IE 7. I’ve discovered that Windows security is an oxymoron!

To change the default operating system which your computer boots from, you can use the Startup Disk application found under the System Preference in Mac OS X. In Windows launch the Boot Camp application in the Control Panel and select the default system on the Startup Disk tab.

It is great that I can boot either OS X or Windows on my Mac, but I would prefer if Apple would provide the same level of Boot Camp support for Ubuntu!

Technorati Tags: , , , , ,