[Python 3 notes] about os.path.isabs()
Let's take a look at some examples of using os,path.isabs():
Obviously, the first path is no problem, but it is followed by a string of characters I typed casually. Why do some return True and others return False?
I checked the documentation of Python 3.5 and found the following sentence:
os.path.isabs(path)
Return True if path is an absolu ...
Posted by Krazy-j on Fri, 03 Jan 2020 09:19:52 -0800
Linux work note 027 -- centos7.3 view the port number occupied by tomcat
JAVA technology exchange QQ group: 170933152
Take a look at the figure below. Execute two commands. First find the pid of tomcat, and then find the port according to the pid
It can be seen as follows:
1. Check the process number of tomcat first
ps -ef | grep tomcat*
The * sign is followed to view multiple tomcat, such ...
Posted by desmortes on Fri, 03 Jan 2020 06:20:29 -0800
day43: Apache domain name jump, user authentication and access format
1. apapche user authentication: you need to enter a user name and password when you visit the website, and you can access it only after the authentication is passed, which increases the security: for example, manage the access to the background:
1. First, make authentication for the root directory: that is to say, when you visit the website, y ...
Posted by Plex on Wed, 01 Jan 2020 17:33:41 -0800
glide installation dependency error Cannot detect VCS
Today, when using glide to install golang project dependencies, an error is reported as follows: (the second time, make a record today)
[ERROR] Failed to set version on golang.org/x/sys/unix to : Cannot detect VCS
[ERROR] Failed to set version on golang.org/x/text/transform to : Cannot detect VCS
[ERROR] Failed to set version on golang.org/x ...
Posted by chatmaster on Wed, 01 Jan 2020 00:25:28 -0800
Centos7 supervisor installation and configuration
Background
#
Two, installation
1. Install Python setuptools
yum install python-setuptools
#After the installation of supervisor, three executors will be generated: Supervisor TD, supervisor CTL and echo supervisor conf. they are the supervisor's daemons service (for receiving process management commands), the clien ...
Posted by ict on Tue, 31 Dec 2019 04:00:30 -0800
Introduction to python Library - python daemon: a tool to implement python background program
brief introduction
Python daemon implements Unix daemons. Reference resources: PEP 3143
This library implements the good behavior daemons specification of PEP 3143 "standard daemons library".
The DaemonContext instance stores the behavior of the program and the configured process environment.
quick get start
import time
...
Posted by TCovert on Mon, 30 Dec 2019 08:27:19 -0800
Go language 150 lines of code to handle Apple Apns high concurrent push
Apple news push Apns is a barrier that every apple app must face. At present, small projects need to push messages to all users regularly. Previously, we used pyapns, a third-party library of python, to implement it. As a result, we found that the memory consumption was very high and the push was not stable. Often, the mobile p ...
Posted by pahikua on Sun, 29 Dec 2019 10:32:58 -0800
How do I change directories (CDS) in Python?
cd as in a shell command to change the working directory.
How do I change the current working directory in Python?
#1 building
This is an example of a context manager changing a working directory. It's more than anything else ActiveState version It's simple, but it can do the job.
Context manager: cd
import os
class cd:
""" ...
Posted by Darkness Soul on Sun, 29 Dec 2019 06:02:26 -0800
Propagate all parameters in bash shell script
I'm writing a very simple script that will call another script and need to propagate parameters from the current script to the executing script.
For example, my script name is foo.sh and calls bar.sh
foo.sh:
bar $1 $2 $3 $4
How do I do this without explicitly specifying each parameter?
#1 building
#!/usr/bin/env bash
while [ " ...
Posted by fallen00sniper on Fri, 27 Dec 2019 11:05:11 -0800
PG fdw connection establishment and closure
PG starts psql locally, accesses external tables, and exits
The connection between PG and remotePG is broken as the client psql exits.
PG starts multiple psqls locally, and each psql accesses the external table once
View remotePG process
postgres@ubuntu:~$ ps -ef|grep post
root 134 89 0 09:36 pts/0 00:00 ...
Posted by jollyjumper on Sun, 22 Dec 2019 07:41:52 -0800