Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| var https = require('https'); | |
| var util = require('util'); | |
| var SLACK_CHANNEL = process.env.SLACK_CHANNEL; | |
| var SLACK_PATH = process.env.SLACK_PATH; | |
| exports.handler = function(event, context) { | |
| console.log(JSON.stringify(event, null, 2)); | |
| console.log('From SNS:', event.Records[0].Sns.Message); |
| <?xml version="1.0"?> | |
| <ruleset name="MyStandard"> | |
| <description>PSR2 with tabs instead of spaces.</description> | |
| <arg name="tab-width" value="4"/> | |
| <rule ref="PSR2"> | |
| <exclude name="Generic.WhiteSpace.DisallowTabIndent"/> | |
| </rule> | |
| <rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/> | |
| <rule ref="Generic.WhiteSpace.ScopeIndent"> | |
| <properties> |
| #! /bin/bash | |
| #A comment stating what this program is about | |
| #Taking input, showing output | |
| echo “Please enter in a variable” | |
| read VARIABLE | |
| echo “The variable you entered is: $VARIABLE” | |
| #Taking in arguments | |
| #Usage: ./script.sh var1 var2 var3 |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| ; Sample supervisor config file. | |
| ; | |
| ; For more information on the config file, please see: | |
| ; http://supervisord.org/configuration.html | |
| ; | |
| ; Note: shell expansion ("~" or "$HOME") is not supported. Environment | |
| ; variables can be expanded using this syntax: "%(ENV_HOME)s". | |
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; (the path to the socket file) |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| <?php | |
| /* From https://www.usps.com/send/official-abbreviations.htm */ | |
| $us_state_abbrevs_names = array( | |
| 'AL'=>'ALABAMA', | |
| 'AK'=>'ALASKA', | |
| 'AS'=>'AMERICAN SAMOA', | |
| 'AZ'=>'ARIZONA', | |
| 'AR'=>'ARKANSAS', |
| #!/bin/bash | |
| echo "Generating an SSL private key to sign your certificate..." | |
| openssl genrsa -des3 -out myssl.key 1024 | |
| echo "Generating a Certificate Signing Request..." | |
| openssl req -new -key myssl.key -out myssl.csr | |
| echo "Removing passphrase from key (for nginx)..." | |
| cp myssl.key myssl.key.org | |
| openssl rsa -in myssl.key.org -out myssl.key |
This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc