My latest Huffington Post article, Twenty Cool Things You Can Do with Box is online here. It begins: If you are looking for a secure and uncomplicated and file sharing service, you will find box.com to be a wonderful way to share files from any device. Today, it is easier than ever for businesses to operate globally regardless of how large or small they are. This is because of the digital age that makes works products easy to share or transfer. Here are twenty cool things that you can do with box.com. For more, click here.
-
-
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.
-
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)…
-
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…
-
pyMacWarranty variant in Swift on my GitHub
Posted a new swift command line tool to accept serial number data from an Apple device and respond with warranty information about a device at https://github.com/krypted/swiftwarrantylookup. This is based on pyMacWarranty, at https://github.com/pudquick/pyMacWarranty.
-
Use SQL Views to Grant Access and Constrain Output
You can grant access to certain columns to view in SQL without providing access to specific users to see the whole database. This is pretty useful when delegating reporting to users, without giving them access to all of the data in your database. For example, a user might be able to see a column with an address, but not a column with a credit card number, increasing database security while allowing you to delegate certain tasks when appropriate. In this article, we’ll use the same “Customers” table from our first articles, signupdate: ID Site Contact Address City Zip Country SignupDate 1 Krypted Charles Edge my house Minneapolis 55418 US 2005-01-01 2…
-
Manage Recent Places In OS X
There are two defaults keys that can be used to manage the recent places options in the OS X Finder. Both are in the .GlobalPreferences. The first is NSNavRecentPlaces and the second is NSNavRecentPlacesLimit. The NSNavRecentPlacesLimit key limits the number of items that are stored in the list. To increase the default to, let’s say, 20, use the defaults command to set the NSNavRecentPlacesLimit key to an integer of 20: defaults write .GlobalPreferences NSNavRecentPlacesLimit -int 20 Then use defaults to read the setting: defaults read NSNavRecentPlacesLimit You’ll need to “killall Finder” in order to see this in a Finder Save dialog. You can also inject items into the RecentPlaces array, called NSNavRecentPlaces, or delete…
-
Index Those SQL Tables
If you have growing sets of data, one of the best ways to speed up database performance is to make sure each column in larger tables is indexed. You can easily index a column following this syntax (using the name of your table in the place of tablename and the name of your column in the place of columnname): ALTER TABLE tablename ADD INDEX (columnname); So if you have a table called Customers and the following columns (as in the case of my Customers database from the previous exercises): ID Site Contact Address City Zip Country You would index them all as follows: ALTER TABLE Customers ADD INDEX (ID); ALTER…
-
Run Bash From A Swift Project
New project on my Github, called Swift-Bash-Runner, which runs a simple bash line from a Swift screen. Pretty simple, but could be tweaked to run your line of bash with an operator with little effort.
-
Manage SQL Schemas with Flyway
Flyway is a tool that allows you to perform version-controlled management of SQL schemas. You can download flyway at http://flywaydb.org. It doesn’t require a build, so once downloaded, drop it where you want it to live and you can just summon the binary in scripts. Once installed, the following is the basic structure of commands for Flyway: flyway [options] command By default, the configuration will be read from conf/flyway.conf. Options passed from the command-line override the configuration. Commands ======== migrate : Migrates the database clean : Drops all objects in the configured schemas info : Prints the information about applied, current and pending migrations validate : Validates the applied migrations…