A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
| pip install sh |
| #!/bin/bash | |
| # Retrieve AWS instrance's commonly used metadata. Require curl. | |
| # ./get-metadata help | |
| # ./get-metadata id | |
| # Input is case insensitive; format to uppper case to generate self-help page. | |
| info=${1^^} | |
| meta_data_url=http://169.254.169.254/latest/meta-data/ | |
| roleProfile=$(curl -s http://169.254.169.254/latest/meta-data/iam/info \ | |
| | grep -Eo 'instance-profile/([a-zA-Z.-]+)' | sed 's#instance-profile/##') |
| /* | |
| This script counts all photos that are available on Flickr and Panoramio for a specific geo fence and returns a JSON object with the data. | |
| For convenience it's embedded in a little node.js server so that you can upload it to your server and use it as an API. | |
| Here's an example url with all query attributes prefilled. Please use your own Flickr API key! | |
| The location is the Berlin TV Tower (http://en.wikipedia.org/wiki/Fernsehturm_Berlin) | |
| Example URL: http://piccounter-philippschmitt.rhcloud.com/?lat=52.520732&lon=13.409537&latRes=0.00015&lonRes=0.0003&flickrKey=60d03369d3e92b4578c8f2df2de5af66 | |
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| # ssh(1) obtains configuration data from the following sources in the following order: | |
| # | |
| # 1. command-line options | |
| # 2. user's configuration file (~/.ssh/config) | |
| # 3. system-wide configuration file (/etc/ssh/ssh_config) | |
| # | |
| # For each parameter, the first obtained value will be used. The configuration files contain sections separated | |
| # by “Host” specifications, and that section is only applied for hosts that match one of the patterns given in the | |
| # specification. The matched host name is the one given on the command line. | |
| # |
I recently had the following problem:
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
Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
| #!/bin/bash | |
| # This is a script to create a video from series of JPEG images | |
| # Call it in a folder full of JPEGs that you want to turn into a video. | |
| # Written on 2013-01-08 by Philipp Klaus <philipp.l.klaus →AT→ web.de>. | |
| # Check <https://gist.github.com/4572552> for newer versions. | |
| # Resources | |
| # * http://www.itforeveryone.co.uk/image-to-video.html | |
| # * http://spielwiese.la-evento.com/hokuspokus/index.html |
(Full description and list of commands at - https://npmjs.org/doc/index.html)
Make sure to export your local $PATH and prepand relative ./node_modules/.bin/: