It has to be said that the most popular transfer format (when it comes to file systems) is either FAT32 or NTFS. In today’s article I’ll walk you through creating one of these lowest-common-denominator devices.
First of all, we need to find the device that you want to format. After you’ve attached your pendrive/device, use the lsblk command to determine what your device’s name is.
In my case here, it’s called sda.
First of all, we’ll partition the drive using fdisk.
Partitioning
We’ll create a single partition for the device.
We can take a look at how the partition table now looks with p.
We still need to change the type from Linux to W95 FAT32, which has a code of b.
We now finish partitioning and move onto formatting. We write the partition table with w.
Formatting
Finally, we use mkfs to create a vfat filesystem on our device’s partition.
Remove the USB and then plug it back in. After it mounts automatically, we can verify with df.
Some applications that you’ll come across will require Java 8 in order to run. By default (as of the time of this article), the Amazon Linux AMI has Java 7 installed.
In order to upgrade these machines so that they are using Java 8, use the following:
When working in development and sandboxes, it can make sense to trust the self-signed certificates that you might be using. This can lower the amount of workflow noise that you might endure.
In today’s article, I’ll take you through generating a certificate; using the certificate (its use-case is terribly simple), and finally trusting the certificate.
Generation
In a previous post titled “Working with OpenSSL”, I took you through a few different utilities available to you within the OpenSSL suite. One of the sections was on generating your own self-signed certificate.
You should receive output which looks like the following:
On the filesystem now you should have a server.key and server.cer files waiting for you.
Using the certificate
Now we’re going to stand up a web server that uses this key/certificate pair. Using the nginx docker image, we can quickly get this moving with the following nginx.conf.
Starting the server requires the cerificate, key and configuration file to be mounted in. I’ve also exposed 443 here.
Right now, when we use the curl command without the --insecure switch, we receive the following:
Trusting the certificate
We can now use cerutil to work with the NSS database to add this certificate.
If you’re on a brand new system, you may need to create your NSS database. This can be done with the following instructions. Please note, that I’m not using a password to secure the database here.
With a database created, you can now add the actual certificate itself. You can acquire the certificate with the following script (that uses OpenSSL):
This script is doing a little bit; but most important to see that openssl acquires the certificate for us; then we issue a call to certutil to add the certificate into our store.
Chrome will look for the nss database in $HOME/.pki/nssdb. This is why this folder has been chosen. The -t switch allows you to specify trustargs. Lifted from the manpage:
The trust settings are applied as a combination of these characters, in a series of three.
There are three available trust categories for each certificate, expressed in the order SSL, email, object signing for each trust setting.
With the certificate added into the store, we can re-start chrome and hit our website. Chrome no longer complains about the certificate not being trusted.
If your development setup is anything like mine, you’ll like to put all of your applications into their own containers so that they’re isolated from each other. This also gives me a little added guarantee that all of an application’s dependencies are wrapped up nicely before moving the code between environments.
Sometimes, debugging can be a little awkward if this is how you run. In today’s post, I’ll take you through debugging your node apps inside of a container.
Execution
The execution environment is quite simple. We’ll assume that a bash script allows us to start a container which holds our application, and injects any instruction to its console:
We’ll assume the following:
Our application serves over port 3000
Debugging will run on port 9229
Our application gets mounted to /usr/src/app inside the container
Allowing inspection
Now we need to tell our node process that we want to inspect the process, and allow debugging. This is as simple as using the --inspect switch with your node or in my case nodemon invocations. Here is my debug run script inside of my package.json:
This starts execution, mounting the debug port on 9229 (to align with our docker invocation); it’s also allowing connections from any remote computer to perform debugging. Handy.
Start debugging
Once you’ve issued ./run npm run debug at the console, you’re ready to start debugging.
I use WebStorm for some projects, vim for others; and sometimes will use Chrome Dev Tools with chrome://inspect to be able to see debugging information on screen.
Hope this helps you keep everything isolated; but integrated enough to debug!
When you’re developing an AWS Lambda, sometimes you’re going to need to install binary package dependencies. Today’s article will take you through the construction of a project that can be deployed into AWS Lambda including your binary dependencies.
Structure
The whole idea here is based on AWS Lambda using Docker to facilite package, deployment, and execution of your function. The standard python:3.6 image available in the standard library is compatible with what we’ll end up deploying.
The structure of your project should have a requirements.txt file holding your dependencies, a standard Dockerfile and of course, your code.
Any depeendencies are listed out by the requirements.txt file.
Docker
We can now bundle our application up, so that it can be used by AWS Lambda.
The docker container is then built with the following:
The retrieves the zip file that we built through the process, that’s readily deployable to AWS Lambda.