How to escape single quotes from a string caused by single quotes
Suppose you have a Bash alias for example:
alias rxvt='urxvt'
Good results.
However:
alias rxvt='urxvt -fg '#111111' -bg '#111111''
It will not work, nor will it:
alias rxvt='urxvt -fg \'#111111\' -bg \'#111111\''
So, once the quotes are escaped, how do you eventually match the start and end quotes in the string?
alias rxvt ...
Posted by shlomikalfa on Sat, 14 Dec 2019 21:00:15 -0800
Redis source reading notes - server startup and initialization
Start of server
The main function of Redis server is in server.c.
// server.c
int main(int argc, char **argv) {
struct timeval tv;
int j;
/* Set some constants of the server */
/* We need to initialize our libraries, and the server configuration. */
#ifdef INIT_SETPROCTITLE_REPLACEMENT
spt_init(argc, argv);
#endif
setl ...
Posted by jeff_papciak on Tue, 10 Dec 2019 00:11:57 -0800
dlfcn library related learning in Linux
Blog move, original address: Learning dl Library in https://langzi989.github.io/2017/10/16/Unix/
In Linux, static link library and dynamic link library are two ways of code sharing between processes. Linux provides system calls to load and process dynamic connection libraries in the < dlfnc. H > library, which is very conv ...
Posted by CloudSex13 on Sat, 07 Dec 2019 08:07:01 -0800
Realize the connection between Golang and Erlang (Port)
title: realize the connection between Golang and Erlang (Port)
categories: Golang
In Erlang, there are many ways to interact with other languages. The common ways are
Interaction using TCP protocol
Using Port
Using ERL? Interface to realize
CNode
NIF
The latter several kinds of difficulties are all there, but also use a more complex C/C + +, ...
Posted by tha_mink on Fri, 06 Dec 2019 14:36:07 -0800
See asyncio source code
[toc]
Example:
In [1]: import asyncio
In [2]: async def f(i):
...: await asyncio.sleep(i)
...: print(i)
...:
In [3]: async def func():
...: tasks = []
...: for i in range(10):
...: await asyncio.sleep(0)
...: print('create process parameter ', i)
...: tasks.append(asyncio.crea ...
Posted by ShanesProjects on Thu, 05 Dec 2019 09:14:47 -0800
Make a chat room with gorilla websocket
This demo implements:
Message broadcasting
Heartbeat detection
Chat via command line
The specific logic is in websocket.go
The core here is the global variable aliveList, which is responsible for distributing messages to clients. Events are passed through channel s to reduce blocking
A single link will be registered in the Livelist, and ConnL ...
Posted by coderage on Sun, 01 Dec 2019 05:49:22 -0800
Python? Faker creates fake data
Reprint: https://www.cnblogs.com/hellangels333/p/9039784.html
faker creates fake data
In our work, sometimes we need to forge some fake data. How to use Python to forge these seemingly true fake data?
Python has a package called Faker, which can be used to easily forge names, addresses, phone numbers and other information.
...
Posted by james182 on Sat, 30 Nov 2019 10:09:12 -0800
Supervisor's installation and management of tomcat process under CentOS7
Before installation, please ensure that your server can access the Internet normally, and the firewall is closed. Turn off selinux
1. Supervisor installation
yum install python-setuptools //Installation dependency
easy_install supervisor
mkdir /etc/supervisord.d/ //Create directory
cd /etc/supervisord.d/
echo_supervisord_con ...
Posted by sunnypal on Sat, 30 Nov 2019 08:53:55 -0800
A tool for a long time in silence: supervisor
Note that since the supervisor cannot monitor the background program, all commands executed by the command need to be executed in the foreground, such as nginx: command = /usr/local/bin/nginx -g 'daemon off;'
Talk about the benefits of this tool:Manage your process, terminate the automatic restart service process abnormallyTurn off the machine ...
Posted by nwoottonn on Fri, 29 Nov 2019 10:20:32 -0800
Python monitoring server edge -- psutil
In addition to installing some commonly used monitoring software, the monitoring of the server sometimes needs to run some shell or Python scripts; under the shell, you can use the system's own shell commands such as ps/free/top/df, and python can call subprocess and other modules to run shell commands, but it is more troublesome to do so. Here ...
Posted by cwetherbee on Fri, 29 Nov 2019 05:48:58 -0800