How to install K3s without built in traefik?
# source: https://www.suse.com/support/kb/doc/?id=000020082
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--no-deploy traefik" sh -s -
def quicksort(lst, sort='asc'): | |
#Use 'asc' for ascending sort | |
#Use 'dsc' for descending sort | |
if (len(lst) == 1): | |
return lst | |
elif (len(lst) == 2): | |
if sort == 'asc': | |
if lst[0] >lst[1]: | |
lst[0], lst[1] = lst[1], lst[0] | |
return lst |
- All about Docker - | |
Installing Docker on Ubuntu | |
https://docs.docker.com/engine/install/ubuntu/ | |
How to deploy a docker container with interactive bash? | |
$ docker run -d -t --hostname [Nama Hostnya / PCnya] --name [Name of the container] [docker container] | |
How to see deployed container? | |
$ docker container ls |
- All about Kubernetes - | |
You need to install docker, kubernete or minikube(only runs on local), and kubectl | |
Node is a machine (it can be a baremetal computer or a VM) | |
Pod is a container that contain a "docker container" | |
Creating pods | |
$ kubectl create -f [yaml file] | |
See running pods |
def kFold(list, totalFold): | |
# Pre-requisite check | |
if totalFold > len(list): | |
raise Exception("TotalFold can't be more than total element in the list") | |
# Variable initialization | |
fold = [] | |
current_element = 0 | |
element_per_fold = len(list) // totalFold | |
modulus_counter = len(list) % totalFold |
import pandas as pd | |
import re | |
import string | |
from tqdm import tqdm | |
from Sastrawi.Stemmer.StemmerFactory import StemmerFactory | |
class DataCleaning: | |
# Initialization | |
factory = StemmerFactory() | |
stemmer = factory.create_stemmer() |
# Membagi 'a' menjadi 'b' bagian | |
a = [1,2,3,4,5,6,7,8,9,10,11] | |
b = 3 | |
new_arr = [] | |
for i in range(b): | |
if i == 0: | |
new_arr.append(a[:(i+1)*(int(np.ceil(len(a)/b)))]) | |
else: |
IMAGE UPLOAD ON COMMENT FIELD |
How to install K3s without built in traefik?
# source: https://www.suse.com/support/kb/doc/?id=000020082
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--no-deploy traefik" sh -s -
// These are custom component, you can change it to your liking | |
import MainButton from '@/components/button/MainButton'; | |
import InputText from '@/components/input/InputText'; | |
import React, { useEffect, useState } from 'react'; | |
function Test() { | |
return ( | |
<div className="flex flex-col w-screen h-screen items-center justify-center"> | |
<div className="w-5/12 rounded-md p-3 border border-neutral-500/20 shadow-md bg-white"> | |
<Headers onChange={(data) => console.log(data)} /> |
# For compiling to c | |
python -m grpc_tools.protoc \ | |
-I./proto \ | |
--python_out=./py-script/rpc \ | |
--pyi_out=./py-script/rpc \ | |
--grpc_python_out=./py-script/rpc \ | |
./proto/*.proto | |
# For changing into relative import | |
sed -i 's/import \(\w\+\)_pb2 as \(\w\+\)__pb2/from . import \1_pb2 as \2__pb2/' \ | |
py-script/rpc/*_grpc.py |