Skip to content

Instantly share code, notes, and snippets.

View vikaschenny's full-sized avatar
😊
I may be slow to respond.

chennaiah vikaschenny

😊
I may be slow to respond.
View GitHub Profile
@vikaschenny
vikaschenny / db_backup.sh
Created May 8, 2018 14:37 — forked from NARKOZ/db_backup.sh
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
MyUSER="" # DB_USERNAME
MyPASS="" # DB_PASSWORD
MyHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="" # /home/username/backups/DB
#!/bin/sh
usep=$( free -m | awk 'NR==2{printf "%.f\t\t", $3*100/$2 }')
if [ $usep -ge 20 ]; then
sync; echo 1 > /proc/sys/vm/drop_caches
fi
script -2
memory, cpu and disk space display script
Example of Zookeeper and Solr cluster with Docker networking
------------------------------------------------------------
In this example I'll create a cluster with 3 ZooKeeper nodes and 3 Solr nodes, distributed over 3 machines (trinity10, trinity20, trinity30).
I'll use an overlay network, specify fixed IP addresses when creating containers, and I'll pass in explicit `/etc/hosts` entries to make sure they are available even when nodes are down.
I won't show the configuration of the key-value store to configuration to enable networking, see [the docs](https://docs.docker.com/engine/userguide/networking/get-started-overlay/) for that.
I'll not use Docker Swarm in this example, but specifically place and configure containers where I want them by ssh'ing into the appropriate Docker host.
To make this example easier to understand I'll just use shell commands.
For actual use you may want to use a fancier deployment tool like [Fabric](http://www.fabfile.org).
<?xml version="1.0" encoding="UTF-8"?>
<project name="My Project" default="help" xmlns:sonar="antlib:org.sonar.ant">
<!-- Define the SonarQube global properties (the most usual way is to pass these properties via the command line) -->
<property name="sonar.jdbc.url" value="jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8" />
<property name="sonar.jdbc.username" value="sonar" />
<property name="sonar.jdbc.password" value="sonar" />
<!-- Define the SonarQube project properties -->
<property name="sonar.projectKey" value="my-project" />
@vikaschenny
vikaschenny / nginx.conf
Created January 29, 2018 09:56 — forked from phpdude/nginx.conf
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
before ssh client we need to install wine its bhaves windows system
https://wine-staging.com/installation.html
download any ssh-client .exe open with wine you can get

Step by step to install Scala + Play Framework in Ubuntu 14.04 with Activator.

Install Scala

sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.6.deb
sudo dpkg -i scala-2.11.6.deb
sudo apt-get update
sudo apt-get install scala
@vikaschenny
vikaschenny / install-charles-proxy.sh
Created January 17, 2018 12:22 — forked from heyalexej/install-charles-proxy.sh
install charles proxy from deb source
#!/usr/bin/env sh
set -e
# install charles proxy from deb sources.
# http://www.charlesproxy.com
sudo sh -c 'echo "deb http://www.charlesproxy.com/packages/apt/ charles-proxy main" > /etc/apt/sources.list.d/charles-proxy.list'
wget -q http://www.charlesproxy.com/packages/apt/PublicKey -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y charles-proxy
@vikaschenny
vikaschenny / octopus-ssh-server.sh
Created December 8, 2017 12:50 — forked from yetanotherchris/octopus-ssh-server.sh
Octopus deploy SSH tentacle install script (Ubuntu 16)
# Mono
echo "Installing Mono...this can take up to 25 minutes"
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete
# Docker
sudo apt-get install docker.io
sudo service docker restart
@vikaschenny
vikaschenny / mysql_secure.sh
Created December 4, 2017 12:50 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10