Skip to content

Instantly share code, notes, and snippets.

@twwlogin
twwlogin / gist:15ddb03ca987492562a3e3654e572e28
Created July 11, 2024 03:06
Controller failure on ZFS pool
pool: tww
state: UNAVAIL
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Wed Jul 10 07:09:46 2024
1.03T scanned out of 13.6T at 15.2M/s, 240h24m to go
14.0G resilvered, 7.56% done
config:
Index: node.gyp
===================================================================
--- node.gyp.orig 2023-06-12 04:07:27.000000000 +0000
+++ node.gyp 2023-06-12 13:51:16.639579268 +0000
@@ -1245,6 +1245,9 @@
'HAVE_INSPECTOR=0',
]
}],
+ ['OS=="linux"', {
+ 'libraries': ['-lrt'],
cd /opt/src/latest/devel/llvm-15.0.7/src/01-1/BUILD/flang-15.0.7.src/redhat-linux-build/lib/Frontend && /usr/bin/g++ -DFLANG_LITTLE_ENDIAN=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/src/latest/devel/llvm-15.0.7/src/01-1/BUILD/flang-15.0.7.src/include -I/opt/src/latest/devel/llvm-15.0.7/src/01-1/BUILD/flang-15.0.7.src/redhat-linux-build/include -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimiz
# /usr/sbin/lspv
hdisk0 00f9dc79dc408ae8 rootvg active
hdisk1 00f9dc79389c7aac None
# sg_vpd /dev/sdc
Supported VPD pages VPD page:
Supported VPD pages [sv]
Unit serial number [sn]
Device identification [di]
Extended inquiry data [ei]
Block limits (SBC) [bl]
Logical block provisioning (SBC) [lbpv]
# sg_vpd --page=sn /dev/sdc
# multipath -v4 -ll 2>&1 | egrep 'sd.: serial'
Aug 24 16:00:01 | sda: serial = 00d4e61f3aa6f0ca26002b133720844a
Aug 24 16:00:01 | sdc: serial =
Aug 24 16:00:01 | sdd: serial =
Aug 24 16:00:01 | sdm: serial =
Aug 24 16:00:01 | sdn: serial =
Aug 24 16:00:01 | sdo: serial =
Aug 24 16:00:01 | sdp: serial =
Aug 24 16:00:01 | sdq: serial =
Aug 24 16:00:01 | sdr: serial =
root@touya:/etc# multipath -v4 -ll 2>&1 | egrep 'sd.: serial'
Aug 23 23:18:45 | sda: serial = 00d4e61f3aa6f0ca26002b133720844a
Aug 23 23:18:45 | sdc: serial =
Aug 23 23:18:45 | sdd: serial =
Aug 23 23:18:45 | sdm: serial =
Aug 23 23:18:45 | sdn: serial =
Aug 23 23:18:45 | sdo: serial =
Aug 23 23:18:45 | sdp: serial =
Aug 23 23:18:45 | sdq: serial =
Aug 23 23:18:45 | sdr: serial =
$ aCC -DHAVE_CONFIG_H -I. -I./src -D_REENTRANT -D_THREAD_SAFE \
-I./tweetnacl/contrib/randombytes -I./tweetnacl/src -AA -z +O2 \
+Ofltacc +Olit=all +Oentrysched +Odataprefetch +Onolimit \
-c src/stream_engine.cpp -DPIC -o src/.libs/libzmq_la-stream_engine.o
"/opt/aCC/include_std/utility", line 103: error #2144: a value of type
"const char *" cannot be used to initialize an entity of type
"char [13]"
: first (__x), second (__y) { }
^
detected during:
@twwlogin
twwlogin / gist:f44c761ebdc9add6898e010ee4c43801
Created January 29, 2019 22:10
Register correct snapshot
diff --git a/create-ami.sh b/create-ami.sh
index 63349ca..05b614a 100755
--- a/create-ami.sh
+++ b/create-ami.sh
@@ -245,6 +276,7 @@ create_ami() {
-O "${AWS_ACCESS_KEY_ID}" \
-W "${AWS_SECRET_ACCESS_KEY}" \
--region ${AWS_REGION} 2>/dev/null |
+ grep "${_VOL}" |
grep "completed.*${_IMGNAME}" |
@twwlogin
twwlogin / gist:f483aca706376f08f799db7a61335979
Created January 29, 2019 22:08
Wait for volume to be converted in AWS
diff --git a/create-ami.sh b/create-ami.sh
index 63349ca..05b614a 100755
--- a/create-ami.sh
+++ b/create-ami.sh
@@ -182,6 +191,19 @@ volume_ids() {
python2.7 -c 'from __future__ import print_function;import sys,json; [print(task["ImportVolume"]["Volume"]["Id"]) if "Id" in task["ImportVolume"]["Volume"] else None for task in json.load(sys.stdin)["ConversionTasks"]]'
}
+volume_state() {
+ local _VOL=$1