Skip to content

Instantly share code, notes, and snippets.

View MiteshShah's full-sized avatar
💻
Let's Automate it!

Mitesh Shah MiteshShah

💻
Let's Automate it!
View GitHub Profile
@MiteshShah
MiteshShah / wp_update.sh
Last active June 19, 2017 20:28
Update Multiple WordPress
#!/bin/bash
# Define Variables
WEB_ROOT=/var/www
WEB_ROOT_PREFIX=htdocs
WEB_ROOT_GROUP=www-data
WP_UPDATE_LOGS=/var/log/setup/wp-update.log
# Capture Errors
function OwnError() {
@MiteshShah
MiteshShah / STF
Last active February 18, 2025 06:15
#!/bin/bash
# Error handling
function OwnError()
{
echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)"
exit $2
}
# Repository for rethinkdb
@MiteshShah
MiteshShah / gist:6879e09b6999d5c8e77c
Last active August 29, 2015 14:27 — forked from hrchu/gist:0cc5e783387f5453f528
logstash-grok-pattern-squid
# Follows the squid format in default:
# logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
# http://www.squid-cache.org/Doc/config/logformat/
%{NUMBER:timestamp}\s+%{NUMBER:response_time} %{IPORHOST:src_ip} %{WORD:squid_request_status}/%{NUMBER:http_status_code} %{NUMBER:reply_size_include_header} %{WORD:http_method} %{URI:request_url} %{USERNAME:user} %{WORD:squid_hierarchy_status}/%{IPORHOST:server_ip_or_peer_name} (?<mime_content_type>\S+\/\S+)
@MiteshShah
MiteshShah / jenkins-notes.md
Created December 16, 2015 15:43 — forked from misterbrownlee/jenkins-notes.md
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

Keybase proof

I hereby claim:

  • I am MiteshShah on github.
  • I am mitesh (https://keybase.io/mitesh) on keybase.
  • I have a public key whose fingerprint is B25F 836E 2806 CEF2 0F11 D421 D914 014B EC9D 4E62

To claim this, I am signing this object:

<IfModule mod_sftp.c>
SFTPEngine on
Port 2222
SFTPLog /var/log/proftpd/sftp.log
# Configure both the RSA and DSA host keys, using the same host key
# files that OpenSSH uses.
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPHostKey /etc/ssh/ssh_host_dsa_key
#!/bin/bash
echo "Enter Array: "
read -a array
echo "Total Element = ${#array[@]}"
IFS=$'\n' sorted=($(sort -n <<<"${array[*]}"))
echo
echo Sorted Array = ${sorted[@]}
for i in $(sort -un <<<"${array[*]}")
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 7168
v.cpus = 6
#!/bin/sh
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#!/bin/bash
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.