IamCalvinBrown.com a Blog Site

Code Examples, Consulting Advice and lots of other cool things

What device am I on - Xamarin Forms


When a customer uses their tablet versus their phone, your app may appear less than stellar. Here's the code necessary to determine which device your app is running on and make changes to item sizes (ex: fonts, spacing, etc) to make your app appear made for all devices.

if ( Device.Idiom == TargetIdiom.Tablet)

{

        // perform all operations tablet related

}

What to Look for When Hiring for DevOps Jobs


Calvin Brown is the DevOps Architect & Lead Developer for Kairu Consulting, LLC.

“The most important things to look for in both developers and operations persons (DevOps) is…”

How much they know about the other areas of the project. To explain, a project consists of these 3 elements: what the user sees, the code that runs, and the platform(s) that it runs on. That’s also usually broken into 3 careers: graphics, developers, and operations.

A good developer would know how to release their product to the world and how to check for security vulnerabilities, deploy machines, and use some of the same tools as the operations team. True, this is two career paths, but consultants like myself who must deliver a product online for our customers to see (and pay for) must know the basics of operations. The same is true for operations folks. Knowing how to build the code for release, write basic scripts, and deploy code is critical in today’s environment. The Cloud (especially Amazon AWS) makes this more of a reality. If a developer says they use AWS and understand EC2, they’re DevOps types of guys (and ladies). If operations candidates know CI/CD (continuous integration/continuous deployment), then they’re likely DevOps ready as well.

(original article available on Stackify at http://bit.ly/2xMas4k )

Smart answers for your next DevOps interview: How to prepare


General queries

What is DevOps?

Your response should reflect your knowledge of the main theme common to any DevOps effort: It’s about operationalizing and deploying software and services with greater speed, agility, and flexibility.

Point out that the “smooth deployment of software is what DevOps attempts to codify,” says Calvin Brown, enterprise architect and founder of custom software development and consulting firm Kairu Consulting. Comment on how the core of DevOps lies with components such as an agile relationship between software development and IT operations, the management of security and software development processes for improved release efficiency, and the automation of tasks, he says.

Read the full article on TechBeacon.com at http://bit.ly/2uFP6mg

(repost from the original article on TechBeacon.com)

How to query using linq to objects in .net

Want to query a collection without writing a loop in .NET? Here's a linq expression, and the sample code to help.

// our custom object of data

int[] listOfNumbers = { 12345678910 };

 // use LINQ to get all even numbers

    var result = from number in listOfNumbers
        where (number % 2) == 0
         select number;


To download the sample project, please visit http://bit.ly/2vGZriL

How to Remote Desktop To Hardware

Connecting back to older laptops, old server, etc can be a serious task. If you're like me, you've spent countless dollars on tools like LogMeIn.com or tried other free tools. The free tools, ultimately my experience, stopped working when my IP changed or there was a hiccup on the network. Well, as always, Google saves the day.

Say hello to Google Chrome Remote Desktop. A long title but definitely worth the short installation. Without going through all the details of how to install, go to Extensions in your Chrome Browser and add it. Here's a short video on how to set it up once you've installed the extension.

YouTube

https://www.youtube.com/watch?v=BCiTB15K5E4


How to implement GetDate() in SQLite

When inserting records, we often want to timestamp them. SQLite has the ability, however it's slightly different.

Use the keyword: datetime()

It can be used as a default value for a table, or in the Query Editor window. I'm using DB Browser for SQLite.



CSSMERR_TP_NOT_TRUSTED codesign error

This error happens in Xamarin when you have a newly setup environment, or you've recently downloaded your Apple Developer Certificate. Here are the steps you take to correct it.

1. First, thank your luck stars that you found this post

2. Go to KeyChain Access on your Mac

3. (select the Lock icon to unlock these items so that you can make changes)

4. Ensure the login section is selected on the left

5. Click each item individually and change the "When using this certificate" to Use System Defaults. Specifically make sure you change these: iPhone Developer, Mac Developer and Apple Worldwide Developer Relations Certification Authority

6. Close and Restart Xamarin and you should be apple to deploy.


Happy coding.

Enable SharePoint Developer Dashboards

SharePoint Developer Dashboards are easy to use and follow. Think of these dashboards as Fiddler Lite. For more information you can go here for SharePoint 2010 and here for SharePoint 2013.

The overall steps to start the Developer Dashboard are

1) If you have not already, configure and enable your Usage and Health Data Collection Service. For more info click here

2) Once you have your app up and running, execute the following PowerShell Script
$svc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dds = $svc.DeveloperDashboardSettings
$dds.DisplayLevel = "On"
$dds.Update()

3) If everything worked you will see

4) From there you can find out page information, SQL query calls, etc.


An extremely useful tool especially if you are troubleshooting performance.



Navigating to External Drives In Terminal (MAC)

Accessing external drives (volumes) on a MAC isn't the same as on a PC. This can be accomplished with a few easy commands.

1. Open a Terminal Windows (and type the commands below)

2. cd /

3. cd Volumes

4. ls

There you have it. All the drives attached on on your MAC. You can navigate to any by name.

Hint: Use single quotes around folders with spaces in the name


How to clone a project from GitHub


Once you know the location of the project in GitHub, it's easy to create a version to begin work on locally. Simply follow these steps.

1. Open Terminal (Mac Users)

2. Navigate to the root folder (ex: lets go to our desktop): cd ~/Desktop

3. Create a folder for our project (ex: let's name it GitProject): mkdir GitProject

4. Go to the folder we just created: cd GitProject

5. Download the Git Project into our folder: git clone --bare (url of the project -- no parenthesis)


That's it. You now have a local working version of the GIT project. Happy coding.