Skip to content

Instantly share code, notes, and snippets.

View srid99's full-sized avatar

Sridhar Gnanasekaran srid99

View GitHub Profile
@srid99
srid99 / server.py
Last active May 28, 2016 15:45
Simple python server
#!/usr/bin/python
from wsgiref.simple_server import make_server
def application(environ, start_response):
response_body = '{"id": 1}'
status = '200 OK'
response_headers = [('Content-Type', 'application/json'),
('Content-Length', str(len(response_body)))]
@srid99
srid99 / install-intellij.sh
Created June 9, 2014 15:14
A bash script to create and install a desktop entry for intellij ultimate edition in (mostly) any linux distro
#!/usr/bin/env bash
# Run this script from your '/.../intellij-location/bin' directory.
# Application name
APPLICATION=intellij-idea
# Application path
APPLICATION_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
@dconnolly
dconnolly / README.md
Last active June 7, 2024 07:42
All 100 Chromecast background images that are rotated through, linked to their original locations on Google hosting. Links to 2560 width versions, where available.
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active June 10, 2024 09:43
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@jonraasch
jonraasch / highlight.js
Created September 2, 2010 22:14
Live on-page text highlighting
/*
highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !!
Highlights arbitrary terms.
<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>
MIT license.