Skip to content

Instantly share code, notes, and snippets.

View stewartadam's full-sized avatar

Stewart Adam stewartadam

View GitHub Profile
@stewartadam
stewartadam / scs-tutorial-linux-shared-hosting-server.sh
Created March 10, 2016 04:48
CentOS 7 shared hosting server setup script based on the SCS Shared Linux Hosting Server Security tutorial at Concordia University (2016) - discussion about security principles in the context of a shared hosting server.
#!/bin/sh
#
# Usage:
# This script will establish a basic shared hosting server running DNS, Web (HTTP), DB (SQL) and e-mail (SMTP/IMAP) services.
#
# This script doesn't include usage information on adding new user accounts and setting up mail inboxes; for that, please see my
# CentOS 5 server setup tutorial: http://www.firewing1.com/howtos/servers/centos5/getting_started
#
# This configuration is very similar to my previously documented CentOS 5 server setup, but has been ported to take advantage
# of the new features in CentOS 7.
@stewartadam
stewartadam / scs-tutorial-linux-basics.sh
Last active April 2, 2019 19:51
Script used for the SCS Linux Basics tutorial at Concordia University (2016) - discussion about Linux basics & setting up Wordpress on a CentOS 7 machine
#!/bin/sh
###
### Example usage of common commands
###
# pwd
# ls # it's empty
# cd /var/log # there are some files
###
@stewartadam
stewartadam / README-linode-create.md
Last active September 13, 2018 13:25
A quick Python script that uses the Linode API to create, boot and delete Linodes. Supports an interactive mode that sends emails to users with their Linode credentials, great for providing temporary Linodes for a tutorial.

This is a little automation script I wrote to configure, boot and/or destroy Linodes using the Linode API. This script requires the Requires the linode-python module to wrap the API.

I had written this with the intent of providing users with a temporary Linode that would be destroyed after an hour or two, but the functions are pretty generic and could be repurposed. The interactive mode lets users enter their e-mail address, and upon confirmation sends them a message with their Linode's IP & password.

If you'd like to use this script as-is, you'll need to substitute in your Linode API key, SMTP server details and you will also likely have use the avail_foo() commands to grab the current IDs (e.g. for kernel release, distrubution, etc) and change the variables at the start of the script.