Objetivo: Convertir tu HP ProBook 450 G5 en un servidor casero 24/7 ejecutando n8n + Ollama, accesible desde cualquier lugar mediante Cloudflare Tunnel.
Tiempo estimado: 2-3 horas
Nivel: Intermedio (con experiencia en Linux)
Objetivo: Convertir tu HP ProBook 450 G5 en un servidor casero 24/7 ejecutando n8n + Ollama, accesible desde cualquier lugar mediante Cloudflare Tunnel.
Tiempo estimado: 2-3 horas
Nivel: Intermedio (con experiencia en Linux)
| //gcloud functions deploy processData --runtime nodejs10 --trigger-resource mysandoxbucket --trigger-event google.storage.object.finalize --project sandbox-project | |
| //set the vars | |
| const datasetId = 'openspace2020'; | |
| const tableId = 'imageData'; | |
| //load the dependences | |
| const {BigQuery} = require('@google-cloud/bigquery'); | |
| const bigquery = new BigQuery(); | |
| const vision = require('@google-cloud/vision'); | |
| const client = new vision.ImageAnnotatorClient(); |
| //gcloud functions deploy getData --runtime nodejs12 --trigger-resource mysandoxbucket --trigger-event google.storage.object.finalize --project my-sandbox-project | |
| exports.getData = async (file, context) => { | |
| //set the vars | |
| const bucketName = "mysandoxbucket"; | |
| //load the dependences | |
| const vision = require('@google-cloud/vision'); | |
| console.log(`Data for ${file.name}:`); | |
| //Ask for labels of image |
| let count = 0; | |
| exports.helloWorld = (req, res) => { | |
| count++; | |
| if(count<5){ | |
| res.status(500).json({"error": "System error"}); | |
| }else{ | |
| res.status(200).json({"llamada": count}); | |
| } | |
| }; |
| { | |
| "name": "encode-md5", | |
| "version": "0.0.1", | |
| "dependencies": { | |
| "md5": "^2.3.0" | |
| } | |
| } |
| - getCurrentTime: | |
| call: http.get | |
| args: | |
| url: http://worldtimeapi.org/api/timezone/Europe/Madrid | |
| result: CurrentDateTime | |
| - readWikipedia: | |
| call: http.get | |
| args: | |
| url: https://en.wikipedia.org/w/api.php | |
| query: |
| FROM docker:19.03.11 as static-docker-source | |
| FROM debian:buster | |
| ARG CLOUD_SDK_VERSION=299.0.0 | |
| ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION | |
| ENV CLOUDSDK_PYTHON=python3 | |
| ENV PATH "$PATH:/opt/google-cloud-sdk/bin/" | |
| COPY --from=static-docker-source /usr/local/bin/docker /usr/local/bin/docker | |
| RUN apt-get -qqy update && apt-get install -qqy \ | |
| curl \ |
| <script src="https://unpkg.com/@tensorflow/tfjs"></script> | |
| <script src="https://unpkg.com/@tensorflow/tfjs-automl"></script> | |
| <img id="daisy" crossorigin="anonymous" src="/hattori.jpeg"> | |
| <script> | |
| async function run() { | |
| const model = await tf.automl.loadImageClassification('model.json'); | |
| const image = document.getElementById('daisy'); | |
| const predictions = await model.classify(image); | |
| console.log(predictions); | |
| // Show the resulting object on the page. |
| FROM gcr.io/automl-vision-ondevice/gcloud-container-1.12.0:latest | |
| RUN mkdir -p /tmp/mounted_model/0001/ | |
| COPY saved_model.pb /tmp/mounted_model/0001/ |
| SELECT count(repo_name) as numberOfRepos, lang_data.name | |
| FROM `bigquery-public-data.github_repos.languages`, UNNEST(language) AS lang_data | |
| WHERE lang_data.name IN ("JavaScript","Java","Python","Ruby","PHP","C","Go") AND | |
| repo_name IN ( | |
| SELECT repo_name | |
| FROM `bigquery-public-data.github_repos.sample_repos` | |
| WHERE watch_count>10 | |
| ORDER BY watch_count | |
| ) | |
| GROUP BY lang_data.name |