Skip to content

Instantly share code, notes, and snippets.

@omshivaprakash
omshivaprakash / autossh.sh
Created August 3, 2022 17:58 — forked from luisehk/autossh.sh
Reverse SSH tunnel as a systemd service
#!/bin/bash
echo 'Starting reverse SSH tunnel'
/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure=yes" -tt -R \*:2222:localhost:22 user@your.server

Keybase proof

I hereby claim:

  • I am omshivaprakash on github.
  • I am techfiz (https://keybase.io/techfiz) on keybase.
  • I have a public key ASAjeabTU9V3Q1v5bJwMzOoFEFxrbVA7wT1aPow70Xzu_Qo

To claim this, I am signing this object:

@omshivaprakash
omshivaprakash / all-dist-list-sync.sh
Created July 12, 2012 19:11 — forked from mankuthimma/all-dist-list-sync.sh
Shell script to sync all users in a zimbra domain to an org wide distribution list
#!/bin/bash
CURALL=`tempfile`
EMALL=`tempfile`
DIFFY=`tempfile`
ADDLIST=`tempfile`
zmprov -l gaa | sort | uniq > $EMALL
zmprov gdl all@example.com|grep "zimbraMailForwardingAddress:"|sed "s/zimbraMailForwardingAddress: //"|sort|uniq > $CURALL
diff --left-column $CURALL $EMALL | grep example.com | sed "s/> //g" > $DIFFY
diff /opt/zimbra/conf/all_list_ignore $DIFFY|grep example.com|sed "s/<//g"|sed "s/>//g"|sed "s/ //g" > $ADDLIST
@omshivaprakash
omshivaprakash / app.vcl
Created June 22, 2012 11:39 — forked from smithcommajoseph/app.vcl
Sample Localhost VCL config for Varnish 3 and Rails 3.1
#-e This is a basic VCL configuration file for varnish. See the vcl(7)
#man page for details on VCL syntax and semantics.
#
#Default backend definition. Set this to point to your content
#server.
#
backend default {
.host = "127.0.0.1";
.port = "3000";
}
@omshivaprakash
omshivaprakash / mysql_innodb_or_myisam_to_ndbcluster.sh
Created June 22, 2012 10:51 — forked from KrzysztofKowalski/mysql_innodb_or_myisam_to_ndbcluster.sh
MySQL InnoDB / MyISAM to NDBCLUSTER Conversion script
#!/bin/bash
DBNAME=dbtest
USER=user
PASS=pass
HOST=127.0.0.1
NDB_DBNAME=dbtest
NDB_USER=user
NDB_PASS=pass
@omshivaprakash
omshivaprakash / default.vcl.pl
Created June 15, 2012 10:27 — forked from bmarini/default.vcl.pl
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)
@omshivaprakash
omshivaprakash / reader2wordpress.py
Created May 6, 2012 04:52 — forked from stefanw/reader2wordpress.py
Convert Google Reader Atom XML to WordPress eXtended RSS. Useful to recreate Wordpress blog from Google Reader "Backup".
# -*- coding:utf-8 -*-
"""
Backup Google Reader Items to WordPress eXtended RSS (Wordpress Export Format)
Download Feeds from http://www.google.com/reader/atom/feed/http://yourblogdomain.com/yourfeed?n=1000
(1000 = number of items)
Usage: reader2wordpress.py google_atom.xml http://yourblogdomain.com/
Licensed under BSD.