Some parts taken from: https://gist.github.com/kujohn/7209628
ipfw
is officially deprecated and removed in OS X Yosemite. Pow requires another program pf
to handle the port forwarding.
Create file /etc/pf.anchors/pow
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.8+' | |
} | |
} |
/** | |
* Example build descriptor that builds and runs Robolectric unit tests in src/test for an Android | |
* app project in the 'app' module of the project. | |
*/ | |
apply plugin: 'java' | |
test { | |
// Robolectric expects to find AndroidManifest.xml and res/ in the working directory | |
workingDir androidManifestDir(project(':app'), 'main') |
# first turn off accelerometer controlling the orientation | |
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0 | |
# then set orientation | |
shopt -s nocasematch | |
if [ "$ORIENTATION" == "portrait" ] | |
then | |
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0 | |
elif [ "$ORIENTATION" == "landscape" ] | |
then |
{ | |
"template": "logstash-*", | |
"settings" : { | |
"number_of_shards" : 180, | |
"number_of_replicas" : 1, | |
"index.refresh_interval" : "5s", | |
"index.routing.allocation.total_shards_per_node" : 4, | |
"index.search.slowlog.threshold.query.warn": "100ms", | |
"index.search.slowlog.threshold.fetch.warn": "100ms", |
# Simple TFServing example; Based on | |
# https://github.com/tensorflow/serving/blob/master/tensorflow_serving/example/mnist_client.py | |
# Added simpler mnist loading parts and removed some complexity | |
#!/usr/bin/env python2.7 | |
"""A client that talks to tensorflow_model_server loaded with mnist model. | |
The client downloads test images of mnist data set, queries the service with | |
such test images to get predictions, and calculates the inference error rate. | |
Typical usage example: |
Some parts taken from: https://gist.github.com/kujohn/7209628
ipfw
is officially deprecated and removed in OS X Yosemite. Pow requires another program pf
to handle the port forwarding.
Create file /etc/pf.anchors/pow
configurations { | |
apt | |
} | |
dependencies { | |
compile 'com.squareup.dagger:dagger:1.1.0' | |
apt 'com.squareup.dagger:dagger-compiler:1.1.0' | |
} | |
android.applicationVariants.all { variant -> |
$win_user = "ipc" | |
$linux_user = "ipc" | |
$package = "CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc" | |
$base_path = "C:\Users\" + $win_user + "\AppData\Local\Packages\" + $package + "\LocalState\rootfs" | |
$dirs = @("\bin", "\sbin", "\usr\bin", "\usr\sbin", "\home\" + $linux_user + "\.cargo\bin") | |
$dirs | ForEach { Add-MpPreference -ExclusionProcess ($base_path + $_ + "\*") } | |
Add-MpPreference -ExclusionPath $base_path |
#!/bin/sh | |
# UFW blocks for China, Korea, Malaysia, Phillipines, Singapore, Thailand and Vietnam netblocks | |
# Based on http://www.wizcrafts.net/chinese-iptables-blocklist.html | |
# Cambodia (KH) | |
ufw deny from 114.134.184.0/21 to any port 22 | |
# Chinese (CN) IP addresses follow: | |
ufw deny from 1.192.0.0/13 to any port 22 | |
ufw deny from 1.202.0.0/15 to any port 22 |
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with | |
# the "auth" aka "certonly" subcommand | |
# convert certificate chain + private key to the PKCS#12 file format | |
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem | |
# convert PKCS#12 file into Java keystore format | |
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks | |
# don't need the PKCS#12 file anymore |