error: package … does not exist in NetBeans
If your Java source code imports packages, you have to add the JAR files containing them to the Library. When you try to compile your Java application in NetBeans, and you get the error message: error: package … does not exist In the NetBeans…
Undefined method or attribute error in a Chef recipe
There are multiple reasons Chef can display the following error message NoMethodError ------------- Undefined method or attribute `...' on `node' There are many ways to reference an attribute in a Chef recipe: node['ATTRIBUTE_NAME'] (the…
How to restore a Microsoft SQL database from backup with the Microsoft SQL Server Management Studio (MSSMS) user interface
There are multiple reasons to restore a database from backup. One of them can be disaster recovery, the other is to bring the production database to the developer machine. In both cases, the computer already has the old version of the database. In the…
Custom Git Status and Git Pull commands to work with all of your repositories
If you work with many Git repositories it is easy to miss a repository when you commit your changes, and very time consuming to pull from all repositories. It is easy to automate both processes. In this example, we will place all files in…
The .NET MVC model has to have a parameterless constructor
When you create a class to be used as the model in a .NET MVC application, the class has to have a parameterless constructor. It is called during the POST when the user clicks the submit button of the form. If the class does not have a parameterless…
Add SSH key to a Jenkins Git step
To access a Git repository Jenkins can use an SSH key. To add the SSH key to the Jenkins server use the following Chef script Store the SSH key in an encrypted data bag called “keys”. { "id": "ci_private_keys", "ci_github_key": "-----BEGIN…
Generate a GUID in Chef with Ruby
When you need a unique string to name a resource in your Chef scrip, generate a GUID with SecureRandom.uuid To make sure the resource always gets a unique name: log "#{SecureRandom.uuid}" do message 'My message' level :info end
Migrate databases to and from AWS RDS instances
Amazon Web Services do not provide tools to migrate data to, from and between AWS RDS instances. There is a free utility that can do the job. SQL Server Management Studio (SSMS) Install Microsoft SQL Server Management Studio (SSMS), because the utility…
Failed to open file ‘…’ , error 2 and error 22
How to restore a MySQL database in Windows To restore a MySQL database on a Windows machine: Place the database backup file in the root directory of your C: drive (trust me, this will make your life easier) Open the Command Prompt Start the MySQL command…
How to edit the GitHub README.md file
The GitHub repositories usually contain a README.md file to describe how to use the project. The GitHub web site has a simple editor, but it has a few limitations If you accidentally refresh the page, you lose your changes, The preview pane is wider than…