Brief introduction to the construction of redis cluster

Environmental Science Operating system: CentOS 7.3 Redis version: Redis 3.2.8 Two hosts, three nodes on each host Basic steps Download and unzip the installation package # Download and unzip the installation package wget http://download.redis.io/releases/redis-3.2.8.tar.gz tar -zxvf redis-3.2.8.tar.gz Build install # Normal compi ...

Posted by j9sjam3 on Fri, 01 May 2020 15:54:19 +0200

The beginnings of the rule engine Drools drools

1. Origin of the Rule Engine One day the operation wants to develop a credit strategy to calculate the extra credit amount according to the following rules: The original price of the order is less than 100 without additional points. 100-500 plus 100 points; 500-1000 plus 500 points; 1000 plus 1000 ...

Posted by Ausx on Thu, 12 Mar 2020 05:44:06 +0100

Error messages for Rails custom validation

The default error messages of Active Record authentication assistant methods are all in English. In order to improve the user experience, sometimes we are often required to display error messages according to specific text. There are two ways to achieve this. 1. Directly add a copy in: message class User < ActiveRecord::Base validates :ema ...

Posted by pikemsu28 on Fri, 31 Jan 2020 14:53:28 +0100

How do I call controller / view methods from the console in Ruby on Rails?

When I load script/console, sometimes I want to play with the controller's output or view assistant methods. There are ways to: Simulation request? Call the method from the controller instance on the request? Test assistant method by controller instance or other means? #1 building To call the helper, use the helper object ...

Posted by asuamol on Thu, 30 Jan 2020 11:59:15 +0100

[python notes] 5. Dictionary

1. Dictionaries Dictionaries can associate related information aline_0={'color':'green','points':5} print(aline_0['color']) print(aline_0['points']) output green 5 2. Use a dictionary A dictionary is a series of key-value pairs, each of which is associated with a value. You can use keys to access ...

Posted by simflex on Wed, 29 Jan 2020 03:38:14 +0100

[Python3 Crawler] Crawl records of JS-encrypted data at once

1. Preface This is a record of cracking JS encrypted data on a website at: https://www.qimingpian.cn/finosda/event/einvestment To get the investment event information on this page, you can first confirm that the data is transmitted through AJax, not written directly in the source code of the web page.   2. Steps 1. Grab a bag Open the develop ...

Posted by k4pil on Thu, 16 Jan 2020 03:39:27 +0100

Node sass generates source map / listening file

Node sass generates source map / listening file 0. Irrelevant (can be skipped) Problems encountered - > > I don't know how to use node sass to generate the source map file. It can be generated directly in my local ruby environment But now the project is to change all the saas files compiled in ruby to node sass. The ...

Posted by Invincible on Fri, 03 Jan 2020 20:25:54 +0100

Configure redisCluster cluster

1. Install Redis image docker pull yyyyttttwwww/redis 2. Create net2 network segment docker network create --subnet=172.19.0.0/16 net2 3 create a node Redis container #Rename the redis image: docker tag docker.io/yyyyttttwwww/redis redis #Delete old redis docker rmi docker.io/yyyyttttwwww/redis #Create 6 redis containe ...

Posted by shana on Sat, 14 Dec 2019 19:18:14 +0100

Effectively use Git and Dropbox at the same time?

How to use them together effectively Git and Dropbox ? #1 building I ran into a similar problem and created a small script for it. The idea is to use Dropbox with Git as simply as possible. At present, I have realized it quickly Ruby Code, and I'll add more code soon. The script is available at https://github.com/nuttylabs/box-git. ...

Posted by Hitoshi on Wed, 11 Dec 2019 19:35:10 +0100

Several ways to export and import redis data

Several ways to export and import redis data 1 environmental description: 192.168.1.101 node1 redis source instance 192.168.1.102 node2 redis target instance 192.168.1.103 node3 any linux system 2 redis dump mode 2.1 installation of RVM Redis dump needs to use ruby, and the maximum version of ruby that can be installed in centos environment ...

Posted by eddie_twoFingers on Thu, 05 Dec 2019 07:02:06 +0100