Skip to content

Instantly share code, notes, and snippets.

View tonycosentini's full-sized avatar
🍕

Tony Cosentini tonycosentini

🍕
View GitHub Profile
# 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:
@nerzhulart
nerzhulart / Windows Defender Exclusions for Developer.ps1
Last active April 4, 2024 23:54 — forked from dknoodle/Windows Defender Exclusions VS 2017.ps1
Adds Windows Defender exclusions for developers (Visual Studio, JetBrains Rider, IntellIJ Idea, Git, MsBuild, dotnet, mono etc.)
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@ian-p-cooke
ian-p-cooke / add_wsl_exclusions.ps1
Last active November 12, 2022 05:02
powershell script to add WSL exclusions
$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
@mariotacke
mariotacke / README.md
Created March 7, 2017 04:36
Default nginx log format (combined) and grok pattern
@avleen
avleen / logstash-template.json
Created June 21, 2016 18:47
Elasticsearch template for Logstash, showing doc_values for specific fields and using notation on dynamic fields to declare type.
{
"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",
@xkr47
xkr47 / letsencrypt-jetty.sh
Last active August 29, 2023 07:22
How to use Letsencrypt certificate & private key with Jetty
# 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
@manadream
manadream / andOrientation.sh
Created March 21, 2015 16:45
Commands for setting android device orientation from shell
# 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
@ryanzhou
ryanzhou / pf.md
Last active October 21, 2019 03:52
Getting Pow to work in OS X Yosemite

Getting Pow to work in OS X Yosemite

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.

1. Anchor file

Create file /etc/pf.anchors/pow

@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@mfremont
mfremont / build.gradle
Created February 18, 2014 15:20
Example build.gradle for a unit test submodule in an Android project.
/**
* 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')