When ssh'ing into an app (e.g. a rails app, with fly ssh console -C "/app/bin/rails console"), how can I prevent:
<page break> --- Press enter to continue ( q<enter> to break ) --- <page break>
and just dump everything to the console (without the breaks)?
Note I tried this but it didn't seem to affect it.
Related
I am following shadow-cljs Quick Start documentation on a minimal example of a project. Here is the link.
I have this shadow-cljs.edn file:
;; shadow-cljs configuration
{:source-paths
["src/dev"
"src/main"
"src/test"]
:dev-http {8080 "public"}
:dependencies
[]
:builds
{:frontend
{:target :browser
:modules {:main {:init-fn acme.frontend.app/init}}
}}}
In /Users/pedro/projects/acme-app/src/main/acme/frontend/app.cljs, I also have:
(ns acme.frontend.app)
(defn init []
(println "Hello World"))
I can build and watch it with the command:
$ npx shadow-cljs watch frontend
shadow-cljs - config: /Users/pedro/projects/acme-app/shadow-cljs.edn
shadow-cljs - HTTP server available at http://localhost:8080
shadow-cljs - server version: 2.20.2 running at http://localhost:9630
shadow-cljs - nREPL server started on port 61214
shadow-cljs - watching build :frontend
[:frontend] Configuring build.
[:frontend] Compiling ...
[:frontend] Build completed. (127 files, 0 compiled, 0 warnings, 6.97s)
Since the init function is a "Hellow World" function I was expecting to see it in some place. But, I can't find anywhere "showing" the Hello World to see it worked out.
Where is the "Hello World" supposed to "appear"? Is it supposed only to be available in the REPL inside the IDE as a function to be invoked by the programmer?
The "hello world" is not printed on the terminal (see above the message retrieved), is not displayed on the UI on localhost:8080 (that would probably need a tweak in HTML - see pic below), and does not appear on the browser console (that would probably need js/console.log).
These are the failed attempts to invoke the functions in the REPL after executing npx shadow-cljs node-repl:
cljs.user=> (acme.frontend.app/init)
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:2
Use of undeclared Var acme.frontend.app/init
--------------------------------------------------------------------------------
cljs.user=> (main.acme.frontend.app/init)
------ WARNING - :undeclared-ns ------------------------------------------------
Resource: <eval>:1:2
No such namespace: main.acme.frontend.app, could not locate main/acme/frontend/app.cljs, main/acme/frontend/app.cljc, or JavaScript source providing "main.acme.frontend.app"
--------------------------------------------------------------------------------
This is the image on localhost:8080:
You appear to have skipped the creation of the public/index.html, as mentioned in the Quick Start. The build is using :target :browser, so it is meant to be loaded in the Browser. The HTML will do that. When loaded you'll see the println in the Browser Console.
For the REPL the code always needs to be loaded before if can be used. So, you need a (require '[acme.frontend.app :as x]) before running (x/init).
I'm getting this error while trying to run cube js with the default command in the getting started docs. I've started this in a folder and running it in docker.
Warning. There is no cube.js file. Continue with environment variables
π₯ Cube Store (0.28.31) is assigned to 3030 port.
Warning. Option apiSecret is required in dev mode. Cube.js has generated it as e3b8c5a35fe378f4d481ada777e5f3c4
π Authentication checks are disabled in developer mode. Please use NODE_ENV=production to enable it.
π¦
Dev environment available at http://localhost:4000
π Cube.js server (0.28.31) is listening on 4000
2021-09-03 15:06:01,512 INFO [cubestore::http::status] <pid:17> Serving status probes at 0.0.0.0:3031
2021-09-03 15:06:01,515 INFO [cubestore::metastore] <pid:17> Using existing metastore in /cube/conf/.cubestore/data/metastore
thread '
main
' panicked at '
called `Result::unwrap()` on an `Err` value: Error { message: "IO error: While fsync: a directory: Invalid argument" }
', /project/cubestore/src/metastore/mod.rs:1542:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Cube Store Start Error: undefined
I guess itβs corrupted metastore due to it was incorrectly shutdown for you locally. Could you please try to drop the .cubestore directory?
After running
bundle exec rails s I get a huge error when trying to access the app via http://localhost:3000/
To debug this I need to see the top of the error trace, however the error trace is nearly 5000 items long and gets cut off at around line 3500.
How can I view the full error so I can start to debug ?
4701 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.12.0/lib/puma/server.rb
4702 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.12.0/lib/puma/runner.rb
4703 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.12.0/lib/puma/cluster.rb
4704 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.12.0/lib/puma/single.rb
4705 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.12.0/lib/puma/launcher.rb
4706 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.12.0/lib/puma/plugin/tmp_restart.rb
4707 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/faraday-0.12.1/lib/faraday/adapter/net_http_persistent.rb
4708 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.1/lib/active_support/backtrace_cleaner.rb
4709 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.1.1/lib/rails/backtrace_cleaner.rb
4710 /Users/paul/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/web-console-3.5.1/lib/web_console/whiny_request.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.
You can redirect the output of the script to a file and look through that for your errors.
bundle exec rails s > my_file
This will put the output in the file "my_file". If you want to include the errors (stderr output) you also need to redirect that, so something like this:
bundle exec rails s > my_file 2>&1
my Robot Framework script is shown below. When I use the "Input Text" keyword, the previous letters are erased and only the last letter is shown. How can I simulate a manual key press using Appium via Robot Framework?
*** Settings ***
Library AppiumLibrary
Test Setup Setup application
Test Teardown Teardown application
*** Variables ***
${BROWSER_NAME} mobileOS
${PLATFORM} Android
${USER} XXXXXXX
${PASSWORD} XXXXXXX
${deviceName} XXXXXXX
${AUTOMATIONNAME} Appium
${HOST} https://XXXX.perfectomobile.com/nexperience/perfectomobile/wd/hub
${ANDROID_APP} PUBLIC:XXXX\\XXXXXXXXXXX_X_X_XX.apk
${ANDROID_APP_PACKAGE} XXX.XXX
${APP_ACTIVITY} XXX.XXX.XXX
*** Test Cases ***
Test Case 01: Open application and then close it
Log Source
Wait until page contains element xpath=//*[#resource-id='email'] timeout=60
Input Text xpath=//*[#resource-id='email'] Hello
Capture Page Screenshot
*** Keywords ***
Setup application
Open Application ${HOST}
... browserName=${BROWSER_NAME}
... platform=${PLATFORM}
... user=${USER}
... password=${PASSWORD}
... deviceName=${DEVICENAME}
... automationName=${AUTOMATION_NAME}
... app=${ANDROID_APP}
... appPackage=${ANDROID_APP_PACKAGE}
... appActivity=${APP_ACTIVITY}
Teardown application
Log Source
Close Application
You can use the selenium library built-in keyword Press Key along with the corresponding ASCII code of the certain key you want to press.
For more information visit: https://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html#Press%20Keycode
Example:
press keycode 66
I have an Ubuntu server with Elasticsearch, MongoDB, and Graylog2 running in Azure, and I have an asp.net mvc4 application I am trying to send logs from. (I am using Gelf4Net / Log4Net as the logging component). To cut to the chase, nothing is being logged.
(skip to the update to see what is wrong)
The setup
1 Xsmall Ubuntu VM running the needed software for graylog2
everything is running as a daemon
1 Xsmall cloud service with the MVC4 app (2 instnaces)
A virtual network setup so they can talk.
So what have I tried?
From the linux box the follow command will cause a message to be logged echo "<86>Dec 24 17:05:01 foo-bar CRON[10049]: pam_unix(cron:session):" |
nc -w 1 -u 127.0.0.1 514
I can change the IP address to use the public IP and it works fine as well.
using this powershell script I can log the same message from my dev machine as well as the production web server
Windows firewall turned off and it still doesn't work.
I can log to a FileAppender Log4Net, so I know Log4Net is working.
tailing the graylog2.log shows nothing of interest. Just a few warning about my plugin directory
So I know everything is working, but I can't get the Gelf4Net appender to work. I'm a loss here. Where can I look? Is there something I am missing
GRAYLOG2.CONF
#only showing the connection stuff here. If you need something else let me know
syslog_listen_port = 514
syslog_listen_address = 0.0.0.0
syslog_enable_udp = true
syslog_enable_tcp = false
web.config/Log4Net
//application_start() has log4net.Config.XmlConfigurator.Configure();
<log4net >
<root>
<level value="ALL" />
<appender-ref ref="GelfUdpAppender" />
</root>
<appender name="GelfUdpAppender" type="Gelf4net.Appender.GelfUdpAppender, Gelf4net">
<remoteAddress value="public.ip.of.server"/>
<remotePort value="514" />
<layout type="Gelf4net.Layout.GelfLayout, Gelf4net">
<param name="Facility" value="RandomPhrases" />
</layout>
</appender>
</log4net>
update
for some reason it didn't occur to me to run graylog in debug mode :) Doing so shows this message.
2013-04-09 03:00:56,202 INFO : org.graylog2.inputs.syslog.SyslogProcessor - Date could not be parsed. Was set to NOW because allow_override_syslog_date is true.
2013-04-09 03:00:56,202 DEBUG: org.graylog2.inputs.syslog.SyslogProcessor - Skipping incomplete message.
So it is sending an incomplete message. How can I see what is wrong with it?
I was using the wrong port (DOH!)
I should have been using the port specified in graylog2.config / gelf_listen_port = 12201
so my web.config/log4net/gelf appender should have had
<appender name="GelfUdpAppender" type="Gelf4net.Appender.GelfUdpAppender, Gelf4net">
...
<remotePort value="12201" />
...
</appender>
For anyone who may have the same problem, make sure Log4Net reloads the configuration after you change it. I don't have it set to watch the config file for changes, so it took me a few minutes to realize that I was using the wrong port. When I changed it from 514 to 12201 the first time, messages still weren't getting though. I had to restart the server for Log4Net to pick up the new config, and then it started to work.