Skip to content

Instantly share code, notes, and snippets.

Index: lib/rubygems/defaults.rb
===================================================================
--- lib/rubygems/defaults.rb.orig 2016-12-15 17:48:03.958124553 +0000
+++ lib/rubygems/defaults.rb 2016-12-15 22:24:41.205037257 +0000
@@ -91,6 +91,7 @@
def self.default_path
path = []
+ path << '/tmp/rubygems/vendor/lib/2.3.0'
path << user_dir if user_home && File.exist?(user_home)
@twwlogin
twwlogin / gist:aa506249a7bc3ed8995b8d9084dd34aa
Created April 24, 2018 02:12
Ruby gem installation failing
# /usr/local/ruby24/bin/ruby -e 'puts $:'
/usr/local/ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib
/usr/local/ruby24p/lib/2.4.0
/usr/local/ruby24p/lib/2.4.0/x86_64-linux
/usr/local/ruby24p/lib
/usr/local/ruby24p/vendor/lib/2.4.0
/usr/local/ruby24p/vendor/lib/2.4.0/x86_64-linux
/usr/local/ruby24p/vendor/lib
/usr/local/ruby24/lib/ruby/2.4.0
/usr/local/ruby24/lib/ruby/2.4.0/x86_64-linux
$ /tmp/ruby244/bin/gem install --local -V --rdoc --ri --bindir=/tmp/ruby244p/bin \
--install-dir=/tmp/ruby244p loquacious-1.9.1.gem
...
$ find /tmp/ruby244p
/tmp/ruby244p
/tmp/ruby244p/build_info
/tmp/ruby244p/cache
/tmp/ruby244p/cache/loquacious-1.9.1.gem
/tmp/ruby244p/doc
/tmp/ruby244p/extensions
conf.CHECK_FUNCS_IN('inet_addr',
'nsl', mandatory=True, checklibc=True,
headers='sys/socket.h netinet/in.h arpa/inet.h netdb.h')
@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
@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}" |
$ 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:
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 =
# 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 =
# 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