Just my blog
Blog about everything, mostly about tech stuff I made. Here is the list of stuff I'm using at my blog. Feel free to ask me about implementations.
- Mobaxterm SSH RDP FTP...
- Thunderbird Email client
- Filezilla FTP client/server
- Nirsoft Win utils
- Sysinternals Win utils
- Pi-Hole AD block by DNS
- NUT UPS manager
- Rpi MON Raspberry monitoring
- Free CAD 3D modelling
- Free Commander Far-like filemanager
- Bitwarden Password manager
- Django web framework
- celery multi-tasking
- celery-beat Celery + Django
- celery-results Celery + Django
- Pillow Python image lib
- wsgi mod Apache + Python
- requests best in WEB requests
- openpyxl make Excell docs
- p4python Perforce + Python
- paramiko SSH + Python
- pyvmomi ESXi Vcenter + Python
I'm using these libraries so you can ask me about them.
Helix Perforce - the name has changed and that`s all for now
Overview
Perforce is a commercial, proprietary revision control system developed by Perforce Software, Inc. The Perforce server manages a central database and a master repository of file versions. Perforce supports both Git clients and clients that use Perforce's own protocol. A Git client can communicate with the Perforce server over SSH or HTTPS, and other Perforce clients communicate with the server via TCP/IP using a proprietary RPC and streaming protocol. Users submit changed files together in changelists, which are applied as atomic commits. The Perforce database is proprietary, preconfigured, and self-installed. It stores system-related metadata (file state, file attributes, branching and merging history, changelists, change descriptions, users, groups, labels, etc.). Files are identified by namespace (i.e., by OS-neutral filenames). File content itself is not stored in the database. MD5 hashes of file content are stored in the database, however, and can be used to verify repository file integrity. Database tables are stored as binary files. Checkpoints and journals are written as text files that can be compressed and offloaded. A database that has been corrupted by hardware failure or other catastrophe can be recovered from the most recent journal and checkpoint. Administrators must plan for disaster recovery by configuring database journaling and setting up regular checkpoints.
Depot
Versioned file content is stored in a master directory hierarchy whose top levels are called "depots". Text file revisions are stored as RCS deltas[notes 1] and binary file revisions are stored in their entirety. The encoding used for text files in the repository is either ASCII or UTF-8,[1] depending on Perforce server configuration. Repository files are not encrypted. Revisions that are branches or copies of other revisions are virtual copies within the repository. All revisions are preserved by default; limits can be set on the number of revisions preserved. Obsolete revisions and files can be purged by the administrator. Repository files must be included in regular system backups.
Note
From Release 2015.1 this now names "Perforce Helix" - nothing critical has been changed in product logic, some new functionality: [http://www.perforce.com/perforce/doc.current/user/relnotes.txt]
Supported Platforms
\* Linux 32/64 \* Windows 32/64[http://www.perforce.com/perforce/doc.current/user/relnotes.txt]
Useful URLs
[http://www.perforce.com/perforce/doc.current/manuals/p4guide/chapter.install.html]
Known Versions
- Release 2015.1 new name 'Perforce Helix'
- Release 2014.3
- Release 2014.3
- Release 2014.2
- Release 2014.1
- Release 2013.6
- Release 2013.4
[su_spoiler title="Older"]
- Release 2013.3
- Release 2013.2
- Release 2013.1
- Release 2012.3
- Release 2012.2
- Release 2012.1
- Release 2011.2
- Release 2010.2
- Release 2010.1
- Release 2009.3
- Release 2009.2
- Release 2009.1
- Release 2008.2
- Release 2008.1
[/su_spoiler]
- [http://www.perforce.com/resources/software-release-index][http://www.perforce.com/perforce/doc.current/user/relnotes.txt]
Components
=\=
Installation Methods
Windows:
From *perforce64.exe* install pack
Linux:
from binaries
- From here: [http://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.install.html#install.unix]
Although you can install p4 and p4d in any directory, on UNIX, the Perforce applications typically reside in /usr/local/bin, and the Perforce service is usually located either in /usr/local/bin or in its own server root directory. You can install Perforce applications on any machine that has TCP/IP access to the p4d host. To limit access to the Perforce service's files, ensure that the p4d executable is owned and run by a Perforce user account that has been created for the purpose of running the Perforce service.
- To start using Perforce:
Download the p4 and p4d applications for your platform from the Perforce web site.Make the downloaded p4 and p4d files executable.Create a server root directory to hold the Perforce database and versioned files.Tell the Perforce service what port to listen to by specifying a TCP/IP port to p4d.Start the Perforce service (p4d).Set the p4d port and address for Perforce applications by setting the P4PORT environment variable. {code} chmod +x p4 chmod +x p4d {code}
Other installation way
[su_spoiler title="This part is useful only for testing purposes"] h1. Trigger
on process := DiscoveredProcess where cmd matches regex (?i)p4s\.exe or cmd matches regex (?i)p4d
p4s - s for SERVER windows instance p4d - d for DEAMON linux instance h3. Windows: \*getProcessList on 192.168.1.31 *Command{*}C:\Program Files\Perforce\Server\p4d.exe \*getServices on 192.168.1.31 *Discovered Service:* Perforce Cmdline "C:\Program Files\Perforce\Server\p4s.exe" h3. Linux: *Command*./p4d *Arguments*\-r /var/www/perforce/ \-J /var/log/journal \-L /var/log/p4err \-p tcp64:[]:1666
[root@testcentos perforce]# ps aux | grep perforce root 3155 0.0 0.1 19972 2104 pts/0 S 15:27 0:00 ./p4d -r /var/www/perforce/ -J /var/log/journal -L /var/log/p4err -p tcp64:[::]:1666
* trigger will be: _windows_cmd_ p4d\.exe _windows_cmd_ p4s\.exe _unix_cmd_ p4d [/su_spoiler]
Launching
Both OS
To shut down the Perforce service, use the command:
\*p4 admin stop
Only a Perforce superuser can use p4 admin stop.
Windows:
- The Perforce service (p4s.exe) and the Perforce server (p4d.exe) executables are copies of each other; they are identical apart from their filenames.
- When run, the executables use the first three characters of the name with which they were invoked (eitherp4sorp4d) to determine their behavior. (For example, invoking copies ofp4d.exenamedp4smyservice.exeorp4dmyserver.exeinvoke a service and a server, respectively.)
- If you install Perforce as a service under Windows, the service starts whenever the machine boots. Use the*Services*applet in the{*}Control Panel*to control the Perforce service's behavior.
- If you install Perforce as a server under Windows, invokep4d.exefrom a command prompt. The flags forp4dunder Windows are the same as those used under UNIX.
- To stop a Perforce service (or server), use the command:
p4 admin stop
- Only a Perforce superuser can use: p4 admin stop.
- For older revisions of Perforce, shut down services manually by using the*Services*applet in the*Control Panel*. Shut down servers running in command prompt windows by pressing*CTRL*+*C*in the window or by clicking the icon to close the command prompt window. Manually shutting down a server in this way is not necessarily "clean"; best practice is to use thep4 admin stopcommand.
As service:
C:\>svcinst create -n Perforce2 -e C:\p4\p4s.exe -a C:\>p4 set -S Perforce2 P4ROOT=C:\p4\ C:\>p4 set -S Perforce2 P4PORT=1666 C:\>p4 set -S Perforce2 P4LOG=log2 C:\>p4 set -S Perforce2 P4JOURNAL=journal2 C:\>svcinst start -n Perforce2 Starting Service Service stopped... starting Service in start pending Service has started
Windows configuration parameter precedence
[su_spoiler title="Can be useful for different installations"] Under Windows, Perforce configuration parameters can be set in many different ways.
- When a Perforce application (such as p4 or P4V), or a Perforce server program (p4d) starts up, it reads its configuration parameters according to the following precedence:
For Perforce applications or a Perforce server (p4d), command-line flags have the highest precedence. For a Perforce server (p4d), persistent configurables set with p4 configure. The P4CONFIG file, if P4CONFIG is set. User environment variables. System environment variables. The Windows user registry (or OS X user preferences) (set by p4 set). The Windows system registry (or OS X system preferences) (set by p4 set \-s).
- When a Perforce service (p4s) starts up, it reads its configuration parameters from the environment according to the following precedence:
Persistent configurables set with p4 configure have the highest precedence. Windows service parameters (set by p4 set \-S servicename). System environment variables. The Windows system registry (or OS X user preferences) (set by p4 set \-s).
- User environment variables can be set with any of the following:
The MS-DOS set command The AUTOEXEC.BAT file The User Variables tab under the System Properties dialog box in the Control Panel
- System environment variables can be set with:
The System Variables tab under the System Properties dialog box in the Control Panel.
[/su_spoiler]
h2. Linux:
On UNIX systems, there is only one Perforce service (p4d) responsible for providing the versioning service. On Windows, this program can be configured to run as a Windows service (p4s.exe) process that starts at boot time, or as a server (p4d.exe) process that you invoke manually from a command prompt. You can override P4PORT by starting p4d with the \-p flag (in this example, listen to port 1818 on IPv6 and IPv4 transports), and P4ROOT by starting p4d with the \-r flag. Similarly, you can specify a journal file with the \-J flag, and an error log file with the \-L flag. A startup command that overrides the environment variables might look like this:
p4d -r /usr/local/p4root -J /var/log/journal -L /var/log/p4err -p tcp64:[::]:1818 &
To restart a running Perforce service (for example, to read a new license file), use the command:
\*p4 admin restart
Only a Perforce superuser can use p4 admin restart. On UNIX platforms, you can also use kill \-HUP to restart the service.
Versioning
Active Versioning
The server version is also displayed when you invoke p4d \-V or p4 \-V.
Windows:
- p4d \-V or p4 \-V
C:\Program Files\Perforce\Server>p4.exe -V Perforce - The Fast Software Configuration Management System. Copyright 1995-2014 Perforce Software. All rights reserved. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) See 'p4 help legal' for full OpenSSL license information Version of OpenSSL Libraries: OpenSSL 1.0.1i 6 Aug 2014 Rev. P4/NTX64/2014.2/978861 (2014/12/19).
- p4.exe info
C:\Program Files\Perforce\Server>p4.exe info User name: addm Client name: wintest Client host: wintest Client unknown. Current directory: c:\Program Files\Perforce\Server Peer address: 127.0.0.1:49353 Client address: 127.0.0.1 Server address: validation.sls.microsoft.com:1666 Server root: C:\Program Files\Perforce\Server Server date: 2015/03/26 16:14:36 +0200 FLE Standard Time Server uptime: 06:34:09 Server version: P4D/NTX64/2014.2/1014956 (2015/02/26) Server license: none Case Handling: insensitive
Almost the same for p4d.exe
- p4d.exe info
C:\Program Files\Perforce\Server>p4d.exe -V Perforce - The Fast Software Configuration Management System. Copyright 1995-2015 Perforce Software. All rights reserved. Portions copyright 1991-2005 Compuware Corporation. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) See 'p4 help legal' for full OpenSSL license information Version of OpenSSL Libraries: OpenSSL 1.0.1i 6 Aug 2014 Rev. P4D/NTX64/2014.2/1014956 (2015/02/26). License: none
Linux:
- p4d \-V or p4 \-V.
[root@testcentos perforce]# ./p4 -V Perforce - The Fast Software Configuration Management System. Copyright 1995-2014 Perforce Software. All rights reserved. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) See 'p4 help legal' for full OpenSSL license information Version of OpenSSL Libraries: OpenSSL 1.0.1i 6 Aug 2014 Rev. P4/LINUX26X86_64/2014.2/978861 (2014/12/19).
- ./p4 info
[root@testcentos perforce]# ./p4 info User name: root Client name: testcentos Client host: testcentos.tet-ad.com Client unknown. Current directory: /var/www/perforce Peer address: [::ffff:127.0.0.1]:56811 Client address: [::ffff:127.0.0.1] Server address: localhost.localdomain:1666 Server root: /var/www/perforce/ Server date: 2015/03/26 16:10:05 +0200 EET Server uptime: 00:42:57 Server version: P4D/LINUX26X86_64/2014.2/1014956 (2015/02/26) Server license: none Case Handling: sensitive
Conclusion
Comparing with ours p4 installation, p4 \-V is enough to catch all needed info about installation at all:
Connection: User name: username Workspace name: *unknown* Workspace host: hostname Workspace address: 0.0.0.0 Server address: hostname:11742 Server root: /p4/11/root Server date: 2015/04/03 03:48:39 -0500 CDT Server uptime: 143:30:04 Server version: P4D/LINUX26X86_64/2013.3/822226 (2014/04/08) Server license: COMPANYNAME Software Inc 1925 users (support ends 2015/10/30) Server license IP: 0.0.0.0 Monitor: enabled Proxy Version: P4P/LINUX26X86_64/2014.1/821990 (2014/04/08) Server case handling: sensitive peerAddress: 0.0.0.0:49489 externalAuth: enabled serverServices: standard proxyAddress: 0.0.0.0:11842 proxyRoot: /p4p/11/root
Package Versioning
can be useful only for testing purposes
Windows
\*getPackageList Perforce Server Components 142.101.4956 x86_64
Linux
- none Installs by \-untar with bin, no packages.
Licensing
- Licensing information is contained in a file called license in the server root directory. The license file is a plain text file supplied by Perforce Software.
- Without the license file, the service limits itself to either 20 users and 20 client workspaces (and unlimited files), or to an unlimited number of users and workspaces (but with a limit of 1000 files). You can update an existing file without stopping Perforce by using the p4 license command. See Adding new licensed users for details.
- If the service is running, any user can use p4 info to view basic licensing information. Administrators can use p4 license \-u to obtain more detailed information about how many users and files are in use.
- If the service is down, you can can also obtain licensing information by running p4d \-V from the server root directory where the license file resides, or by specifying the server root directory either on the command line (p4d \-V \-r server_root) or in the P4ROOT environment variable.
Linux
Licence cmd
[root@testcentos perforce]# ./p4 license -u ... isLicensed no ... userCount 2 ... userLimit unlimited ... userSoftLimit 20 ... clientCount 1 ... clientLimit unlimited ... clientSoftLimit 20 ... fileCount 4 ... fileLimit unlimited ... fileSoftLimit 1000
Windows
Licence cmd
C:\Program Files\Perforce\Server>p4.exe license -u ... isLicensed no ... userCount 2 ... userLimit unlimited ... userSoftLimit 20 ... clientCount 1 ... clientLimit unlimited ... clientSoftLimit 20 ... fileCount 1 ... fileLimit unlimited ... fileSoftLimit 1000
P4toDB
Perforce integration with SQL databases. May connect to the MySQL but this ver. is too old (Feb 08, 2010) : [http://www.perforce.com/blog/100208/introducing-p4todb-perforce-integration-sql-databas]
P4PORT = localhost:5000 P4USER = perforce DRIVER = com.mysql.jdbc.Driver URL = jdbc:mysql://localhost/p4todb?user=p4todb&password=password