Cura 3D Printing and Slicing Software

The Cura 3D printing software is made by Ultimaker, the 3D printer manufacturer.

When you install the application create a profile for your printer. The user’s guide or data sheet of you printer should contain the necessary information to populate the form.

Troubleshooting

The save button is not enabled

Symptom:

The design is loaded into the program, but the Save button is not enabled.

Cause:

When the design is larger than the maximum size your printer is able to print the Save button is grayed out.

Solution:

Load a smaller design or reduce the size of the object.

 

Monoprice Select Mini 3D Printer

The Monoprice Select Mini 3D printer is one of the best values on the market today. For $220 you get a 50-micron (0.05 mm) resolution 3D printer with PLA and ABS capabilities, and heated printing platform. The heated platform can reduce or eliminate the warping of the edges when the object cools down too quickly.

The printer comes with a mini SD card with a sample .gcode file that prints a cat, and two 3D printing applications:

  • Cura and
  • Repetier

The manual recommends starting with Cura because it can import .stl and .obj 3D printer design files and able to generate the .gcode file that the printer needs to print from an SD card. For more information see Cura 3D Printing software

 

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 recommended style)
node["ATTRIBUTE_NAME"] 
node[:ATTRIBUTE_NAME]  (use it only if the single or double quotes (' or ") would cause a problem in the expression. This can happen in the guard of PoweShell resources.)
node.ATTRIBUTE_NAME    (DO NOT USE IT: the bootstrap compiler cannot understand it, chef-client cannot handle it with nil values in if statements)

To check if the attribute value is nil, use the following format:

if ( !node['ATTRIBUTE_NAME'].nil? )
   ...
end

If you use the node.ATTRIBUTE_NAME.nil? to test the value, and the value is nil, Chef throws the above error message.

Monitor timeouts in TeamCity

TeamCity is a Continuous Integration (CI) tool that enables software development teams to build and test their software. Sometimes the server is too busy to serve the users and the web user interface does not respond in time. TeamCity logs all actions in a log file so we can find the date and time of these timeouts:

On Windows

  1. Remote into the TeamCity server,
  2. Open the server log file at D:\TeamCity\logs\teamcity-server.log

Scroll to the bottom of the file and search for “Request processing took too long” going up to find the last timeout event.

Native resolution in Remote Desktop client on MacOSX

When you connect to a Windows computer from your Macintosh workstation the best remote desktop client is the Microsoft Remote Desktop app from the Apple Appstore.

To configure the remote desktop connection for the best experience

  1. Select Native resolution
  2. Scale content for Full screen mode
    To be able to unselect the “Use all monitors checkbox”, uncheck it first, before you uncheck the “Start session in full screen” checkbox, otherwise, the last checkbox will be disabled.

If you use multiple displays, make sure you open the Microsoft Remote Desktop app on the display you want to use to view the remote computer, because the Native resolution setting will use the resolution of the display the app is running on at the moment you start the remote desktop connection.

How to move a window on the Macintosh if the header is not visible

There are times when a window opens on your Mac and the header is out of the screen or hiding behind the Macintosh Toolbar.

To show the toolbar

Option 1.

  1. Click the window to select it,
  2. Press Command 1 to switch the window to full-screen mode,
  3. Press Command 1 again to exit full-screen mode,
  4. The toolbar appears on the screen.

Option 2.

If the trick above does not work, try to find a point on the edge that instead of stretches the window, moves it. Four small regions on the sides can move the window up and down, another two small regions at the bottom can move the window sideways. The locations of the regions are very inconsistent, in one moment they work, a second later the region is at another location.

 

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 new version of Microsoft SQL Server Management Studio (MSSMS) we cannot find the “Close connections” checkbox anymore, so we have to make sure all connections are closed, and we specify a unique database file name to restore the database to.

  1. On the developer machine close all instances of Visual Studio to close the open database connections,
  2. Close all Microsoft SQL Server Management Studio tabs that are connected to the database,
  3. Move the backup file to the C:\Temp folder. Microsoft SQL Server Management Studio cannot see it in your Downloads folder.
  4. Make sure your user account does not automatically connect to the database you want to restore:
    1. In Security, Logins right click your username and select Properties,
    2. Set the Default database to master
  5.  Disconnect from the database server:
    1.  Right-click the database server and select Disconnect,

  6. Connect to the database engine, but do not open the database you want to restore:
    1. Execute,
      USE Master
  7. Import the database from production with the user interface:
    1. Right-click the database and select Tasks, Restore, Files and Filegroups
    2. Select the From device radio button
    3. Click the button to select the backup file
    4. In the Select backup devices window click the Add button to select the file
    5. Navigate to the C:\Temp folder and select the database backup file
    6. Click the OK button
    7. In the Select the backup sets section select the Restore check box in the file row, and click Options on the left side,
    8. On the Options tab select the Overwrite existing database (WITH REPLACE) check box, and click the button to set the new unique database file name,
    9. Click OK to ignore the error message on the Locate Database Files – … message box
    10. Navigate to the current database file, click it, and append the date of the backup to the end of the file name to specify a unique data file name, and click OK,
    11. On the Restore Files and FileGroups window click the OK button to restore the database

Update the database to make it work at the new location

  1. On a development machine set the databases to Simple recovery mode, so the log files do not grow out of bound.
    ALTER DATABASE my_database SET RECOVERY SIMPLE;
  2. Delete and recreate the users in the restored database, because those have different internal IDs if the database was migrated from a different server
    USE my_database;
    GO
    spDropUser 'my_user', 'dbo'
    GO
    DROP SCHEMA my_user
    GO

    For some reason If I type DECLARE below, WordPress crashes. Please add the letter E to the end of the first word below.

    DECLAR @user_name varchar(50)
    SET @user_name = 'my_user'
    USE my_database; EXEC sp_grantdbaccess @user_name; EXEC sp_addrolemember @rolename = 'db_datareader', @membername = @user_name; EXEC sp_addrolemember @rolename = 'db_datawriter', @membername = @user_name; 
    GO

Error waiting for instance (i-…) to become ready: unexpected state ‘terminated’, wanted target ‘running’

When you launch a server instance with Terraform, sometimes the error message does not contain the underlying cause. When the cloud provider cannot complete the request, many times Terraform displays a generic error message:

Error waiting for instance (i-...) to become ready: unexpected state 'terminated', wanted target 'running'

To find the root cause of the error in AWS

  1. Log into the AWS console and navigate to the EC2 section,
  2. Search for the instance by the instance Id,
  3. You can find the error message at the bottom of the Description tab

In our specific case, it was Client.VolumeLimitExceeded: Volume limit exceeded

We had to increase the volume limit to be able to launch more large EC2 instances.

Upgrade a server on an AWS EC2 instance with minimum risk and downtime

When you need to upgrade an application on an AWS EC2 instance with minimum downtime, there are many options.

Upgrade an EC2 instance

  1. Stop the application, so users don’t make more changes,
  2. Create a backup of the database (snapshot of the RDS instance),
  3. Create a backup of the server (backup image of the EC2 instance),
  4. Upgrade the application on the server,
  5. Start the application,
  6. Test the new version of the application.

In case the upgrade fails, or the post-upgrade test fails

  1. Stop the application,
  2. If you use RightScale to launch servers:
    1. stop the RightLink service on the failed server to prevent RightScale auto terminating the restored server
      (When RightScale finds a new identical server instance, it automatically shuts it down to avoid multiple instances with the same identifier.)
    2. Terminate the failed server
  3. Stop the failed server,
  4. Restore the database from the pre-upgrade backup with a new name,
  5. Restore the server instance from the pre-upgrade backup,
  6. Start the restored server,
  7. Change the database address in the application’s config file to point to the restored database,
  8. Start the application,
  9. Test the restored version of the application.

To make the backup image of the AWS EC2 instance

  1. Open the AWS console and navigate to EC2, Running instances
  2. Find the server instance you want to backup
  3. Right-click the row of the instance and select Image, Create Image

  4. Name the image and click the Create Image button
  5. Save the image Id from the popup

Test your RightScale script without creating unnecessary revisions

There are certain functions in RightScale scripts (RightScripts) that you cannot test without launching a new instance. To test your script:

  1. Edit the Head revision of the RightScale script and save it,
  2. Attach the Head revision of the RightScale script to the Head revision of the RightScale Server Template,
    1. Select the Head revision of the server template, on the Scripts tab click the Modify button
    2. Click the rev dropdown next to the script’s name and select head
  3. In your Self Service CAT file reference revision 0 (zero) of the Server Template (Head revision),
    ( “server_template_revision”  => “0”, )
  4. Upload the Self Service CAT file to Self Service, but do not publish it,
  5. Launch a server instance from Self Service using the RightScale Self-Service Designer page, not the Catalog.

If the script has some errors, modify the Head revision of the RightScale script and launch a new server instance using the RightScale Self-Service Designer page.

When the script works perfectly:

  1. Commit the RightScale script, creating a new RightScale script revision,
  2. Attach the committed revision of the RightScale script to the Server Template’s Head revision,
  3. Commit the Server Template, creating a new Server Template revision,
  4. Publish the new revision of the Server Template,
  5. Reference the new revision of the Server Template in your Self Service CAT file.