I've tried to search this topic in google, but without any signifant results.
I need to start some GUI app from terminal, but I don't care what this app is showing me. In addition, i need to start few instances of this application in diffrent sessions. It's connected with some GUI automated tests, so I know what I want and I'm looking for an answer :).
I think the proper steps should be:
1) Init new X window session 2) Get my new session id 3) export it to env variable (export DISPLAY:13.0) 4) run my app
but I'm stucked at first step. does anybody here had similar problem?
Xvfb is what I was looking for.
Exec a command in virtual x server:
xvfb-run -a -w 10 command
Related
I only seem able to use getContainerId(WebDriver) during the first test. Every subsequent test returns empty e.g. getContainerId(SelenideDriver.getWebdriver)
Ideally I need to be able to execute commands in the docker browser container (for importing certificates etc).
Is this expected or am I doing something wrong?
Thanks.
docker ps -a
This should give you the container id
I have noticed that .bashrc does not run whenever launching an AWS session in Systems manager session manager.. Switching user using su - user however does run .bashrc but that is not what I am trying to achieve.
My objective is to have a welcome message whenever someone starts a session through the console/browser.
Does anyone have any work around or ideas on how to do this? /etc/motd didn't seem to work either.
This is one of the limitations of SSM Session Manager reported in several places, e.g.:
SSM Session Manager does not source .bashrc or .bash_profile
Custom Shell for aws ssm start-session
AWS Session Manager is not sourcing bash rc
You can only customize for now the user which ssm agent is using. So instead of ssm-user you can change it to ec2-user or based on your individual IAM users.
You could also consider using EC2 Instance Connect (browser-based SSH connection) instead of Session Manager. The connect works as expected, though its not enabled by default on Ubuntu.
Is there any postgresql command or linux command that can be run as cron job to know the number of active connections at any point of time? I have a flask application running which is integrated with gps logging in every 15 minutes via the mobile app built using Ionic framework.
Query pg_stat_activity:
psql -c "select count(*) from pg_stat_activity" -t
Add any necessary connection params (-h, -U, etc). Auth is a little trickier - if you trust the environment, you can use a .pgpass file.
Other notes -
The -t limits output to the tuple itself
You can get some other useful info with different groupings or predicates. For example: select datname, count(*) from pg_stat_activity group by datname
Hope that helps.
I've been trying to make an internet speed monitor (because our internet connection sucks, and I wanted to be able to show to our ISP that they're giving sh*tty service) by following this http://makezine.com/projects/send-ticket-isp-when-your-internet-drops/
SO far I've been only succesfull on making the script itself. When I test the script by typing in ./speedtest-cron.sh in the terminal window it runs perfectly. But when I add it in the crontab like so
40 * * * * ./speedtest-cron.sh
it does nothing. What am I doing wrong here?
I have node.js running inside a docker container. When I start docker, it then calls a script that calls node.js (or nodemon) to start.
Inside that node.js one of the first things it does is look for it's IP via
var ifaces = os.networkInterfaces();
But it doens't work all the time, for reasons that mystify me:
AWS+Docker+manualstart node = YES!
AWS+Docker+autostart nodemon= YES
AWS+Docker+autostart node = NO
as 1, and 3 use identical plain commands my best guess is that docker is starting it before the network has been started. So either I can have the init script start the network earlier or poll until something shows up. Does anybody know the linux command to start the network set the ip?
I opted to just setInterval till the os.networkInterfaces returned a non-null value, it varies in time from 100ms to 500ms or so on a slower AWS micro instance.