Skip to content

Instantly share code, notes, and snippets.

View LiShuMing's full-sized avatar

shuming.li LiShuMing

  • StarRocks
  • HangZhou
View GitHub Profile
@apangin
apangin / HotSpot JVM intrinsics
Last active July 20, 2024 10:43
HotSpot JVM intrinsics
_hashCode java/lang/Object.hashCode()I
_getClass java/lang/Object.getClass()Ljava/lang/Class;
_clone java/lang/Object.clone()Ljava/lang/Object;
_dabs java/lang/Math.abs(D)D
_dsin java/lang/Math.sin(D)D
_dcos java/lang/Math.cos(D)D
_dtan java/lang/Math.tan(D)D
_datan2 java/lang/Math.atan2(DD)D
_dsqrt java/lang/Math.sqrt(D)D
_dlog java/lang/Math.log(D)D
@seanorama
seanorama / add_host.sh
Last active December 6, 2022 13:51
ambari api
host_new=ip-10-0-0-162.ec2.internal
curl -u admin:admin -i -H X-Requested-By:API -X POST http://${ambari_server}:8080/api/v1/clusters/${cluster_name}/hosts/${host_new}
curl -u admin:admin -i -H X-Requested-By:API -X GET http://${ambari_server}:8080/api/v1/clusters/${cluster_name}/hosts/${host_new}
worker_services="NODEMANAGER JOURNALNODE HDFS_CLIENT DATANODE FLUME_HANDLER METRICS_MONITOR"
for service in ${worker_services}; do
curl -u admin:admin -i -H X-Requested-By:API -X POST http://${ambari_server}:8080/api/v1/clusters/${cluster_name}/hosts/${host_new}/host_components/${service}
done
@ashrithr
ashrithr / kerberos_setup.md
Last active July 20, 2024 20:06
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

@bancek
bancek / mac-thrift-build.sh
Last active September 16, 2022 20:44
Build thrift generator for Mac OS X
brew install bison
brew unlink bison
brew link bison --force
git clone https://github.com/koofr/thrift.git
cd thrift
git checkout 5df24f7afb05fe25352f1fe5fff0206eb0103a3d
./bootstrap.sh
./configure --without-cpp --without-qt4 --without-c_glib --without-csharp --without-java --without-erlang --without-python --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go --without-d --without-openssl --without-nodejs --without-lua
make
make install

Mac OSX

LZO

brew install lzop lzo

Hadoop

  • Compile Hadoop LZO library:
@vitaLee
vitaLee / compact_expand_css_command.py
Created June 3, 2012 13:26
SublimeText command for compacting/expanding CSS rules
import sublime
import sublime_plugin
import re
class CompactExpandCssCommand(sublime_plugin.TextCommand):
def run(self, edit, action='compact'):
rule_starts = self.view.find_all('\{')
rule_ends = self.view.find_all('\}')
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@yujikosuga
yujikosuga / otool.txt
Created December 22, 2011 01:58
otool: objdump provided for Mac
otool: at least one file must be specified
Usage: otool [-fahlLDtdorSTMRIHvVcXm] <object file> ...
-f print the fat headers
-a print the archive header
-h print the mach header
-l print the load commands
-L print shared libraries used
-D print shared library id name
-t print the text section (disassemble with -v)
-p <routine name> start dissassemble from routine name