View logrus logging filename and line
This file contains 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" | |
"os" | |
"runtime" | |
"strings" | |
"github.com/sirupsen/logrus" | |
) |
View redirect_port_to_ip-port.sh
This file contains 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 | |
function printHelp(){ | |
echo "This tool can be used to redirect tcp port from host on which is being run to another routable ip and port from this host" | |
echo | |
echo "USAGE:" | |
echo "$(basename $0) <destinationIP> <sourcePort> <destinationPort>" | |
} |
View nova.conf
This file contains 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
Problem : Unable to connect to Openstack instance console using VNC using openstack Horizon | |
Error Message : Failed to connect to server (code 1006) | |
Environnment : OpenStack RDO Juno , CentOS7 | |
Solution: You need to update vncserver_proxyclient_address with the openstack controller IP address OR novavncproxy_base_url IP address as shown below | |
[root@os-node1 ~(keystone_admin)]# cat /etc/nova/nova.conf | grep -v "#" | grep -i vnc | |
novncproxy_host=0.0.0.0 | |
novncproxy_port=6080 | |
novncproxy_base_url=https://192.168.1.111:6080/vnc_auto.html |
View Bash spinner
This file contains 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
spin() | |
{ | |
local \ | |
before_msg="$1" \ | |
after_msg="$2" | |
local spinner | |
local -a spinners | |
spinners=(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏) | |
# hide cursor |
View client.go
This file contains 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 ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
) |
View context.go
This file contains 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 ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
"time" | |
"golang.org/x/net/context" |