Skip to content

Instantly share code, notes, and snippets.

View sahilsk's full-sized avatar
🏠
Working from home

S. Meena sahilsk

🏠
Working from home
View GitHub Profile
@sahilsk
sahilsk / renew-certificates.sh
Created January 20, 2016 14:07
LetsEncrypt auto-renew script
#!/bin/bash
#### Source : https://vincent.composieux.fr/article/install-configure-and-automatically-renew-let-s-encrypt-ssl-certificate
WEB_SERVICE='nginx'
CONFIG_FILE='/usr/local/etc/le-yourdomain-webroot.ini'
LE_PATH='/opt/letsencrypt'
EXP_LIMIT=30;
if [ ! -f $CONFIG_FILE ]; then
echo "[ERROR] config file does not exist: $CONFIG_FILE"
@sahilsk
sahilsk / example_python_app.conf
Created December 31, 2015 09:51
Upstart script for python apps
# vim: filetype=upstart
env UWSGI_BIN=/home/ubuntu/www/example_app/current/venv/bin/uwsgi
env PYTHONPATH=/home/ubuntu/www/example_app/current
env NEW_RELIC_CONFIG_FILE=/etc/newrelic/newrelic.ini
env NEW_RELIC_ADMIN=/usr/local/bin/newrelic-admin
expect fork
umask 0000
@sahilsk
sahilsk / nginx_site_config
Created July 3, 2015 13:11
Nginx elb configuration with proxy-protocol enable. ELB doesn't support websocket at layer 7. So, we need to configure it at TCP layer
log_format elb_log '$proxy_protocol_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent "$http_referer" ' '"$http_user_agent"';
server {
listen 80 proxy_protocol;
listen [::]:80 proxy_protocol;
server_name localhost;
access_log /var/log/nginx/elb-access_http.log elb_log;
location / {
root /var/www/html;
rewrite ^(.*)$ https://$host$1 permanent;
@sahilsk
sahilsk / mysqldump_remotely.md
Last active January 5, 2016 08:20
Mysql db dump remotely

Instructions

Export

  • Create tunnel
---
# file docker/tasks/main.yml
- name: run apt-get update
apt: update_cache=yes
sudo: yes
- name: install required packages
apt: name="linux-image-generic-lts-trusty" state="present"
sudo: yes
@crunchie84
crunchie84 / installation.md
Last active May 11, 2016 15:13
Install the ELK stack on an ubuntu-x64 machine on Azure

install the ELK stack on an ubuntu-x64 machine on Azure

This guide has been revised 06-03-2015. Start with a clean ubuntu 14.04LTS-x64 machine and get it updated

sudo su
apt-get update && apt-get dist-upgrade
reboot
@obolton
obolton / elb-nodejs-ws.md
Last active November 12, 2023 11:49
Configuring an AWS Elastic Load Balancer for a Node.js application using WebSockets on EC2

AWS ELB with Node.js and WebSockets

This assumes that:

  • You are using Nginx.
  • You want to accept incoming connections on port 80.
  • Your Node.js app is listening on port 3000.
  • You want to be able to connect to your Node.js instance directly as well as via the load balancer.

####1. Create load balancer

@masteinhauser
masteinhauser / build.sh
Last active September 13, 2018 08:57
Example Packer pipeline with Berkshelf cookbook vendoring
#!/bin/bash -x
#DEBUG="-debug"
VM=`echo ${1} | sed 's/.json//g'`
PACKER=`which packer`
rm -rf output-${VM}
${PACKER} build ${DEBUG} ${VM}.json
@pablitoc
pablitoc / configure_proxy_protocol.md
Last active April 12, 2023 15:21
Configuring Proxy Protocol

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"

@yeukhon
yeukhon / VAGRANT-COURSE.md
Last active March 19, 2022 15:44
Vagrant crash course