Skip to content

Instantly share code, notes, and snippets.

View brownman's full-sized avatar

brownman brownman

  • self
  • israel
View GitHub Profile
@Kirill89
Kirill89 / Dockerfile
Created March 12, 2020 08:36
Prototype Pollution security vulnerability in yargs
FROM ubuntu:18.04
COPY ./app /app
RUN chmod u+s /app
RUN useradd -s /bin/bash just-user
USER just-user
var appModules = [
'ionic',
'ngCordova'
];
root.Application = angular.module('com.myorg.myapp', appModules)
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// check for the plugin first, to prevent triggering cordova plugin error when you run the application in the browser
if (window.plugins && window.plugins.matPlugin) {
curl -H "Content-Type: application/json" -X POST -d '{
"app_id": "com.yourapp.mobi",
"platform": "android",
"click_time": "2014-10-01 06:12:32",
"install_time": "2014-10-01 06:15:16",
"agency": "agency name",
"media_source": "Facebook Ads",
"campaign": null,
"fb_campaign_name": "fb campaign name",
"fb_campaign_id": "12345678910",
@pulkitsinghal
pulkitsinghal / notes.md
Last active February 8, 2019 18:00
Loopback: How to log any errors via a global error handler?

Pitfalls

The REST adapter for strong-remoting sets up its own error handler! So you cannot accomplish this for REST API related calls by replacing:

  1. app.use(loopback.errorHandler()); in server/server.js
  2. or, loopback#errorHandler in middleware.json

So don't waste your time there.

Deeper Understanding

@brownman
brownman / wifi.sh
Last active August 29, 2015 14:18
linux: auto connect wifi (for wpa2 encryption)
ssid=${1:-$SSID}
key=${2:-$PASSWORD}
test -n "$ssid" || { echo '[required args] : ssid password'; exit 0; }
pkgs='wpa_passphrase' #dhcp-gtk
type $pkgs || ( sudo apt-get install $pkgs)
connect_passwordless_wifi(){
commander sudo ifconfig $device up
commander sudo iw dev $device connect $ssid
@mafintosh
mafintosh / using-docker.js
Last active August 29, 2015 14:10
index.js
// do `docker pull mafintosh/bulk-markdown-to-png` first
var Dat = require('dat')
var pretty = require('pretty-bytes')
var run = require('docker-run')
var tar = require('tar-stream')
var dat = new Dat('./', function(err) {
if (err) throw err // yolo
@Gurpartap
Gurpartap / Dockerfile
Last active August 29, 2015 14:06
Ruby Sinatra docker app for (not just) Kitematic
FROM ubuntu:14.04
RUN apt-get update -qq && \
apt-get install -y make curl -qq && \
apt-get clean && \
curl -sSL "https://github.com/postmodern/ruby-install/archive/master.tar.gz" -o /tmp/ruby-install-master.tar.gz && \
cd /tmp && tar -zxvf ruby-install-master.tar.gz && \
cd /tmp/ruby-install-master && make install && \
apt-get update && \
echo "gem: --no-rdoc --no-ri" >> ~/.gemrc && \
@jpotts
jpotts / user.properties
Created August 30, 2014 21:24
Apache JMeter user.properties that configures test settings as well as the CSV format for the test results
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.data_type=false
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data.on_error=false
jmeter.save.saveservice.response_message=false
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=false
@scottcagno
scottcagno / lmgen.sh
Last active March 15, 2018 16:21
Language Model Generator - Supply corpus text file and it will use cmu's online generator to generate and download the dictionary, language model and binary language model
#!/bin/bash
# Copyright (c) 2014-Present, Scott Cagno
# All rights reserved. [BSD License]
# ------------------------------------------
# THIS BASH SCRIPT UPLOADS A CORPUS FILE TO
# THE CMU ONLINE LANGUAGE MODELING GENERATOR.
# IT WILL RETURN AND STAGE THE GENERATED
# LANGUAGE MODEL AND DICTIONARY FILES IN THE
# SPECIFIED DIRECTORY (LANGDIR).
@brownman
brownman / dd_progressbar_pv.sh
Last active May 11, 2020 22:01 — forked from rriemann/gist:1406035
dd + progress bar
##########################################
# ofer shaham (c)
# 5-2014
# to: towards more generic usage
# from: a forked gist
##########################################
#dd command + pipe the progress using: pv
#depend_package: dd pv
##########################################
set -o nounset