Skip to content

Instantly share code, notes, and snippets.

Vignesh A S asvignesh

Block or report user

Report or block asvignesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
View deploy_nimesa_ova.ps1
Connect-VIServer -Server vcenter.asvignesh.in -Credential
$ovfPath = "C:\Users\asvig\Downloads\nimesa.ova"
$ovfConfig = Get-OvfConfiguration -Ovf $ovfPath
$ovfConfig.Common.ip.Value="10.10.x.x"
$ovfConfig.Common.netmask.Value="255.255.0.0"
$ovfConfig.Common.gateway.Value="10.0.0.1"
$ovfConfig.Common.dns1.Value="8.8.4.4"
$ovfConfig.Common.dns2.Value="8.8.8.8"
$ovfConfig.NetworkMapping.VM_Network.Value="VM Network"
You can’t perform that action at this time.