Skip to content

Instantly share code, notes, and snippets.

GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY 'password';
@jnakatsui
jnakatsui / Ansible Instll on Redhat Amz Nat Linux
Last active October 29, 2015 22:14
Ansible Install on Ubuntu 12.04
#!/bin/bash
sudo yum update
sudo yum install python-pip
sudo yum install build-essential
sudo yum install python-dev
sudo pip install paramiko PyYAML jinja2 httplib2
sudo pip install ansible
# Boto
@jnakatsui
jnakatsui / gist:fe093b0ca1383213d372
Last active March 30, 2017 17:35
mySQL Replication and SSL
CREATE USER 'ssluser'@'%' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON *.* TO 'ssluser'@'%' IDENTIFIED BY 'mypass' REQUIRE SSL;
sudo mysqld --ssl-ca=/etc/mysql/ca-cert.pem --ssl-cert=/etc/mysql/server-cert.pem --ssl-key=/etc/mysql/server-key.pem
# Setup SSL http://askubuntu.com/questions/194074/enabling-ssl-in-mysql
# Generate a CA key and certificate with SHA1 digest
openssl genrsa 2048 > ca-key.pem
openssl req -sha1 -new -x509 -nodes -days 3650 -key ca-key.pem > ca-cert.pem
@jnakatsui
jnakatsui / gist:ead5216c8fb110d99fdb
Created October 3, 2014 17:01
Generate public key from private key
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
@jnakatsui
jnakatsui / gist:35621815f5544b8b82b3
Created June 8, 2014 21:07
Fix for address already using port 80 Nginx error
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
Then it means nginx or some other process is already using port 80.
You can kill it using:
sudo fuser -k 80/tcp
@jnakatsui
jnakatsui / SSL CSR
Last active October 28, 2015 23:57
SSL CSR and CRT Creation
openssl req -new -newkey rsa:4096 -nodes -keyout server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
openssl rsa -in server.key -out server.pem
@jnakatsui
jnakatsui / list-ppa
Created April 19, 2014 02:13
list ppa on *nix system
#! /bin/sh
# listppa Script to get all the PPA installed on a system ready to share for reininstall
for APT in `find /etc/apt/ -name \*.list`; do
grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
USER=`echo $ENTRY | cut -d/ -f4`
PPA=`echo $ENTRY | cut -d/ -f5`
echo sudo apt-add-repository ppa:$USER/$PPA
done
done