Skip to content

Instantly share code, notes, and snippets.

View habibimustafa's full-sized avatar

Habibi Mustafa habibimustafa

View GitHub Profile
@habibimustafa
habibimustafa / androidtv-gapps.sh
Created December 6, 2018 03:50
Sideload Installing GApps for Android TV
#!/bin/bash
# raspberry pi android tv leanback gapps installtion script
# check this link for more version
# https://github.com/opengapps/arm/releases
TIMESTAMP="20171015"
VERSION="7.1"
PACKAGE="open_gapps-arm-$VERSION-tvstock-$TIMESTAMP.zip"
@habibimustafa
habibimustafa / gist:5a7b51a9b44872cb34f67e4416be57a6
Created January 15, 2019 07:02 — forked from plasticbrain/gist:3887245
PHP: mime types (array format)
<?php
$mime_types = array(
'.3dm' => 'x-world/x-3dmf',
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
'.aam' => 'application/x-authorware-map',
'.aas' => 'application/x-authorware-seg',
'.abc' => 'text/vnd.abc',
'.acgi' => 'text/html',
@habibimustafa
habibimustafa / primeFactor.js
Last active May 8, 2019 09:41
Javascript Find Prime Factor and The Largest
var divisor = 2;
var number = 210;
let primeFactor = [];
while (number > 1) {
if (number % divisor === 0) {
number /= divisor;
if (primeFactor.indexOf(divisor) === -1) {
primeFactor.push(divisor);
}
@habibimustafa
habibimustafa / Makefile
Last active July 18, 2019 06:15
Docker Portainer Installer
os ?= $(shell lsb_release -cs)
install-docker:;: '$(os)'
@apt-get update
@apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@apt-key fingerprint 0EBFCD88
@habibimustafa
habibimustafa / IndonesiaPhoneNumberRegex.txt
Created August 1, 2019 13:42
Regular Expression to Check Indonesian MobilePhone Provider
telkomsel.regex = ^(\\+62|\\+0|0|62)8(1[123]|52|53|21|22|23)[0-9]{5,9}$
simpati.regex = ^(\\+62|\\+0|0|62)8(1[123]|2[12])[0-9]{5,9}$
as.regex = ^(\\+62|\\+0|0|62)8(52|53|23)[0-9]{5,9}$
indosat.regex= ^(\\+62815|0815|62815|\\+0815|\\+62816|0816|62816|\\+0816|\\+62858|0858|62858|\\+0814|\\+62814|0814|62814|\\+0814)[0-9]{5,9}$
im3.regex = ^(\\+62855|0855|62855|\\+0855|\\+62856|0856|62856|\\+0856|\\+62857|0857|62857|\\+0857)[0-9]{5,9}$
@habibimustafa
habibimustafa / indonesia.sql
Created March 26, 2020 06:41
Indonesia Province and Cities Database
This file has been truncated, but you can view the full file.
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
@habibimustafa
habibimustafa / golang-tls.md
Created July 28, 2021 03:14 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@habibimustafa
habibimustafa / write-large-csv-concurrently.go
Last active January 20, 2022 08:11 — forked from carthegian/main.go
How to write large amount of data to CSV sequentially or concurrently
package main
import (
"encoding/csv"
"fmt"
"log"
"math/rand"
"os"
"strconv"
"sync"
@habibimustafa
habibimustafa / install-mariadb.sh
Created March 28, 2022 04:21 — forked from ihangoon/install-mariadb.sh
Install MariaDB 10.4 on WSL(ubuntu 18.04)
# 하기 페이지를 참고하여 사용 중인 Linux 버전에 맞는 것을 설치한다.
# https://downloads.mariadb.org/mariadb/repositories/#distro=Ubuntu&distro_release=bionic--ubuntu_bionic&mirror=hosting90&version=10.4
# ubuntu 18.04에서의 설치는 다음과 같다.
sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://suro.ubaya.ac.id/mariadb/repo/10.4/ubuntu bionic main'
sudo apt update
sudo apt install mariadb-server
@habibimustafa
habibimustafa / Vagrantfile
Created March 28, 2022 04:21 — forked from rjz/Vagrantfile
Vagrant with MariaDB provisioned (ansible)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.