Skip to content

Instantly share code, notes, and snippets.

View thesuhu's full-sized avatar
💭
No one run like a fox

The Suhu thesuhu

💭
No one run like a fox
View GitHub Profile
@thesuhu
thesuhu / how-to-build-and-install-latest-curl-version-on-centos.md
Last active May 8, 2024 13:50
How to Build and Install Latest cURL Version CentOS

How to Build and Install Latest cURL Version on CentOS

# Written by The Suhu (2021).

# Tested on CentOS 7 and CentOS 8

Previously I've written about How to Build and Install Latest cURL Version on Ubuntu. In this article in this article explain how to build and install latest cURL version on CentOS.

@thesuhu
thesuhu / how-to-build-and-install-latest-curl-version-on-ubuntu.md
Last active April 27, 2024 14:24
How to Build and Install Latest cURL Version on Ubuntu

How to Build and Install Latest cURL Version on Ubuntu

# Written by The Suhu (2021).

# Tested on Ubuntu 20.04 LTS

The default cURL installed on the operating system may not be the latest version. if you want the latest version, then you need to build from the source. Let's check the cURL version installed with the following command.

@thesuhu
thesuhu / generate-self-signed-certificate.sh
Created December 25, 2022 15:50
Generate Self SIgned Certificate With IP Address
#!/bin/sh
IP=$(echo $1 | egrep -o "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$")
if [ ! $IP ]
then
echo "Usage: generate-ip-cert.sh 127.0.0.1"
exit 1
fi
@thesuhu
thesuhu / how-to-solve-ng-build-error-TS7015.md
Last active December 8, 2023 11:28
How to Solve "ng build" Error TS7015: Element implicitly has an ‘any’ type because index expression is not of type 'number'

How to Solve "ng build" Error TS7015: Element implicitly has an ‘any’ type because index expression is not of type 'number'

Today I got error message when running "ng build" on my project using Angular version 12.0.1. The error message is Error TS7015: Element implicitly has an ‘any’ type because index expression is not of type ‘number’.

To solve this problem, edit the file tsconfig.json (TypeScript compiler configuration) and add the following configuration to the compilerOptions key:

"compilerOptions": {

 "suppressImplicitAnyIndexErrors": true,
@thesuhu
thesuhu / keybase.md
Created July 2, 2023 09:02
The Suhu KeyBase

Keybase proof

I hereby claim:

  • I am thesuhu on github.
  • I am thesuhu (https://keybase.io/thesuhu) on keybase.
  • I have a public key ASCLft-tu6mhjFiUQei6nkEk3X82uLNQJ0OXOjd2JI1ytAo

To claim this, I am signing this object:

@thesuhu
thesuhu / msyql_load_local_infile.sql
Created May 29, 2023 14:45
MySQL - Import CSV File with LOCAL INFILE
LOAD DATA LOCAL INFILE 'g:\\temp\\file1.csv'
INTO TABLE mytable
FIELDS TERMINATED BY ';' -- Pemisah kolom dalam file CSV
ENCLOSED BY '"' -- Karakter penutup untuk kolom yang diapit oleh tanda kutip ("")
LINES TERMINATED BY '\r\n' -- Karakter akhir baris dalam file CSV
IGNORE 1 LINES -- Mengabaikan baris header pertama dalam file CSV (jika ada)
-- Kolom target dalam tabel
(COL1, COL2, COL3, COL4, COL5);
@thesuhu
thesuhu / get_utc.sh
Last active May 1, 2023 17:07
Get UTC Time From Internet
#!/bin/bash
# get UTC date
date -u -d "$(curl -sI google.com | grep -i '^date:' | cut -d' ' -f2-)"
# get local date from UTC
date -d "$(curl -sI google.com| grep -i '^date:'|cut -d' ' -f2-)"
# sync local date from UTC
sudo date -s "$(date -d "$(curl -sI google.com | grep -i '^date:' | cut -d' ' -f2-)" '+%Y-%m-%d %H:%M:%S')"
@thesuhu
thesuhu / get_country_flag.py
Created May 1, 2023 14:56
Get Country Flag Emoji
def get_country_flag(country_code):
OFFSET = 127397
codepoints = tuple(ord(char) + OFFSET for char in country_code.upper())
return chr(codepoints[0]) + chr(codepoints[1])
# usage get_country_flag("ID")
@thesuhu
thesuhu / .dockerignore
Created December 26, 2022 17:31
Angular .dockerignore file
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
@thesuhu
thesuhu / install-mysql-on-ubuntu.md
Last active September 1, 2022 08:08
How to Install MySQL on Ubuntu

How to Install MySQL on Ubuntu

This tutorial has been tested on Ubuntu 20.04 LTS.

Install latest version

Before install, don't forget to update package index in your server.

sudo apt update