This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --gpus=all -p 127.0.0.1:9000:8080 us-docker.pkg.dev/colab-images/public/runtime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d --gpus all -v $(realpath ~/notebooks):/tf/notebooks -p 8888:8888 tensorflow/tensorflow:latest-gpu-jupyter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new Bucket | |
gsutil mb gs://[BUCKET] | |
# List files in bucket | |
gsutil ls gs://[BUCKET] | |
# Check bucket usage (du: disk usage) | |
gsutil du -sh gs://[BUCKET] | |
# Copy (upload) file to bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# สร้าง bucket | |
gsutil mb gs://[BUCKET] | |
# ลิสต์ files ใน bucket | |
gsutil ls gs://[BUCKET] | |
# ดูว่า bucket ขนาดเท่าไร (du: disk usage) | |
gsutil du -sh gs://[BUCKET] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from pyspark import SparkContext | |
from pyspark.streaming import StreamingContext | |
from pyspark.streaming.kafka import KafkaUtils | |
if __name__ == "__main__": | |
sc = SparkContext(appName="PythonStreamingDirectKafkaWordCount") | |
sc.setLogLevel("ERROR") | |
ssc = StreamingContext(sc, 2) | |
brokers, topic = sys.argv[1:] | |
kvs = KafkaUtils.createDirectStream(ssc, [topic],{"metadata.broker.list": brokers}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First sudo command | |
sudo whoami | |
# Update and upgrade | |
sudo apt update | |
sudo apt upgrade -y | |
# Utility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing WineHQ | |
``` | |
sudo dpkg --add-architecture i386 | |
wget https://dl.winehq.org/wine-builds/Release.key | |
sudo apt-key add Release.key | |
sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ | |
sudo apt-get update | |
sudo apt-get install --install-recommends winehq-stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
from airflow.models import DAG | |
from airflow.operators.bash_operator import BashOperator | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.utils.dates import days_ago | |
URL = "https://api.coindesk.com/v1/bpi/currentprice/SGD.json" | |
DATASET_ID = "demo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Code modified from https://cloud.google.com/dataflow/docs/samples/join-streaming-data-with-sql#expandable-3 | |
import datetime, json, os, random, time | |
# Set the `project` variable to a Google Cloud project ID. | |
project = 'GCP-PROJECT-ID' | |
BRANCH = ['LIM', 'BOG', 'SFO', 'LAX', 'PEK', 'ATL', 'CDG', 'AMS', | |
'HKG', 'ICN', 'FRA', 'MAD', 'SEA', 'LAS', 'SIN', 'BKK', 'DFW', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
""" | |
Development Version: Python 3.5.1 | |
Author: Benjamin Cordier | |
Description: Module For Performance | |
Assessment of Classification Task | |
License: BSD 3 Clause | |
-- |
NewerOlder