I execute rabbitmqadmin -V my_host list bindings command and get besides other the following line:
+-----------------+------------------------------+------------------------------+
| source | destination | routing_key |
+-----------------+------------------------------+------------------------------+
| | my_queque | my_queque |
+-----------------+------------------------------+------------------------------+
How to understand it, is there a binding without a source?
Related
I have a problem with it when i use Powerlevel10k which is a theme for ZSH?
From the Powerlevel10k FAQ:
Q: What do different symbols in Git status mean?
When using Lean, Classic or Rainbow style, Git status may look like this:
feature:master ⇣42⇡42 *42 merge ~42 +42 !42 ?42
Legend:
| Symbol | Meaning | Source |
| --------| ------------------------------------------------------------------| ---------------------------------------------------- |
| feature | current branch; replaced with #tag or #commit if not on a branch | git status |
| master | remote tracking branch; only shown if different from local branch | git rev-parse --abbrev-ref --symbolic-full-name #{u} |
| ⇣42 | this many commits behind the remote | git status |
| ⇡42 | this many commits ahead of the remote | git status |
| *42 | this many stashes | git stash list |
| merge | repository state | git status |
| ~42 | this many merge conflicts | git status |
| +42 | this many staged changes | git status |
| !42 | this many unstaged changes | git status |
| ?42 | this many untracked files | git status |
See also: How do I change the format of Git status?
If you've created a Git repository at the root of your home directory to store dotfiles, you probably want to ignore untracked files in it. You can achieve this by executing the following command:
git -C ~ config status.showuntrackedfiles no
This will have several effects:
git status will be faster.
git status won't list 171 untracked files.
?171 will disappear from your prompt.
You can undo the above command with the following command:
git -C ~ config --unset status.showuntrackedfiles
if you don't want to see Git status in your prompt while in home directory, add this parameter to ~/.p10k.zsh:
# Don't display Git status in prompt for Git repositories whose workdir matches
# this pattern.
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
If you don't want to see Git status in your prompt at all, remove vcs from POWERLEVEL9K_LEFT_PROMPT_ELEMENTS array in ~/.p10k.zsh.
How to get status and cluster_status from rabbitmq in JSON format
sudo rabbitmqctl status
sudo rabbitmqctl cluster_status
help is your friend:
# rabbitmqctl help cluster_status
Error:
Usage
rabbitmqctl [--node <node>] [--longnames] [--quiet] cluster_status
Displays all the nodes in the cluster grouped by node type, together with the currently running nodes.
Relevant Doc Guides
* https://rabbitmq.com/clustering.html
* https://rabbitmq.com/cluster-formation.html
* https://rabbitmq.com/monitoring.html
General Options
The following options are accepted by most or all commands.
short | long | description
-----------------|---------------|--------------------------------
-? | --help | displays command help
-n <node> | --node <node> | connect to node <node>
-l | --longnames | use long host names
-t | --timeout <n> | for commands that support it, operation timeout in seconds
-q | --quiet | suppress informational messages
-s | --silent | suppress informational messages
| and table header row
-p | --vhost | for commands that are scoped to a virtual host,
| | virtual host to use
| --formatter | alternative result formatter to use
| if supported: json, pretty_table, table, csv.
not all commands support all (or any) alternative formatters.
Figured out by myself. You can use the option --formatter json
Could not find it in the rabbitmq documentation!
sudo rabbitmqctl cluster_status --formatter json
sudo rabbitmqctl cluster_status --formatter json | jq .running_nodes
To parse this and use it in bash script:
running_nodes=($(egrep -o '[a-z0-9#-]+' <<< $(sudo rabbitmqctl cluster_status --formatter json | jq .running_nodes)))
I would like to get a HTML report from the zap-cli. I am able to run these commands, but is there a way to run both in single command
[sb#company.local#sb-test-vm ~]$ zap-cli quick-scan -s xss,sqli --spider -r -e "some_regex_pattern" http://demo.testfire.net/
[INFO] Running a quick scan for http://demo.testfire.net/
[INFO] Issues found: 6
+----------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------+
| Alert | Risk | CWE ID | URL |
+==================================+========+==========+==================================================================================================================+
| Cross Site Scripting (Reflected) | High | 79 | http://demo.testfire.net/bank/login.aspx |
+----------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------+
| Cross Site Scripting (Reflected) | High | 79 | http://demo.testfire.net/comment.aspx |
+----------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------+
| Cross Site Scripting (Reflected) | High | 79 | http://demo.testfire.net/notfound.aspx?aspxerrorpath=%3C%2Fb%3E%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E%3Cb%3E |
+----------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------+
| Cross Site Scripting (Reflected) | High | 79 | http://demo.testfire.net/search.aspx?txtSearch=%3C%2Fspan%3E%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E%3Cspan%3E |
+----------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------+
| SQL Injection | High | 89 | http://demo.testfire.net/bank/login.aspx |
+----------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------+
| SQL Injection | High | 89 | http://demo.testfire.net/bank/login.aspx |
+----------------------------------+--------+----------+------------------------------------------------------------------------------------------------------------------+
[sb#company.local#sb-test-vm ~]$ zap-cli report -o abc.html -f html
[INFO] Report saved to "abc.html"
[sb#company.local#sb-test-vm ~]$ ls -l abc.html
-rw-rw-r--. 1 sb#company.local sb#company.local 58659 Sep 25 16:39 abc.html
[sb#company.local#sb-test-vm ~]$ date
Tue Sep 25 16:39:16 EDT 2018
[sb#company.local#sb-test-vm ~]$
I tried the switches provided but unable to execuete the scan and get the report in a single liner. I am willing to use zap.sh even however I didn't see the option to generate the report in HTML, only XML. any insight on this is appreciated
zap-cli --help
Usage: zap-cli [OPTIONS] COMMAND [ARGS]...
ZAP CLI v0.9.0 - A simple commandline tool for OWASP ZAP.
Options:
--boring Remove color from console output.
-v, --verbose Add more verbose debugging output.
--zap-path TEXT Path to the ZAP daemon. Defaults to /zap or the value
of
the environment variable ZAP_PATH.
-p, --port INTEGER Port of the ZAP proxy. Defaults to 8090 or the value
of
the environment variable ZAP_PORT.
--zap-url TEXT The URL of the ZAP proxy. Defaults to http://127.0.0.1
or the value of the environment variable ZAP_URL.
--api-key TEXT The API key for using the ZAP API if required. Defaults
to the value of the environment variable ZAP_API_KEY.
--help Show this message and exit.
Commands:
active-scan Run an Active Scan.
ajax-spider Run the AJAX Spider against a URL.
alerts Show alerts at the given alert level.
context Manage contexts for the current session.
exclude Exclude a pattern from all scanners.
open-url Open a URL using the ZAP proxy.
policies Enable or list a set of policies.
quick-scan Run a quick scan.
report Generate XML, MD or HTML report.
scanners Enable, disable, or list a set of scanners.
scripts Manage scripts.
session Manage sessions.
shutdown Shutdown the ZAP daemon.
spider Run the spider against a URL.
start Start the ZAP daemon.
status Check if ZAP is running.
EDIT:
I tried this command but the abc.html file wasn't there in the current dir. I did a find but couldn't find abc.html anywhere
zap-cli quick-scan -s xss,sqli --spider -r -e "some_regex_pattern" http://demo.testfire.net/ && zap-cli report -o abc.html -f html
So, next I tried to out these 2 commands in a zap-run.sh script and chmod +x the script and ran it, that DID create the abc.html file. So, thank you
If the big goal is a "single liner", why not just chain the commands?
zap-cli quick-scan -s xss,sqli --spider -r -e "some_regex_pattern" http://demo.testfire.net/ && zap-cli report -o abc.html -f html
If that doesn't suit you then put both commands in a batch file (or shell script) and call that instead.
I have set up selenium grid on local machine and a node is set up on remote machine.
The node is running
java -jar selenium-server-standalone-3.8.1.jar -role node -hub http://<hub_machine>:4444/grid/register
Now I have written robot tests to run the script on the remote machine as follows:
Open Browser google.com chrome None http://<hub_machine>:4444/wd/hub desired_capabilities=browserName:chrome,platform:WINDOWS
I also tried using the remote Webdriver as follows:
${executor}= Evaluate str('http://<hub_machine>:4444/wd/hub')
${desired capabilities}= Evaluate { "browserName": "chrome", "version": "", "platform": "VISTA", "javascriptEnabled": True}
Create Webdriver Remote desired_capabilities=${desired capabilities} command_executor=${executor}
But it the code throws an error as follows:
2018-02-20 13:33:41.655:WARN:osjs.HttpChannel:qtp662736689-13: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {"capabilities": {"alwaysMatch": {"version": "", "platform": "VISTA", "browserName": "chrome", "javascriptEnabled": true}, "firstMatch": []}, "desiredCapabilities": {"version": "", "platform": "VISTA", "browserName": "chrome", "javascriptEnabled": true}}
Please suggest how to resolve this issue.
The error says it all :
/wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request: {"capabilities": {"alwaysMatch": {"version": "", "platform": "VISTA", "browserName": "chrome", "javascriptEnabled": true}, "firstMatch": []}, "desiredCapabilities": {"version": "", "platform": "VISTA", "browserName": "chrome", "javascriptEnabled": true}}
To start the Selenium Grid Node you should provide the WebDriver variant as an argument as follows :
Mozilla Firefox :
java -Dwebdriver.gecko.driver=geckodriver.exe -jar selenium-server-standalone-3.8.1.jar -role node -hub http://<hub_machine>:4444/grid/register
Chrome :
java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.8.1.jar -role node -hub http://<hub_machine>:4444/grid/register
Internet Explorer :
java -Dwebdriver.ie.driver=IEDriverServer.exe -jar selenium-server-standalone-3.8.1.jar -role node -hub http://<hub_machine>:4444/grid/register
Update
As you are still seeing the same error you need to :
Provide the complete url including the protocol as https://www.google.com (instead of only google.com)
Clean the Project from your IDE
Use CCleaner tool to wipe off all the OS chores.
Execute your Test
Note if you need to run Robot tests across many systems then Grid is the way. But if you only need one remote machine you can use the selenium server in stand alone mode.
I just solved this problem. Here is how I did it for Grid:
Start the Hub and Node Selenium server
Note I run in python's virtual env to control versions. So virPath below is the full path to the bin dir where I put the selenium server jar file
#! /bin/bash
virPath="$(echo $PATH | cut -f 1 -d':')"
java -jar ${virPath}/selenium-server.jar \
-role hub \
>/tmp/selenium_server_hub.log 2>&1 &
sleep 3
java -jar ${virPath}/selenium-server.jar \
-role node \
-hub http://localhost:4444/grid/register \
-maxSession 10 \
-browser browserName=chrome,maxInstances=10 \
>/tmp/selenium_server_node.log 2>&1 &
Running Robot tests
When I want to run Robot tests using the remote server I pass in flags to pybot:
--variable Use Selenium Server:True
--variable Selenium Server URL:http://localhost:4444/wd/hub
I have a number of keywords to open the brower based on my env but eventually it gets down to these:
Open Chrome Browser to Page
| | [Documentation]
| | ... | Opens Google Chrome to a given web page using Create Webdriver so
| | ... | arguments can be passed to webdriver in the form of capabilities.
| | ... | For more information on what capabilities that Google Chrome
| | ... | supports, see [http://chromedriver.chromium.org/capabilities] and
| | ... | [https://peter.sh/experiments/chromium-command-line-switches/]
| | ... |
| | ... | Webdriver can be run remotely using the selenium remote server.
| | ... | This can be done in 'Grid' mode with both a Hub server and
| | ... | Node servers where the tests are route to by the Hub to be run.
| | ... | See run_tests.sh for options to use this feature.
| | [Arguments] | ${url} |
| | ${ws}= | Set Variable | window-size=1080,1080 |
| | ${chrome_options}= | Evaluate | sys.modules['selenium.webdriver'].ChromeOptions() | sys |
| | Call Method | ${chrome_options} | add_argument | disable-infobars |
| | Call Method | ${chrome_options} | add_argument | test-type |
| | Call Method | ${chrome_options} | add_argument | disable-extensions |
| | Call Method | ${chrome_options} | add_argument | ignore-certificate-errors |
| | Call Method | ${chrome_options} | add_argument | allow-insecure-localhost |
| | Call Method | ${chrome_options} | add_argument | disable-browser-side-navigation |
| | Call Method | ${chrome_options} | add_argument | ${ws} |
| | Run Keyword If | ${Use Chrome Headless} |
| | ... | Call Method | ${chrome_options} | add_argument | headless |
| | Run Keyword If | ${Use Selenium Server} |
| | ... | Create Remote Chrome Webdriver | ${chrome_options} |
| | ... | ELSE | Create Local Chrome Webdriver | ${chrome_options} |
| | Go To | ${url} |
Create Remote Chrome Webdriver
| | [Arguments] | ${chrome options} |
| | Comment | Convert webdriver options to capabilities for Selenium server |
| | ${options}= | Call Method | ${chrome_options} | to_capabilities |
| | ${status} | ${resp}= | Run Keyword And Ignore Error |
| | ... | Create Webdriver | Remote | command_executor=${Selenium Server URL} | desired_capabilities=${options}
| | Run Keyword If | '${status}'=='FAIL' | Fail | Could not connect to Selenium Server. Is it up?\nError: ${resp} |
Create Local Chrome Webdriver
| | [Arguments] | ${chrome options} |
| | ${status} | ${resp}= | Run Keyword And Ignore Error |
| | ... | Create Webdriver | Chrome | chrome_options=${chrome_options} |
| | Run Keyword If | '${status}'=='FAIL' | Fail | Could not start browser. Are tests being run locally?\nError: ${resp} |
Tool Versions
Robot env requires a lot of different packages so I have a bash script to list all that I use:
Tool | Version | Path
-------------+--------------------+-------------------------------------
Linux Dist | Ubuntu 16.04.4 LTS | NA
Linux Kernel | 4.4.0-116-generic | NA
Git commit | 9d7739b | NA
Virtualenv | 15.0.1 | /usr/bin/virtualenv
Python | 2.7.12 | /home/bm/devel/work/rf/bin/python
RF | 3.0.2 | /home/bm/devel/work/rf/bin/pybot
RF Selenium | 3.1.0 | /home/bm/devel/work/rf/lib/python2.7/site-packages
Selenium | 3.9.0 | /home/bm/devel/work/rf/lib/python2.7/site-packages
Requests | 2.18.4 | /home/bm/devel/work/rf/lib/python2.7/site-packages
Easysnmp | 0.2.5 | /home/bm/devel/work/rf/lib/python2.7/site-packages
Poster | 0.8.1 | /home/bm/devel/work/rf/lib/python2.7/site-packages
Chrome | 65.0.3325.181 | /usr/bin/google-chrome
chromedriver | 2.35.528139 | /home/bm/devel/work/rf/bin/chromedriver
Firefox | 59.0.2 | /usr/bin/firefox
Geckodriver | 0.19.1 | /home/bm/devel/work/rf/bin/geckodriver
------------------------------------------------------------------------
I'm using vir-stall virtual machine, and my command is
virt-install --name=gust --vcpus=4 --ram=8192 --network bridge:br0 --cdrom=/opt/rhel-server-6.2-x86_64-dvd.iso --disk path=/opt/as1/as1.img,size=50 --accelerate
After running the command, it hangs on probing EDD,
- Press the <ENTER> key to begin the installation process.
+----------------------------------------------------------+
| Welcome to Red Hat Enterprise Linux 6.2! |
|----------------------------------------------------------|
| Install or upgrade an existing system |
| Install system with basic video driver |
| Rescue installed system |
| Boot from local drive |
| Memory test |
| |
| |
| |
| |
| |
| |
| |
+----------------------------------------------------------+
Press [Tab] to edit options
Automatic boot in 57 seconds...
Loading vmlinuz......
Loading initrd.img...............................ready.
Probing EDD (edd=off to disable)... ok
ÿ
Previously, I wait a long time, it seems no marching. After I press ctrl + ] and stop it. I find it was running using virsh list, but I cannot console it using virsh concole gust. Any problem and how should I do. Many Thanks
Add the following to your virt-install
--extra-args="console=tty0 console=ttyS0,115200n8 edd=off"
The edd=off is the critical part for this