Category Archives: Supporting Scripts

Script To Install AWS CodeDeploy Agent on Linux

Get Social!

Here is the script for installing the AWS CodeDeploy agent on Ubuntu. See the full description here.

For more information on AWS CodeDeploy, please see: https://aws.amazon.com/codedeploy/

apt update
apt -y install ruby

cd /tmp
wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install;
chmod +x ./install

./install auto

service codedeploy-agent start

gitignore file for Go Projects

Get Social!

This is a gitignore file for a Go project to ensure temporary files and build files are not added to git repository commits.

# Binaries, plugins, libs
*.dll
*.dylib
*.exe
*.exe~
*.so

# Testing
*.test
*.tmp

CockroachDB systemd script

Get Social!

This is a simple systemd script for CockroachDB. It works for single node installations or multiple nodes, however you’ll need to manually join each node to the cluster before using the systemd script. 

Create the systemd file and add the following content:

vi /etc/systemd/system/cockroach.service
[Unit]
Description=CockroachDB

[Install]
WantedBy=multi-user.target

[Service]
ExecStartPre=/bin/bash -c "test -f /etc/cockroachdb/hosts && (/bin/systemctl set-environment JOIN_SWITCH=--join=$(test -f /etc/cockroachdb/hosts && cat /dev/null /etc/cockroachdb/hosts)) || exit 0"
ExecStartPre=/bin/bash -c "test -f /etc/cockroachdb/host && (/bin/systemctl set-environment HOST_SWITCH=--host=$(test -f /etc/cockroachdb/host && cat /dev/null /etc/cockroachdb/host)) || exit 0"

ExecStart=/usr/local/bin/cockroach start --certs-dir=/etc/cockroachdb/certs \
                                         --store=/var/data/cockroachdb/ \
                                         --cache=.40 \
                                         --max-sql-memory=.30 \
                                         --external-io-dir=/tmp/cockroachdb/externalio \
                                         --temp-dir=/tmp/ \
                                         --port=26257 \
                                         --http-port=7005 \
                                         --logtostderr=ERROR \
                                         --log-dir=/var/logs/cockroachdb \
                                         $JOIN_SWITCH $HOST_SWITCH

ExecStop=/usr/local/bin/cockroach quit --certs-dir=/etc/cockroachdb/certs
SyslogIdentifier=cockroachdb
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
LimitNOFILE=35000

Note that there are several paths specified in the above file which may need to be tailored to your installation requirements.

Run the following to enable the service on system start, and to start the CockroachDB service.

systemctl enable cockroach # enable on startup
systemctl start cockroach  # start CockroachDB

If your host belongs to a cluster, create a hosts file containing the hosts of other nodes in your cluster that will be read when starting your local node. For multiple nodes, use a comma to separate each hostname and port combination.

vi /etc/cockroachdb/hosts
server1.jamescoyle.net:26257,server2.jamescoyle.net:26257

gitignore file for Eclipse Projects

Get Social!

This is an example of a .gitignore file for an Eclipse project to ensure temporary files, build files and project settings are not added to repository commits.

See .gitignore for more info.

# Java related
target/**
*.jar
*.war
*.ear
*.class

# eclipse specific
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

gitignore file for Nodejs Projects

Tags :

Category : Supporting Scripts

Get Social!

An example gitignore file for Nodejs projects to ensure that local environment variables, build related output and modules are not committed to the git repository.

See .gitignore for more info.

# NodeJS specific #
.nyc_output/
coverage/
node_modules/
npm-debug.log
package-lock.json
test/*.log

gitignore file for Netbeans Projects

Tags :

Category : Supporting Scripts

Get Social!

A gitignore file for most Netbeans projects to keep the build and local configuration files out of your git repository.

See .gitignore for more info.

# NetBeans specific #
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml

# Class Files #
*.class

# Package Files #
*.jar
*.war
*.ear

Visit our advertisers

Quick Poll

Do you use ZFS on Linux?

Visit our advertisers