• Programming

    Google Cloud Function to convert YAML to a plist

    TLDR: The GCF at https://github.com/krypted/tinyconverters/blob/main/GCF_YAML_to_PLIST.py will convert basic YAML to PLISTs. Here’s a Google Cloud Function that converts YAML to a property list. The function takes the YAML data as an event object, uses the yaml and plistlib modules to convert the YAML data to a property list, and returns the property list. To deploy this function, use the “Create Function” button in the Google Cloud Console. When prompted, select the Python 3.7 runtime and paste in the following script: Once the function is deployed, call it with a POST request to the function’s URL and include the YAML data. For example: Given the above input, the response body will…

  • Programming

    Google Cloud Function to convert YAML to JSON

    TLDR: Just posted this little Google Cloud Function to https://github.com/krypted/tinyconverters/blob/main/YAML_to_JSON.py. This Google Cloud Function converts YAML to JSON. The function takes YAML as input, uses the yaml and json modules, and returns the JSON data. The function below should be deployed as a Python 3.7 runtime:  Once the function is deployed, call it by sending a POST request to the function’s URL with the YAML: The response body contains the JSON data as follows:

  • Programming,  Python

    Google Cloud Function To Add JSON To A Cloud SQL Database

    Here’s a Google Cloud Function that takes some arbitrary json (in json_data) and posts it to a new record in a Cloud SQL database. No error handling or deduplication/matching, just a straight post: https://github.com/krypted/tinyconverters/blob/548892cc377e1063770ab4a8cd53dc6573bae950/json_to_cloud_SQL.py Before using, it needs information to connect to the database, so customize the INSTANCE_NAME, DATABASE_NAME, and TABLE_NAME for the INSERT. For more on Cloud SQL, see https://cloud.google.com/sql/docs.

  • Programming,  Uncategorized

    Creating Unit Tests With Google Bard

    Unit tests are one of those things that evolve over time. When we talk about test coverage, anyone that thinks they have full coverage is kidding themselves, but it’s not uncommon for my workflows to just build some stuff and go back and fill in the unit tests before I bring in a second person. And yet… we know we need to do them. Sometimes I’ve gotten help with this specific part of projects from sites like Upwork. There’s been a lot of talk about AI eating the world, so I thought I’d see how much of this kind of thing AI could get us for free. Let’s start with…

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

    Using The serverinfo Command To Get, Well, Server Info In Mountain Lion Server

    OS X Mountain Lion Server comes with the /usr/sbin/serverinfo command. The serverinfo command can be pretty useful when you’re looking to programmatically obtain information about the very basic state of an OS X Server. The first option indicates whether the Server app has been downloaded from the app store, which is the –software option: serverinfo --software When used, this option reports the following if the Server.app can be found: This system has server software installed. Or if the software cannot be found, the following is indicated: This system does NOT have server software installed. The –productname option can be used to determine the name of the software app: serverinfo --productname If…

  • certifications,  iPhone

    iOS Development Test Now Available

    I’ve been involved with Brainbench for some time. There is now a new iOS development test available at http://www.brainbench.com/xml/bb/common/testcenter/taketest.xml?testId=2973. Also, we’re currently working on a Mountain Lion test and could use some reviewers if anyone is interested.  Let me know if you’d like to be involved with that.