Hi I was trying to run browsermob-proxy on google colab but was constantly getting the error:
Could not read Browsermob-Proxy json
Another server running on this port?
Also I tried to find code on the internet on how to use browsermob-proxy on google colab, but didn't find it.
Can you provide a working code or link for the same.
This is the code that works for me:
#!/usr/bin/python
# coding=utf-8
%cd path/browsermob-proxy-2.1.4/bin
!chmod -R 777 *
from browsermobproxy import Server
dict={'port':8090}
server = Server('./browsermob-proxy',options=dict)
server.start()
proxy = server.create_proxy()
you need to change the current working directory to the path/browsermob-proxy-2.1.4/bin folder, and then use !chmod -R 777 * to modify the file permissions. Point to the file without .bat
If the local port being used, There will appear Errno 8 error warning. You need to add a port options dict
Related
I wanted to deploy my script that uses module spotipy to oracle linux vm. I'm almost done, however whenever script is used for the first time, spotipy redirects me to URL. And I need to type it in, so it goes on, but on vm I have no browser, so I have no idea how can I get this URL
The error:
raise SpotifyOauthError(
spotipy.oauth2.SpotifyOauthError: error: invalid_request, error_description: code must be supplied
URL that I am redirected to starts https://example.com/ It's the link that I have in my dashboard in spotify developer account itself. However, it must have some different parameters, some code I guess. I tried typing https://example.com?code=my-client-id and https://example.com?code=my-client-secret but they aren't working (client-id and client-secret from my spotify dashboard).
I also wanted to install tcpflow on my vm to monitor http requests. But using sudo yum install tcpflow answers with Error: Unable to find a match: tcpflow.
For this reason, I can not start using my app. If anyone knows how to check URL from terminal or knows how spotipy redirect link is formatted, I would be really grateful.
I'm using Python 3.9.13 and oracle-linux 8.
Well, turns out there is an argument open_browser for spotipy.oauth2.SpotifyOAuth() . It tells spotipy just to print URL in terminal instead of openning in web browser.
Super glad I found this question:
Why does the 'couldn't read cache at: .cache-<My Username> ' warning appear and the code run indefinitely when authenticating in Spotipy?
I'm a new developer-in-training attempting to set up my Ruby development environment on a Windows machine using Ubuntu. I'm following the instructions here:
https://gorails.com/setup/windows/10
I've made it to the last few steps of the process, which is where I'm started to get errors:
# Navigate to the C: drive on Windows. Do this every time you open the Linux console.
cd /mnt/c
# Create a code directory at C:\code for your Rails apps to live (You only need to do this once)
mkdir -p code
#### If you want to use Postgres
# Note that this will expect a postgres user with the same username
# as your app, you may need to edit config/database.yml to match the
# user you created earlier
rails new myapp -d postgresql
#### or if you want to use SQLite (not recommended)
# rails new myapp
#### Or if you want to use MySQL
# rails new myapp -d mysql
# Then, move into the application directory
cd myapp
# If you setup MySQL or Postgres with a username/password, modify the
# config/database.yml file to contain the username/password that you specified
# Create the database
rake db:create
rails server
On the step to set up Postgres:
rails new myapp -d postgresql
I receive this error about setting up nodejs:
/home/event/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/app_loader.rb:53: warning: Insecure world writable dir /home/event/.rbenv/versions/2.6.5 in PATH, mode 040777
sh: 1: node: not found
sh: 1: nodejs: not found
Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/
Even after I go to the URL provided and install NodeJS, that error still shows up when I attempt to repeat the process. Is this just a matter of it not existing in the correct path and I need to relocate it?
Also, I've attempted to proceed with the other steps despite that error. When I enter this command, the second last one in the article referenced above:
rake db:create
I receive this error:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Couldn't create 'myapp_development' database. Please check your configuration.
rake aborted!
ActiveRecord::NoDatabaseError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Caused by:
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Tasks: TOP => db:create
(See full trace by running task with --trace)
I've searched around about this with little success, and attempted to decipher what the error messages mean; but at my current level of knowledge it just seems beyond me. Appreciate any insight anyone has to share on this!
I have an application monitoring files sent to a FTP server (proftpd 1.3.5a). I am using pywatchdog to monitor file creation on FTP server root (app running locally), but under some very specific circumstance it does not issue a notification: when I create a new dir through ftp and, after that, create a file under this directory. The file creation/modification events are not caught!
In order to reproduce it in a simple way I've used pyinotify (0.9.6) itself and it looks like the problem comes from there. So, a simple way to reproduce the problem:
Install proftpd and pyinotify (python3) on the server with default settings
In the server, run the following command to monitor ftp root (recursive and autoadd turned on - considering user "user"):
python3 -m pyinotify -v -r -a /home/user
In the client, create a sample.txt, connect in the ftp server and issue the following commands, in this order:
mkdir dir_a
cd dir_a
put sample.txt
There will be no events related to sample.txt - neither create nor modify!
I've tried to remove the ftp factor from the issue by manually creating and moving directories inside the observed target and creating files inside these directories, but the issue does not happen - it all works smoothly.
Any help will be appreciated!
I have to remotely connect to a gateway(working on Linux platform), inside which I have couple of executable files (signingModule.sh and taxModule.sh).
Now I want to write one script in my desktop which will connect to that gateway and run signingModule.sh and taxModule.sh in two different terminals.
I have written below code:
ssh root#10.138.77.150 #to connect to gateway
sleep 5
cd /opt/swfiscal/signingModule #path of both modules
./signingModule #executable.
But through this code I am able to connect my gateway but after connecting to gateway nothing is happening.
2nd code:
source configPath # file where i have given path of both the modules
cd $FCM_SCRIPTS # variable in which i have stored the path of modules
ssh root#10.138.77.150 'sh -' < startSigningModule** #to connect and run one module.
as an output of this i am getting:
-source: configPath: file not found
Please help me working this out. Thanks in advance.
Notes:
I can copy paste my files in that gateway if required.
Gnome-Terminal or any other alternatives of this is not working in my gateway
ssh root#10.138.77.150 "cd /opt/swfiscal/signingModule && ./signingModule"
Line source configPath doesn't work because you need specify full path to the file.
You can pass several commands to ssh to run them in sequence; but I prefer a different solution: I have whole scripts locally; and running them remotely means:
Using scp to copy my script to the remote system
Using ssh to then run the script on the remote system
The big advantage here: there is always a potential for getting things wrong (for example: quoting) when directly giving commands to ssh. But when you put everything into a script, you have exact/full control over what is going to happen. You can put things like "set -e" into your script to improve error handling ...
(and of course, you can also automate the two steps listed above!)
I need to start a win10 app remotly.
What I already tried is:
for starters I used this path: shell:appsfolder\appname!app
using psexec to start the app doesn't work
same with powershell (over psexec as well as native ps remote)
also tried starting it indirectly from a .cmd file and .vbs file executing form psexec
all these command and files are working if executed directly on the client. But if I try to execute them remotly I get the error message path not found or it just nothing happening and really nothing I checked if the appropriate exe file is running via taskmanager. Apparently there must be some issue with the name translation of shell:appsfolder over a remote session.