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
$ curl -X PUT http://XXX.XXX.XXX.XXX:XXXX/ \ | |
-H 'Content-Type: application/json' \ | |
-d '{"prompt": "this movie was sucks!"}' | jq |
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
; ~/.config/nvtop/interface.ini | |
; Please do not edit this file. | |
; The file is automatically generated and modified by nvtop by pressing F12. | |
; If you wish to modify an option, use nvtop's setup window (F2) and follow up by saving the preference (F12). | |
[GeneralOption] | |
UseColor = true | |
UpdateInterval = 1000 | |
ShowInfoMessages = true | |
[HeaderOption] |
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
CONTAINER_ID=$(docker ps --format '{{.Names}}') | |
docker exec $CONTAINER_ID /usr/sbin/service ssh start |
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 { serve } from "https://deno.land/[email protected]/http/server.ts"; | |
const s = serve({ port: 8000 }); | |
console.log("http://localhost:8000/"); | |
for await (const req of s) { | |
req.respond({ body: "Hello World\n" }); | |
} |
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
// References: https://cloud.google.com/vision/docs/detecting-faces#vision_face_detection_gcs-drest | |
package main | |
import ( | |
vision "cloud.google.com/go/vision/apiv1" | |
"fmt" | |
"golang.org/x/net/context" | |
"google.golang.org/api/option" | |
pb "google.golang.org/genproto/googleapis/cloud/vision/v1" | |
"io" |
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
FROM ubuntu:18.04 | |
# Install dependencies | |
RUN apt-get update && \ | |
apt-get -y install apache2 | |
# Install apache and write hello world message | |
RUN echo 'Hello World!' > /var/www/html/index.html | |
# Configure apache |
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 google.auth | |
from google.cloud import bigquery | |
from google.cloud import bigquery_storage_v1beta1 | |
# Explicitly create a credentials object. This allows you to use the same | |
# credentials for both the BigQuery and BigQuery Storage clients, avoiding | |
# unnecessary API calls to fetch duplicate authentication tokens. | |
def bigquery_auth(project_id: str = 'edith-xxx') -> None: | |
logging.info('[AUTH] Create a credentials.') |
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
declare TARGET="ec2-XXXX.ap-northeast-2.compute.amazonaws.com" | |
readonly VERSION=$(date '+%y.%m.%d') # Today's yy.mm.dd ubuntu version style. | |
readonly IMAGE_NAME=edith/edith-XXXX | |
readonly ECR_REGISTRY=09960362XXXX.dkr.ecr.ap-northeast-2.amazonaws.com/edith/edith-XXXX | |
readonly AWS_OTP=$(aws ecr get-login-password --region ap-northeast-2) | |
# Build | |
docker build -t ${IMAGE_NAME} . |
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 | |
datas = [] | |
# Process KorQuAD's training data. | |
# Counts: 60,407 | |
for i in range(0, 1): | |
in_file = '/Users/likejazz/Desktop/korquad' | |
# in_file += '/korquad2.0_train_0' + str(i) + '.json' |
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 time | |
import redis | |
for i in range(10): | |
start_time = time.time() | |
try: | |
conn = redis.StrictRedis( | |
host='xxx', | |
port=6379, | |
db=0) |
NewerOlder