Skip to content

Instantly share code, notes, and snippets.

View liusheng's full-sized avatar

Liu sheng liusheng

  • China Xi'an
View GitHub Profile
@liusheng
liusheng / build-ubuntu18.04-aarch64-image.sh
Last active March 19, 2020 07:19
build-ubuntu18.04-aarch64-image
apt-get install -y debootstrap gdisk dosfstools
export DIB_RELEASE=bionic
export DIB_CHECKSUM=1
export DIB_SHOW_IMAGE_USAGE=1
export DIB_APT_LOCAL_CACHE=0
export DIB_DISABLE_APT_CLEANUP=1
export DIB_DEV_USER_AUTHORIZED_KEYS=/root/zuul-key/id_rsa.pub
export DIB_DEV_USER_USERNAME=zuul
export DIB_DEV_USER_PWDLESS_SUDO=yes
export DIB_DEBIAN_COMPONENTS='main,universe'
@liusheng
liusheng / cross-build-grpc-java.sh
Last active November 20, 2019 07:55
cross build protobuf
#!/bin/bash
set -eu -o pipefail
apt-get update
apt-get install -y wget autoconf automake libtool g++-aarch64-linux-gnu g++ make
apt-get install software-properties-common -y
add-apt-repository ppa:openjdk-r/ppa -y
apt-get update
apt install openjdk-8-jdk -y
@liusheng
liusheng / build_protoc-gen-grpc-java_aarch64.sh
Last active November 18, 2019 06:48
Build protoc-gen-grpc-java_aarch64
#!/bin/bash
set -ex
sudo apt-get install -y openjdk-11-jdk autoconf automake libtool unzip
cdir=$(cd $(dirname -- "$0") && pwd)
git clone https://github.com/google/protobuf.git
pushd protobuf
git checkout v3.5.1.1
./autogen.sh && ./configure --prefix=${cdir}/protobuf-3.5.1/ && make clean install
@liusheng
liusheng / build_kudu_ubuntu_18.04_aarch64.sh
Last active December 19, 2019 08:11
builds kudu on ubuntu of aarch64 platform
#!/bin/bash -ex
# print g++ version
gcc --version
g++ --version
apt-get -y install autoconf automake curl flex gdb git \
libsasl2-dev libsasl2-modules libsasl2-modules-gssapi-mit libssl-dev libtool \
lsb-release make ntp openjdk-8-jdk openssl patch pkg-config python rsync unzip vim-common cmake
@liusheng
liusheng / fix-netty-tcnative-aarch64.patch
Last active October 14, 2019 07:58
Install netty native library
diff --git a/pom.xml b/pom.xml
index ef7eec2..e4dc6e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -369,7 +369,7 @@
<goal>run</goal>
</goals>
<configuration>
- <target if="${linkStatic}">
+ <target>
@liusheng
liusheng / make-protoc-2.5.0-statically-linked.sh
Last active August 18, 2024 07:04
protobuf 2.5.0 ARM64 support
apt-get update && apt-get install -y make cmake gcc g++ patch
curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz | tar zx -C /opt/
cd /opt/protobuf-2.5.0
curl -L -O https://gist.githubusercontent.com/liusheng/64aee1b27de037f8b9ccf1873b82c413/raw/118c2fce733a9a62a03281753572a45b6efb8639/protobuf-2.5.0-arm64.patch
patch -p1 < protobuf-2.5.0-arm64.patch
./configure --disable-shared
make
ls -l src/protoc
@liusheng
liusheng / fix_leveldbjni_arm64.sh
Last active August 7, 2019 08:17
leveldbjni issue on ARM64 server
# Building leveldb
wget http://repository.timesys.com/buildsources/s/snappy/snappy-1.0.5/snappy-1.0.5.tar.gz
tar -xvf snappy-1.0.5.tar.gz -C /opt/
git clone http://github.com/huangtianhua/leveldbjni /opt/leveldbjni
git clone http://github.com/huangtianhua/leveldb /opt/leveldb
export SNAPPY_HOME=/opt/snappy-1.0.5
export LEVELDBJNI_HOME=/opt/leveldbjni
export LEVELDB_HOME=/opt/leveldb
cd ${SNAPPY_HOME}
@liusheng
liusheng / Dockerfile
Last active July 22, 2022 23:58
Fix Hadoop Installation aarch64
FROM ubuntu:bionic
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
######
# Install common dependencies from packages. Versions here are either
# sufficient or irrelevant.
#
# WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default
# Ubuntu Java. See Java section below!
@liusheng
liusheng / sed_notes.sh
Created January 28, 2019 02:53
sed commands notes
# replace specific word with another word following rows of another specific word
sed -i '/OS::Neutron::Router/,+5s|aaa|bbb|' path/to/file
#similar
sed -i '/OS::Neutron::Router/,+5d' path/to/file
sed '/OS::Neutron::Router/,+5p' path/to/file
@liusheng
liusheng / deploy-openshift-origin-fusioncloud.sh
Last active June 4, 2019 09:11
How to deployment openshift origin on fusioncloud
# step1:在跳板机(执行ansible工具的机器上)clone openshift的ansible部署工具,并应用fusioncloud 规避patch:
git clone http://github.com/huaweicloud/openshift-ansible
cd openshift-ansible
git config --global user.email '[email protected]'
git config --global user.name 'openlab'
git fetch origin refs/pull/12/head:pr12
git cherry-pick pr12