Skip to content

Instantly share code, notes, and snippets.

View iambudi's full-sized avatar

Budi iambudi

  • Indonesia
View GitHub Profile
@iambudi
iambudi / logging.go
Created December 2, 2022 11:29 — forked from panta/logging.go
zerolog with file log rotation (lumberjack) and console output
package logging
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"gopkg.in/natefinch/lumberjack.v2"
"os"
"path"
"io"
)
@iambudi
iambudi / mysql8-m1-reset-password.md
Last active May 13, 2022 12:27
Reset mysql root password on Mac M1
  1. Make sure mysql service stopped mysql.server stop or brew services stop mysql
  2. Create a text file somewhere ex. /Users/iambudi/reset_pass.txt and write this one liner sql to the file:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'ReplaceNewPassHere';
  1. Run mysql service mysqld --init-file=/Users/iambudi/reset_pass.txt
  2. Connect to mysql using the new password

When things goes okay, delete the reset_pass.txt, stop and start mysql again.

@iambudi
iambudi / gist:a29be7123dfd50439c98f71a07e4e7dc
Created April 9, 2022 05:30 — forked from anikitenko/gist:b41206a49727b83a530142c76b1cb82d
[Golang] Convert size in bytes to Bytes, Kilobytes, Megabytes, GB and TB
package main
import (
"fmt"
"math"
"strconv"
)
var (
sizeInMB float64 = 999 // This is in megabytes
@iambudi
iambudi / go-mac-m1.md
Last active January 22, 2022 16:02
Fresh install golang on zsh with brew on Mac M1

Should we setup go environment var manually? Read this

Installation

  1. Install golang using homebrew brew install go
  2. Create go folder. I prefer to hide it using dot. mkdir -p $HOME/.go/{bin,src,pkg}

Configure ZSH

@iambudi
iambudi / Hadoop_install_osx.md
Last active April 7, 2024 12:23 — forked from viecode09/Hadoop_install_osx.md
This is how to install hadoop on Mac OS

STEP 1: First Install HomeBrew, download it from http://brew.sh

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

STEP 2: Install Hadoop

$ brew search hadoop
$ brew install hadoop
@iambudi
iambudi / server.dart
Created February 23, 2019 02:49
Jaguar Dart with Hot Reload
import 'package:jaguar/jaguar.dart';
import 'package:jaguar_hotreload/jaguar_hotreload.dart';
import 'package:jaguar_reflect/jaguar_reflect.dart';
import 'dart:io';
import 'dart:isolate';
main() async {
final reloader = new HotReloader(
debounceInterval: const Duration(seconds: 2)
);