Skip to content

Instantly share code, notes, and snippets.

View teocci's full-sized avatar
👨‍💻
Coding

Teocci teocci

👨‍💻
Coding
View GitHub Profile
import java.util.ArrayList;
import java.util.List;
import java.util.stream.LongStream;
public class ObjectUpdateExample {
public static <T> void printArray(List<T> list) {
printArray(list.toArray());
}
(function (global) {
"use strict";
var Typed = function (element, options) {
this.el = document.querySelector(element);
this.options = Object.assign({}, Typed.DEFAULTS, options);
this.isInput = this.el.tagName.toLowerCase() === "input";
this.attr = this.options.attr;
this.showCursor = !this.isInput && this.options.showCursor;
this.elContent = this.attr ? this.el.getAttribute(this.attr) : this.el.textContent;
sudo rmmod e1000
sudo rmmod e1000e
sudo rmmod igb
sudo modprobe e1000
sudo modprobe e1000e
sudo modprobe igb
sudo dhclient ens37
#!/bin/sh
set -e
# Docker CE for Linux installation script
#
# See https://docs.docker.com/engine/install/ for the installation steps.
#
# This script is meant for quick & easy install via:
# $ curl -fsSL https://get.docker.com -o get-docker.sh
# $ sh get-docker.sh
#

Introduction

Docker is an application that simplifies the process of managing application processes in containers. Containers let you run your applications in resource-isolated processes. They’re similar to virtual machines, but containers are more portable, more resource-friendly, and more dependent on the host operating system.

For a detailed introduction to the different components of a Docker container, check out The Docker Ecosystem: An Introduction to Common Components.

Prerequisites

To follow this tutorial, you will need the following:

One Ubuntu 20.04 server set up by following the Ubuntu 20.04 initial server setup guide, including a sudo non-root user and a firewall.

@teocci
teocci / wait-groups.go
Created March 5, 2023 16:13
Playing with WaitGroup in nested goroutines
package main
import (
"crypto/rand"
"fmt"
"math/big"
"os"
"sync"
"time"
)

TODO List

  1. stats : {}

  2. orderDTOList -> history,

  3. chagne user stationList result format

    • 192.168.100.58:9090/api/v1/stations/kuser last 3
    • 192.168.100.58:9090/api/v1/station/4 all
  4. Add TODOS

    • ADMIN does not have stations
  • Remove registration of 3 default stations at the registration

Setup system.d service

sudo nano /lib/systemd/system/kogas-api.service

Add the service code below.

[Unit]
Description=Kogas JAVA API
@teocci
teocci / Dockerfile
Last active November 16, 2022 08:25
Basic configuration of docker for go and mariadb
# syntax=docker/dockerfile:1
FROM golang:alpine AS builder
RUN mkdir -p /go/src/app
WORKDIR /go/src/app
COPY . .
ENV CGO_ENABLED=0

Why need to revoke object url after creating obj URL Blob or other objects?

As we use File, Blob other other media related objects to display them in web page. Generally [createObjectURL][1] is used to fulfill this task. Indeed this is very useful as it generated DOMstring containing a url to represent Object.

The lifetime of the URL is attached to the document in the window, hence until the window is closed or redirected to any other route the URL still accessible.

<template>
    <img :src=blobURL alt="">
</template>