Skip to content

Instantly share code, notes, and snippets.

View hoangnd-monkey's full-sized avatar

Nguyễn Đức Hoàng hoangnd-monkey

  • HCMC, Việt nam
View GitHub Profile
@hoangnd-monkey
hoangnd-monkey / adbUsefulCommands.sh
Created August 31, 2023 09:41 — forked from aminone/adbUsefulCommands.sh
A collection of Android Debug Bridge (ADB) commands
# To get file
adb pull <PATH/TO/FILE/ON/DEVICE>
# To push file
adb push <PATH/TO/FILE> <PATH/TO/DESTINATION>
# To get wifi MAC address
adb shell cat /sys/class/net/wlan0/address
# To get IP Address
@hoangnd-monkey
hoangnd-monkey / docker-compose.yml
Last active August 10, 2023 11:35
Kafka Docker Composer Kraf Mode
version: '3.8'
networks:
shared:
name: unified-shared
services:
broker-01:
image: confluentinc/cp-kafka:${CF_VERSION}
hostname: broker-01
container_name: broker-01
restart: unless-stopped
@hoangnd-monkey
hoangnd-monkey / starship.toml
Last active June 6, 2023 15:36
Terminal Setting
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
# Replace the '❯' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character'
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
error_symbol = "✗"
@hoangnd-monkey
hoangnd-monkey / SpringAutoRefreshConfigurationProperties.java
Created September 6, 2021 10:20 — forked from kubamarchwicki/SpringAutoRefreshConfigurationProperties.java
Autorefreshable configuration in Spring. To reload run with `--application.config.location=file:/tmp/data.properties`
package com.example.properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
'use strict';
const fs = require('fs'),
http = require('http'),
LISTEN_HOSTNAME = '0.0.0.0',
LISTEN_PORT = 8080,
DUMP_FILE_PATH = 'dumpdata.txt',
# EditorConfig is awesome: http://EditorConfig.org
# https://github.com/jokeyrhyme/standard-editorconfig
# top-most EditorConfig file
root = true
# defaults
[*]
charset = utf-8
@hoangnd-monkey
hoangnd-monkey / example_ops_manual.md
Created August 29, 2019 08:33 — forked from benjaminballard/example_ops_manual.md
Example VoltDB Operations Manual

VoltDB Operations Manual

This is an example of a document that a VoltDB customer or partner might write to document specific processes and commands for common operations with VoltDB.

Hardware & OS

For our VoltDB cluster, use servers with the following specs:
(Note: this is only an example, but you should document the exact hardware used for the installation, and use identical hardware if nodes to the cluster).

Amazon EC2 Example:

In production, we use c3.2xlarge nodes with 8 hyperthreads, 15GB of RAM

@hoangnd-monkey
hoangnd-monkey / AgentRunner.java
Created June 28, 2019 07:11 — forked from xnike/AgentRunner.java
Simple snippet to show how to attach javaagent to running JVM process
import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;
public class AgentRunner {
/*
* This class shows how to attach hotswap-agent.jar to a running JVM process and overload classes using "extraClasspath=" property via Hotswapper plugin.
*
* Lets assume that:
* args[0] contains pid of running JVM process or a runner class name we want to attach agent to
@hoangnd-monkey
hoangnd-monkey / README.md
Created June 14, 2019 17:10 — forked from fahadysf/README.md
A multiprocess task broker which accepts and provides status reports for tasks using JSON REST API calls.

Multiprocess Task Broker with REST API

This gist shows and example or an asynchronous multiprocess task broker which can take job requests and report on running jobs via a minimal REST API.

Adapted from https://gist.github.com/nitaku/10d0662536f37a087e1b

All of the caveats from the original author still apply.