Can p4api.net connect to a (local) p4 personal server?
I started a personal server with
p4 -u itsame -d c:\perforce\local -c itsameClient clone -m 1 -v -p p4server:somePort -f //repo/path/...
It works - it can use it in p4v or from the command like - there's even the .p4root in c:\perforce\local.
However, from the latest p4api.net, it just keeps trying to use TCP to connect. Is there no way to say this is to the file system - or perhaps does the personal server expose itself to localhost:port somehow?
The client application's P4PORT needs to be set correctly in order to connect to a server. For a remote server you simply specify the hostname:port. For a personal server, there's a special P4PORT syntax that specifies how the local server executable is to be invoked to service client requests. You can see it by running p4 set P4PORT within your personal server directory:
C:\Perforce\test>p4 set P4PORT
P4PORT=rsh:p4d.exe -i -r "c:\Perforce\test\.p4root" (config 'c:\Perforce\test\p4config.txt')
Note that when you initialize a personal server, it automatically sets up P4CONFIG in that directory, which is why that P4PORT is automagically set for you already. Your P4API.NET application should be able to use that same config (removing the need to manually copy over the P4PORT string) as long as:
it has the correct cwd set (i.e. the directory the personal server lives in)
the P4PORT is not overridden with an incorrect value
Related
I need to import the perforce depot workspace into linux development Environment.
I am getting error as p4passwd unset on p4 sync and login. Can anyone please explain this?
Run:
p4 set P4USER=your_user_name
p4 set P4CLIENT=your_client_name
where your_user_name is your actual Perforce username and your_client_name is the unique name you want to use to describe your workspace on this Linux machine. (If your Perforce username is the same as your Linux login, and you're fine with using your local hostname as the client name, you can skip this.)
Then run:
p4 login
and enter your Perforce password (not your Linux password).
Then run:
p4 client
Make any edits you like to the client spec. If you don't know what to do, just save it and exit the editor. The default will do to get you started.
Then run:
p4 sync
This will sync files from the depot to your workspace, according to your client spec. (If you just used the default client definition, everything in the depot is being synced to your current directory.)
https://www.perforce.com/perforce/doc.051/manuals/p4guide/03_quickstart.html
I have created a Personal Server using the P4V "Helix Client" on my Windows 10 workstation at home.
I would like to be able to connect to this server from my laptop on the LAN so that I can pull from it. (To make sure that everything that is required for the project is correctly in the repository, and testing)
Should I be able to connect to this server using the workstations IP address and port 1666?
Is there an additional step I need to take to "serve" the repository?
A "personal server" doesn't listen on the network by default (the client spawns a short-lived server process in place each time it runs a command).
To convert your personal server into a shared server, install the Perforce service (this'll be part of the server installer on Windows) and set its server root directory to match the path you gave your personal server.
Alternatively, you can go to a command prompt and run:
p4d -r Z:\Core\.p4root -p 1666
but that server will only be up and listening for as long as that command prompt is open, whereas the service (p4s.exe) will run in the background.
We need to provide "localhost:1666" as the server which means that (the same as the IP address 127.0.0.1). It will only work for you and not other machines.
Open the tab "Initialize New Personel Server" Tab and then specify your server location.
I have recently started using perforce on Windows 7. I have the perforce synced on my local machine using P4V. I was trying to run some other tool that uses the path where my perforce local directory is mapped on my machine. It appears that it is picking up the wrong one. While trying to debug, I noticed that the 'p4 info' command returns the 'Client root' which is set to the wrong value. The 'p4 set' shows the P4ROOT which is the correct value. What exactly is the difference between 'p4 set' and 'p4 info'? Can I update the 'Client root'?
P4ROOT is a server-side setting and is (confusingly) not related to your client root. The client root is set in the client spec that is specified via P4CLIENT and edited via the "p4 client" command.
To find the right value for P4CLIENT, look for the "Workspace" name in P4V ("workspace" is a synonym for "client"). Then tell the command line to use the same value like this:
p4 set P4CLIENT=(client name)
Once you do this, you should already have the right client root, but if you needed to update the client root, you'd do it by running:
p4 client
I am changing different parameters like RSAAuthentication, PubkeyAuthentication and PasswordAuthentication (sudo vim /etc/ssh/sshd_config) to disable ssh password authentication to force ssh login via public key only.
The experiments are adversely affecting many users as they suddenly find "Connection refused" while trying to ssh to the server. I want to avoid these experiments. Is there any work around to enable public key authentication without touching system files like /etc/ssh/ssd_config?
Sure. Set up an alternative configuration file, and run sshd on another port while you are experimenting:
cp sshd_config sshd_config_working
/usr/sbin/sshd -p 2222 -f sshd_config_working
Now you can connect with:
ssh -p 2222 user#localhost
And you can make as many changes as you want until you it working as desired. At that point, copy your _working config back to the main config file and restart sshd.
Alternatively, stop mucking about on a production server and set up a virtual machine or cotainer for testing, where you can modify the sshd configuration as much as you want without affecting anybody.
I need to create a bash script which will connect to an FTP server, upload a file and close the connection. Usually this would be an easy task but I need to specify some specific proxy settings which is making it difficult.
I can connect to the FTP fine using a GUI client i.e. Filezilla with the following settings:
Proxy Settings
--------------
FTP Proxy : USER#HOST
Proxy Host: proxy.domain.com
Proxy User: blank
Proxy Pass: blank
FTP Settings
------------
Host : 200.200.200.200
Port : 21
User : foo
Pass : bar
What I can't seem to do is replicate these settings within a text based ftp client i.e. ftp, lftp etc. Can anyone help with setting this script up?
Thanks in advance!
According to the docs, lftp should support the ftp_proxy environment variable, e.g.
ftp_proxy=ftp://proxy.domain.com lftp -c "cd /upload; put file" ftp://200.200.200.200
If that works, you can put
export ftp_proxy=ftp://proxy.domain.com
in your shell configuration files, or
set ftp:proxy=ftp://proxy.domain.com
in your ~/.lftprc.
Alternatively, try running the commands that your GUI FTP client is running, e.g.
upload.lftp
USER ...#...
PASS ...
PUT ...
And run it using -s:
lftp -s upload.lftp 200.200.200.200
Or try curl -T (docs) ncftpput (docs).
Something like:
FTP_PROXY=ftp://proxy.domain.com curl -T uploadfile -u foo:bar ftp://200.200.200.200/myfile
might work.