Skip to content

Instantly share code, notes, and snippets.

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

Teocci teocci

👨‍💻
Coding
View GitHub Profile
#!/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>

How to install Node.js 19 on Ubuntu 20.04 LTS

First and foremost, it’s always good to make sure your system is up date to date, rebooting it if necessary:

sudo apt update
sudo apt upgrade

We expects curl to already be installed as well:

@teocci
teocci / how-to-ssh-into-windows.md
Created October 13, 2022 08:07
How to SSH into Windows 10 or 11?

How to SSH into Windows 10 or 11?

The latest builds of Windows 10 and Windows 11 include a build-in SSH server and client that are based on OpenSSH. This means now you can remotely connect to Windows 10/11 or Windows Server 2019 using any SSH client, like Linux distros. Let's see how to configure OpenSSH on Windows 10 and Windows 11, and connect to it using Putty or any other SSH client.

OpenSSH is an open-source, cross-platform version of Secure Shell (SSH) that is used by Linux users for a long time. This project is currently ported to Windows and can be used as an SSH server on almost any version of Windows. In the latest versions of Windows Server 2022/2019 and Windows 11, OpenSSH is built-in to the operating system image.

@teocci
teocci / adb-commands.md
Last active November 28, 2022 15:45
adb useful commands list
## Delete files
adb devices
List of devices attached
21344ca0530c7ece        device

adb -s 21344ca0530c7ece  shell 
cd /sdcard/Telegram/Telegram\ Video/
touch -mt 202209010000 end_marker