mitmproxy is an excellent console app written in Python.
It is easy to use on Linux and OS X.
Use brew install mitmproxy to install it on OS X.
| package com.pandemic.recommendation_core.web | |
| import akka.actor._ | |
| import akka.actor.Actor.actorOf | |
| import akka.http._ | |
| import org.eclipse.jetty.server.Server | |
| import org.eclipse.jetty.servlet.ServletHolder | |
| import org.eclipse.jetty.servlet.ServletContextHandler | |
| import org.eclipse.jetty.http.security.Constraint; | |
| import org.eclipse.jetty.http.security.Credential; |
| import javax.script.ScriptEngine; | |
| import javax.script.ScriptEngineManager; | |
| import scala.tools.nsc.interpreter.IMain; | |
| import scala.tools.nsc.settings.MutableSettings.BooleanSetting; | |
| public class ScalaTest { | |
| public static void main(String[] args) throws Exception{ | |
| ScriptEngine engine = new ScriptEngineManager().getEngineByName("scala"); | |
| ((BooleanSetting)(((IMain)engine).settings().usejavacp())).value_$eq(true); |
mitmproxy is an excellent console app written in Python.
It is easy to use on Linux and OS X.
Use brew install mitmproxy to install it on OS X.
| #!/usr/bin/luajit | |
| local ffi = require 'ffi' | |
| ffi.cdef([[ | |
| struct hostent { | |
| char *h_name; /* official name of host */ | |
| char **h_aliases; /* alias list */ | |
| int h_addrtype; /* host address type */ | |
| int h_length; /* length of address */ |
| import random | |
| from wheezy.captcha.image import captcha | |
| from wheezy.captcha.image import background | |
| from wheezy.captcha.image import curve | |
| from wheezy.captcha.image import noise | |
| from wheezy.captcha.image import smooth | |
| from wheezy.captcha.image import text | |
| from wheezy.captcha.image import offset | |
| from wheezy.captcha.image import rotate |
| #!/usr/bin/env python3 | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| see: https://gist.github.com/UniIsland/3346170 | |
| """ | |
| { | |
| "id": 1, | |
| "title": "Spark Prometheus", | |
| "originalTitle": "Spark Prometheus", | |
| "tags": [], | |
| "style": "dark", | |
| "timezone": "browser", | |
| "editable": true, | |
| "hideControls": false, | |
| "sharedCrosshair": false, |
| #!/bin/bash | |
| # --------------------------------------------------------- | |
| # Customizable Settings | |
| # --------------------------------------------------------- | |
| MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}" | |
| VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}" | |
| VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}" | |
| VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}" |
| # creates an LVM under a single device | |
| dd if=/dev/zero of=/dev/sdb bs=512 count=64 | |
| pvcreate /dev/sdb | |
| pvs | |
| vgcreate timeline /dev/sdb | |
| lvcreate -n app -l 100%FREE timeline | |
| mkfs.xfs -L APP /dev/timeline/app | |
| echo '/dev/timeline/app /app xfs noatime 1 2' >> /etc/fstab | |
| mkdir -p /app && mount /app |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import sys | |
| import subprocess | |
| def convert_git_url(git_url): | |
| if git_url.startswith('git@'): | |
| git_url = 'http://' + '/'.join(git_url[4:].split(':')) | |
| return git_url |