Skip to content

Instantly share code, notes, and snippets.

Avatar

Vignesh A S asvignesh

View GitHub Profile
@asvignesh
asvignesh / php_zts_pthread.md
Last active Oct 8, 2020
Install PHP ZTS and enable the pThread
View php_zts_pthread.md

Install packages needed for compiling

sudo apt-get update

sudo apt install autoconf automake bison build-essential curl flex \
  libtool libssl-dev libcurl4-openssl-dev libxml2-dev libreadline7 \
  libreadline-dev libsqlite3-dev libzip-dev libzip4 nginx openssl \
  pkg-config re2c sqlite3 zlib1g-dev
 
@asvignesh
asvignesh / mongo_post.sh
Created May 8, 2020
MongoDB application consistent pre-post backup script
View mongo_post.sh
mongo --eval 'db.fsyncUnlock()' --quiet
@asvignesh
asvignesh / ClientBean.java
Created Mar 22, 2020
Spring Boot Config Client
View ClientBean.java
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class ClientBean {
@Value("${k1}")
private String k1;
public String getK1() {
View ConfigurationServiceApplication.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@EnableConfigServer
@SpringBootApplication
public class ConfigurationServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigurationServiceApplication.class, args);
}
@asvignesh
asvignesh / IAM Role.json
Created Mar 8, 2020
Create EC2 Consistent Backup
View IAM Role.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateTags",
"ec2:DescribeInstanceAttribute"
@asvignesh
asvignesh / oracle_post.sh
Created Feb 8, 2020
Oracle database pre and post script for Nimesa
View oracle_post.sh
export ORACLE_HOME=/oracle/oracle11g
$ORACLE_HOME/bin/sqlplus / as sysdba <<EOF
spool $ORACLE_HOME/log/backup.log;
alter database end backup;
spool off;
EOF
@asvignesh
asvignesh / mysql-post.py
Last active Aug 31, 2019
MySQL Application consistent backup for Nimesa
View mysql-post.py
import MySQLdb
import os
import time
import datetime
dt=datetime.datetime.now().strftime("%I:%M%p on %B %d, %Y")
file1 = open("/scripts/post-thaw.log","a+" )
try:
os.remove('/tmp/freeze_snap.lock')
View Nimesa Role.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:CopySnapshot",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:ModifyVolumeAttribute",
View CustomAuthentication.java
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
/**
@asvignesh
asvignesh / vm_from_template.yml
Created Jun 5, 2019
Provision vSphere VM from Template on Ansible
View vm_from_template.yml
- hosts: localhost
connection: local
tasks:
- name: Clone VM from Template
- vmware_guest:
hostname: vcenter.asvignesh.in
username: administrator@asvignesh.in
password: password
validate_certs: no
name: newvm001
You can’t perform that action at this time.