Skip to content

Instantly share code, notes, and snippets.

View vallamost's full-sized avatar
:atom:
Helping

Ian vallamost

:atom:
Helping
View GitHub Profile
@vallamost
vallamost / block_all_public_acls
Created August 28, 2017 00:38
Block public ACLs on objects or buckets
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": [
"s3:PutBucketAcl",
"s3:PutObjectAcl",
"s3:PutObjectVersionAcl"
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
@vallamost
vallamost / gist:13e327b35612bb113fb7e1296b542935
Last active February 25, 2018 04:26
Set up a LAMP stack on a new install of AMZN Linux v1
#What this does:
#updates centos distribution
#install apache, php7, mysql5.6, phpmysql, add apache and mysql to bootup, start apache and mysql, run secure mysql install. add ec2-user to apache users group. change the ownership of /var/www to ec2-user:apache. create vhost file
sudo yum update -y && sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd && sudo service httpd start && sudo chkconfig httpd on && sudo usermod -a -G apache ec2-user && sudo chown -R ec2-user:apache /var/www && sudo chmod 2775 /var/www && find /var/www -type f -exec sudo chmod 0664 {} \; && sudo service mysqld start && sudo chkconfig mysqld on && sudo mysql_secure_installation && sudo mkdir /etc/httpd/sites-available && sudo mkdir /etc/httpd/sites-enabled && echo "<VirtualHost *:80>
ServerName clickbuysmile.com
ServerAlias clickbuysmile.com
DocumentRoot "${INSTALL_DIR}/www/clickbuysmile.com"
ErrorLog ${APACHE_LOG_DIR}/clickbuysmile.com/error.log
CustomLog ${APACHE_LOG_DIR}/clickbuysmile.com/access.log combine
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /var/run/nginx.pid
#!/bin/bash
#
# Automate mysql secure installation for debian-baed systems
#
# - You can set a password for root accounts.
# - You can remove root accounts that are accessible from outside the local host.
# - You can remove anonymous-user accounts.
# - You can remove the test database (which by default can be accessed by all users, even anonymous users),
# and privileges that permit anyone to access databases with names that start with test_.
@vallamost
vallamost / gist:088cd5a8e96c7a4c02254c66931486c6
Created February 27, 2018 06:36
update the IP of an A record using the EC2 metadata information.
public_ipv4_address_of_server=$(curl http://169.254.169.254/latest/meta-data/public-ipv4 -s) && { cat > ./update_clickbuysmileArecord.json <<EOF
{
"Comment": "update click buy smile domain with new A record IP",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "your_domain_name.com",
"Type": "A",
"TTL": 60,
@vallamost
vallamost / gist:cb0a94b9cbc71441bd92f885fd9d2c9d
Created March 26, 2018 01:56
install nodejs LTS on amazon linux 2 from binaries
cd ~
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
. ~/.nvm/nvm.sh
nvm install --lts
node -e "console.log('Running Node.js ' + process.version + ', have fun.')"
Cloud-init v. 0.7.7 running 'init-local' at Mon, 09 Apr 2018 00:38:07 +0000. Up 23.48 seconds.
Cloud-init v. 0.7.7 running 'init' at Mon, 09 Apr 2018 00:38:08 +0000. Up 23.93 seconds.
ci-info: +++++++++++++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++++++++++++
ci-info: +--------+------+----------------------------+---------------+-------+-------------------+
ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
ci-info: +--------+------+----------------------------+---------------+-------+-------------------+
ci-info: | eth0 | True | 10.0.1.165 | 255.255.255.0 | . | 02:da:ec:61:e4:8e |
ci-info: | eth0 | True | fe80::da:ecff:fe61:e48e/64 | . | link | 02:da:ec:61:e4:8e |
ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | . | . |
ci-info: | lo | True | ::1/128 | . | host | . |
.notificationsFrame {
position: relative;
}
.notificationsFrame {
z-index: 2;
width: 100%;
top: 20px;
background: #fff;
border-radius: 3px;
overflow: hidden;
@vallamost
vallamost / gist:f10f043e7a300d6ef1b44e88765a4131
Created May 3, 2020 23:31
2020 - OpenVPN + FreeIPA Configs
#configure freeIPA and generate certs +
https://gist.github.com/rechner/c6b9133b7816445b5850f8e22e16aa60
# generate certs from freeIPA
sudo ipa-getcert request -K openvpn/`hostname` -k /etc/openvpn/server_freeipa.key -f /etc/openvpn/server_freeipa.crt -I openvpn -C /usr/local/sbin/set-ssl-permissions
#openvpn server config
local <addressToBindTo>
port 1194