Skip to content

Instantly share code, notes, and snippets.

@gotomypc
gotomypc / __request
Created November 5, 2012 09:39 — forked from natos/__request
Multiple Requests with Request (Node.js)
var request = require('request')
/**
* Handle multiple requests at once
* @param urls [array]
* @param callback [function]
* @requires request module for node ( https://github.com/mikeal/request )
*/
var __request = function (urls, callback) {
@gotomypc
gotomypc / gist:3968033
Created October 28, 2012 08:11 — forked from mrjjwright/gist:3240020
Extract largest image thumbnail from url using node and cheerio
cheerio = require('cheerio')
Shred = require('shred')
shred = new Shred()
http = require('http')
URL = require('url')
server = http.createServer (request, response) ->
url = URL.parse(request.url, true)
urlToDiscover = url.query['url']
startDiscovery urlToDiscover, (theImageURL) ->
@gotomypc
gotomypc / gps.java
Created December 1, 2012 15:58 — forked from javisantana/gps.java
real/fake gps
package hardware;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.location.LocationProvider;
@gotomypc
gotomypc / reverse-ip-lookup.js
Created October 27, 2012 08:54 — forked from eugenehp/reverse-ip-lookup.js
node.js IP reverse lookup
var dns = require('dns');
function reverseLookup(ip) {
dns.reverse(ip,function(err,domains){
if(err!=null) callback(err);
domains.forEach(function(domain){
dns.lookup(domain,function(err, address, family){
console.log(domain,'[',address,']');
console.log('reverse:',ip==address);
@gotomypc
gotomypc / Dockerfile
Created January 26, 2023 16:51 — forked from mthrok/Dockerfile
TorchAudio 0.10.2 minimum compilation example
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
ARG PYTHON_VERSION=3.9
ARG CU_VERSION=11.3
ARG PYTORCH_VERSION=1.10.2
ARG TORCHAUDIO_TAG=v0.10.2
RUN apt update && apt install -y -qq git curl && apt autoremove && apt autoclean
RUN git clone https://github.com/pytorch/audio.git
@gotomypc
gotomypc / download.cpp
Created December 25, 2022 03:44 — forked from ericdke/download.cpp
C++: Download a file using HTTP GET and store in in a std::string
/**
* HTTPDownloader.hpp
*
* A simple C++ wrapper for the libcurl easy API.
*
* Written by Uli Köhler (techoverflow.net)
* Published under CC0 1.0 Universal (public domain)
*/
#ifndef HTTPDOWNLOADER_HPP
#define HTTPDOWNLOADER_HPP
@gotomypc
gotomypc / tensorflow_serving_ubuntu_14.md
Created December 25, 2022 01:22 — forked from gvanhorn38/tensorflow_serving_ubuntu_14.md
TensorFlow Serving Ubuntu 14.04

Instructions for installing TensorFlow Serving on Ubuntu 14.04. I am following the instuctions from here.

Install Bazel

Installation instructions can be found here

If you have a previous version of bazel, and you are trying to do a fresh install then you should remove your old version of bazel. If you installed it through apt, then you can do sudo apt-get purge bazel. If you installed it from source, then you probably have a ~/bin directory with the bazel command, which you should delete, and you probably have a ~/.bazel directory that you should delete. Also check your ~/.bashrc file for any links to ~/.bazel.

  1. Install JDK 8 You'll need the add-apt-repository command, which you can get by doing sudo apt-get install software-properties-common

Tensorflow Serving Tutorial - 01 - Public Inception Model

In this tutorial:

  • Start with a blank Ubuntu
  • Install requirements
  • Download code & pre-tranied inception-v3 model from Google
  • Export the downloaded "checkpoint" format to a TF Graph that is servable with Tensorflow Model Serving
  • Query the server with images of a cat and a dog

General Notes

  • Compiling Tensorflow Serving from source (on docker with their official instructions) produces an internal gcc error (probably specific to tensorflow commit / gcc version used when writing this: tf serving commit: c1ec43508ee57a5d6269116aba82d2a16d383c8a)
@gotomypc
gotomypc / audio_effects_demo_directory.cpp
Created December 25, 2022 01:11 — forked from LittleWat/audio_effects_demo_directory.cpp
audio_effects_demo_directory.cpp
/*###############################################################################
#
# Copyright 2020 NVIDIA Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@gotomypc
gotomypc / install_nvidia_driver.md
Created December 25, 2022 01:11 — forked from LittleWat/install_nvidia_driver.md
How I fix this issue NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running

I had many driver installed I my virtual machine , so It was actually the reason why I was having the error.

To fix it I had first to remove all driver I have installed before using :

  • sudo apt-get purge nvidia-*
  • sudo apt-get update -sudo apt-get autoremove

After that I when a head and installed the latest version of it nvidia driver:

I did :