Skip to content

Instantly share code, notes, and snippets.

View rcmorano's full-sized avatar
🏠
Working from home

Roberto C. Morano rcmorano

🏠
Working from home
View GitHub Profile
@rcmorano
rcmorano / gist:f4bcd5033376cd40ab544139262e6680
Created December 18, 2019 15:35
jormungandr-same-fragment_id-in-multiple-blocks
root@5bafa702cbe1:/data# jormungandr-get-txs-sent-from-local | jq '.fragment_id="d533cc12c2053833a28b490c97e349546404c7ab5d1345f9b5a5aee744967730"' | jq '.status.InABlock.block="1edcf1b0315d0106ddf16c5aeb4341da3386e01997fb125f8364c2d6c6da6ef0"'
{
"fragment_id": "d533cc12c2053833a28b490c97e349546404c7ab5d1345f9b5a5aee744967730",
"last_updated_at": "2019-12-18T10:42:19.253812841+00:00",
"received_at": "2019-12-18T10:29:04.245659185+00:00",
"received_from": "Rest",
"status": {
"InABlock": {
"block": "1edcf1b0315d0106ddf16c5aeb4341da3386e01997fb125f8364c2d6c6da6ef0",
"date": "4.26517"
@rcmorano
rcmorano / gist:18200b93b6726390cb536ca86e6fe4e9
Created December 14, 2019 15:16
cardano-wallet-master-at-6c6d1dca04fe327a1e05b9d2028f33bcaa6f4993
root@01d95db1d7d4:/data# cardano-wallet serve --genesis-block-hash 8e4d2a343f3dcf9330ad9035b3e8d168e6728904262f2c434a4f8f934ec7b676 --node-port 8443
[cardano-wallet:Info:4] [2019-12-14 15:13:31.93 UTC] Running as v2019.12.13 (git revision: 6c6d1dca04fe327a1e05b9d2028f33bcaa6f4993)
[cardano-wallet:Info:4] [2019-12-14 15:13:31.93 UTC] Wallet backend server starting...
[cardano-wallet:Info:4] [2019-12-14 15:13:31.93 UTC] Node is Jörmungandr on testnet
[cardano-wallet.daedalus-ipc:Info:17] [2019-12-14 15:13:31.93 UTC] Daedalus IPC is not enabled.
[cardano-wallet:Info:18] [2019-12-14 15:13:31.94 UTC] Waiting for Jörmungandr to be ready on tcp/8443
[cardano-wallet:Info:18] [2019-12-14 15:13:31.94 UTC] Jörmungandr is ready.
[cardano-wallet:Notice:18] [2019-12-14 15:13:33.12 UTC] 5 migrations were applied to the database.
[cardano-wallet:Info:18] [2019-12-14 15:13:33.12 UTC] Wallet backend server listening on 127.0.0.1:8090
[cardano-wallet.stake-pools:Info:24] [2019-12-14 15:13:33.13 UTC] Start monitoring stake pools

Keybase proof

I hereby claim:

  • I am rcmorano on github.
  • I am rcmorano (https://keybase.io/rcmorano) on keybase.
  • I have a public key ASBwO18twnFxYa7j8rn56PLF7YiUxuPbxzJVMdidmXEnnQo

To claim this, I am signing this object:

@rcmorano
rcmorano / gce-nic-routing.sh
Created April 12, 2018 16:22
Snippet for configuring various Google Compute Engine network interfaces as described in official doc: https://cloud.google.com/vpc/docs/create-use-multiple-interfaces#configuring_policy_routing
#!/bin/bash
#
# License and Author
#
# Author:: Roberto C. Morano (<[email protected]>)
#
# Copyright:: 2018, Roberto C. Morano (<[email protected]>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@rcmorano
rcmorano / docker-registry-expect-scripted-login
Created March 29, 2017 09:52
expect script to interact with "docker login"
#!/bin/bash
#DOCKER_REGISTRY_URI=_DOCKER_REGISTRY_URI_
#DOCKER_REGISTRY_USER=_DOCKER_REGISTRY_USER_
#DOCKER_REGISTRY_PASS=_DOCKER_REGISTRY_PASS_
expect <<EOF
spawn docker login -u $DOCKER_REGISTRY_USER $DOCKER_REGISTRY_URI
while (1) {
expect {
@rcmorano
rcmorano / docker_bash_aliases
Created March 6, 2014 18:43
docker bash aliases
alias docker-container-most-recent='docker ps| grep -v ^CONTAINER | head -n1 | awk "{print \$1}"'
alias docker-container-diff-most-recent='LAST_CONTAINER=$(docker-container-most-recent); if [ ! -z "$LAST_CONTAINER" ]; then docker diff $LAST_CONTAINER; else echo "There are no running containers!"; fi'
alias docker-container-inspect-most-recent='LAST_CONTAINER=$(docker-container-most-recent); if [ ! -z "$LAST_CONTAINER" ]; then docker inspect $LAST_CONTAINER; else echo "There are no running containers!"; fi'
alias docker-container-remove-all='docker ps -a | grep -v ^CONTAINER|awk "{print \$1}" | xargs -I % sh -c "docker kill %; docker rm %"'
alias docker-container-remove-all-non-running='docker ps -a | grep -v ^CONTAINER | grep Exit | awk "{print \$1}" | xargs -I % sh -c "docker kill %; docker rm %"'
alias docker-image-remove-all='docker-container-remove-all; docker images -a | grep -v ^REPOSITORY | awk "{print \$3}" | xargs docker rmi'
alias docker-image-remove-orphan='docker images | grep "<none>" | awk "{pri
@rcmorano
rcmorano / docker-cheat-sheet.md
Last active July 28, 2022 13:23
my miscelaneous docker cheat sheet

rcmorano docker cheat sheet

Remove recursively zombie containers

In e.g.: you 'docker run -t -i' a 'bash' session and '.bashrc' is fucked up, container will forever respawn disallowing you to 'docker rmi' the used image .

docker rmi triangle/ubuntu-saucy-with-rvm 2>&1|grep ^Error|awk '{print $10}'|xargs docker rm
@rcmorano
rcmorano / 99norecommends
Created February 20, 2014 17:30
/etc/apt/apt.conf.d/99norecommends: disables debian automatic suggests/recommends installation
APT::Install-Recommends "false";
APT::Install-Suggests "false";
@rcmorano
rcmorano / git_ch_reflog_info
Created February 9, 2014 17:42
Changes git commiter/author info in the whole reflog based on current $GIT_COMMITTER_NAME. Be careful on multiuser repositories!
#!/bin/bash
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_NAME" = "forgot_to_set_user" ]
@rcmorano
rcmorano / focus-on-window
Last active December 20, 2015 23:28
get focus on a window that matches the process name pattern defined by $WINDOW_PROCESS_PATTERN and if it's already focused, minimizes it## IT DEPENDS ON 'wmctrl' and 'xdotool' packages ##
#!/bin/bash
#
# Copyright (C) 2013, Roberto C. Morano <[email protected]>
#
# This software is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,