This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NOTE: Copied as-is from "Linux Expert" forum in linkedin - https://www.linkedin.com/feed/update/urn:li:activity:7031604358630805504?utm_source=share&utm_medium=member_desktop | |
Not entirely tested from my end. | |
``` | |
#!/bin/bash | |
# Update the package repository | |
apt-get update -y | |
# Install and configure the firewall (ufw) | |
apt-get install -y ufw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONTENT_TYPE="application/json" | |
DESCRIPTION="bad things™ are happening" | |
URL="https://events.pagerduty.com/generic/2010-04-15/create_event.json" | |
if [ $# -ne 3 ]; then | |
echo "Usage: pd-event.sh [TYPE] [SERVICE KEY] [INCIDENT KEY]" | |
echo " - TYPE: [t]rigger | [a]cknowledge | [r]esolve" | |
echo " - SERVICE KEY: unique identifier for service" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.terraform/ | |
*.pem | |
*.tf | |
*.tfstate | |
*.yaml | |
*.backup | |
istio-*/ | |
cert-manager-*/ | |
*.swp | |
env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script semi-automating the process of adding LetsEncrypt certificates to | |
# serve Acquia staging sites in HTTPS. | |
# See http://blog.dcycle.com/blog/2018-10-05/https-acquia-stage/ | |
# | |
set -e | |
BASE="$PWD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check which version of sed is used when you run the `sed` command | |
# The version that ships with Mac OS X is | |
# /usr/bin/sed | |
which sed | |
# Install gnu-sed using Homebrew | |
# The `--with-default-names` option configures `sed` to use gnu-sed | |
# Without that option, you'll need to type `gsed` to use gnu-sed | |
brew install --default-names gnu-sed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://wiki.jenkins.io/display/JENKINS/Log+Parser+Plugin | |
https://www.freeformatter.com/java-regex-tester.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IndexOptions NameWidth=* | |
Something like below: | |
</VirtualHost *:80> | |
... | |
... | |
... | |
<Directory "/var/www/sites/RELEASES"> | |
Options +Indexes +FollowSymLinks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /var/backup/files | |
let count=1 | |
for each_file in $(ls -1t); do | |
if [ $count -le 30 ]; then | |
echo "[$each_file] - good" | |
let count=$count+1 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su apache -s /bin/bash -c 'touch testing' |
NewerOlder