Month: November 2015

Repeating script execution on Linux

When running a PHP script on a Linux server I needed a way to have it start again after ‘crashing’. For example because of an error. It turns out that this is relatively easy using a while loop in bash.

In the file below the command string can be replaced by one or more commands you want to execute.

Simply create the file and execute a chmod +x to make it executable.

The script will run the command and when it terminates, simply loops and run it again. The date command is there so you can see when the script loops during its execution.

#!/bin/sh

while [ 1 ]
do
    date
    command
done

Leave a Comment

Setting path parameter when uploading cloudfront ssl certificate

When you want to use your own SSL certificate on Cloudfront, you must upload your certificate to IAM. In order for the certificate to be usable at cloudfront, its path must be prefixed with /cloudfront/, else it will not show up in the list.

The information below is distilled from a forum post at the AWS forum. The explanation is for when you are use the aws cli to upload the certificate (which is the only possible way at the moment of writing this post).

aws iam upload-server-certificate --server-certificate-name my_cert --certificate-body file://my_cert.crt --private-key file://my_key.pem --certificate-chain file://intermediate_and_root.crt --path /cloudfront/

It is possible to differentiate further in the path, it can be --path /cloudfront/whateveryouwanthere/, for exaample.

Leave a Comment

Post mentioned on stackoverflow

This weekend I found a referrer in this blog’s analytics from stackoverflow. In this question a solution was given referencing one of the posts on this blog. It gave me great joy to see that a post on this blog helped someone.

In general, if anyone has any questions related to a post, you can always contact me on Twitter via @daangemist.

The referenced post was Jenkins reports sslv3 error on svn update. The link in the stackoverflow comment seems to be incorrect, I added the correct one via a comment.

Jenkins not able to use SVN credentials or download new plugins/new versions

Leave a Comment