Skip to content

Instantly share code, notes, and snippets.

View jmcabandara's full-sized avatar
🎯
Focusing

Chaminda Bandara jmcabandara

🎯
Focusing
View GitHub Profile
@jmcabandara
jmcabandara / Apache Tomcat 8 Start stop script init.d script
Created May 6, 2017 05:47 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
Apache Tomcat init script (or startup/controll script). Works fine for version 7/8. Read the comments for release history. Feel free to modify, copy and give suggestions. (c) GNU General Public License
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
#
# Copyright (C) 2014 Miglen Evlogiev
#
# This program is free software: you can redistribute it and/or modify it under
@jmcabandara
jmcabandara / IPtables and csf.md
Created November 23, 2017 05:44 — forked from macmladen/IPtables and csf.md
Handling firewall blocking and unblocking, iptables, csf
@jmcabandara
jmcabandara / facebook-page-invite.js
Created December 9, 2017 08:47 — forked from guiliredu/facebook-page-invite.js
Facebook - Script to auto invite people who liked a page post do like the page
var buttons;
buttons = document.getElementsByClassName('_42ft');
for (var i = 0; i < buttons.length; i++) {
if(buttons[i].getAttribute('ajaxify') != null){
if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){
buttons[i].click();
}
}
}
@jmcabandara
jmcabandara / install.sh
Created January 5, 2018 09:14 — forked from Justasic/install.sh
This was a simple shell script I made to install EPEL and REMI yum repos. I have installed so many CentOS machines that I get tired of running the same commands over and over so I made this a script. Run `curl https://gist.githubusercontent.com/Justasic/9855295/raw/install.sh | sh` to install.
#!/bin/sh
# Install yum priorities to make sure we aren't going to try and install fedora on centos :s
yum install yum-priorities -y
# Import the GPG keys for package verification signatures
rpm --import https://fedoraproject.org/static/0608B895.txt
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
# Install epel and remi repos

Keybase proof

I hereby claim:

  • I am jmcabandara on github.
  • I am jmcabandara (https://keybase.io/jmcabandara) on keybase.
  • I have a public key ASD_M_oO9YIz4-6EdOLdz6Y0PI5QO6xyqVwxd79p3PcOBQo

To claim this, I am signing this object:

@jmcabandara
jmcabandara / ansible_nginx.yml
Created June 25, 2018 09:33 — forked from uorat/ansible_nginx.yml
Ansible Playbook for installing Nginx
---
########################################
## Ansible Playbook for installing Nginx
########################################
- name: check registered the repository of nginx-release
shell: rpm -qa | grep nginx-release
register: result
ignore_errors: True

#Nginx Basics for Ubuntu

Please see http://wiki.nginx.org/Main for more information. See http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/ for a tutorial on how to install Nginx.

##Installation To install, you can install the version which is in the standard Ubuntu repositories but it is normally quite old and will not have the latest security patches. The best way is to update the repositories first:

apt-get update
apt-get install python-software-properties

apt-get upgrade

@jmcabandara
jmcabandara / Linux Static IP
Created July 5, 2018 07:18 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
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)
@jmcabandara
jmcabandara / dbserver.yml
Created July 11, 2018 16:32 — forked from ihassin/dbserver.yml
Ansible script to install mySQL
- hosts: webservers
user: vagrant
sudo: true
vars_files:
- vars.yml
tasks:
- name: Install MySQL
action: apt pkg=$item state=installed
with_items: