This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### WAY with crictl | |
| #### TODO validate crictl with docker runtime !! | |
| # Get all pods of a specific node | |
| #kubectl get po --field-selector=spec.nodeName="fluffy-master" --all-namespaces | |
| kubectl get --all-namespaces po --field-selector=spec.nodeName=="$(hostname)" -o json | jq -r '.items[] | select(.status.hostIP!=.status.podIP) | "\(.metadata.name) \(.metadata.namespace)"' | |
| # Get the Pod ID of the Pod with crictl | |
| POD_ID=$(sudo crictl pods --name=nginx-6f858d4d45-vnszm --namespace=default -q --no-trunc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Desktop build | |
| MAKE="make -j 4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-" | |
| # C.H.I.P. build | |
| #MAKE="make" | |
| CDIR=$PWD | |
| LINUX=$CDIR/CHIP-linux | |
| WIFI=$CDIR/RTL8723BS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Automatically generated file; DO NOT EDIT. | |
| # Linux/arm 4.4.11 Kernel Configuration | |
| # | |
| CONFIG_ARM=y | |
| CONFIG_ARM_HAS_SG_CHAIN=y | |
| CONFIG_NEED_SG_DMA_LENGTH=y | |
| CONFIG_ARM_DMA_USE_IOMMU=y | |
| CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8 | |
| CONFIG_MIGHT_HAVE_PCI=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var server = java.lang.management.ManagementFactory.getPlatformMBeanServer(); | |
| var mb = java.lang.management.ManagementFactory.newPlatformMXBeanProxy( | |
| server, | |
| "com.sun.management:type=HotSpotDiagnostic", | |
| com.sun.management.HotSpotDiagnosticMXBean.class | |
| ); | |
| mb.getDiagnosticOptions(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ clang -g -Wall -O3 threaded_malloc.c -o threaded_malloc -pthread | |
| $ # ptmalloc2 | |
| $ /usr/bin/time -v ./threaded_malloc | |
| 100,000,000 allocations in 2439ms (41000410/s) | |
| 100,000,000 deallocations in 13101ms (7633005/s) | |
| 100,000,000 allocations in 14536ms (6879471/s) | |
| 100,000,000 deallocations in 13306ms (7515406/s) | |
| 100,000,000 allocations in 14947ms (6690305/s) | |
| 100,000,000 deallocations in 2424ms (41254125/s) | |
| Command being timed: "./threaded_malloc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| go test -bench=. -benchmem shuffle_test.go | |
| goos: linux | |
| goarch: amd64 | |
| BenchmarkIndex-4 100000000 12.5 ns/op 0 B/op 0 allocs/op | |
| BenchmarkAppend-4 1000000 1423 ns/op 661 B/op 0 allocs/op | |
| PASS | |
| ok command-line-arguments 2.707s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| coproc ZKLOCK { | |
| zk-flock -w 10 -x 81 -c $ZK_FLOCK_CONFIG $LOCK_NAME "bash -c 'echo Locked; read'" | |
| if (($? == 81)); then | |
| echo "LockBusy" | |
| else | |
| echo "Failed" | |
| fi | |
| } | |
| zk_stdin=${ZKLOCK[1]} | |
| read -u ${ZKLOCK[0]} zk_reply 2>/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| "strconv" | |
| luar "github.com/layeh/gopher-luar" | |
| lua "github.com/yuin/gopher-lua" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| c(){ | |
| local go_libs="-lm" go_flags="-g -Wall -include allheads.h -O0" | |
| local prompt="C > " | |
| local first_line="int main(int argc, const char *argv[]){" | |
| local end_line="}" | |
| local code prev_code line | |
| local HISTFILE="~/.c.hist" | |
| #while read -erp "C > " line; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| pigz_mv() { g="$1-$(date +%Y%m%d-%s).gz"; pigz -k "$1" && mv "$1".gz "$g" && truncate -s0 "$1"; } | |
| plog_pigz_mv() { | |
| local logs="$@" ts=$(date '+%Y%m%d-%s'); | |
| pigz -k $logs; | |
| for l in $logs; do | |
| mv ${l}.gz ${l}-${ts}.gz && truncate -s0 $l; | |
| done |
NewerOlder