god

第八课 正则表达式

末鹿安然 提交于 2020-02-09 17:32:48
正则表达式 示例1(新建名为grep.txt文件) ooxx12121212ooxx ooxx 12121212 oox 12121212 1212 ooxx 1212 oo3xx oo4xx ooWxx oomxx $ooxx oo1234xx ooxyzxx 键入如下命令 grep "\(^[0-9]\|[^0-9][0-9]\)[0-9]\{2\}\([0-9][^0-9]\|[0-9]$\)" grep.txt grep -E "^[0-9]{4}[^0-9]|[^0-9][0-9]{4}[^0-9]|[^0-9][0-9]{4}$|^[0-9]{4}$" grep.txt 示例2(新建test文件) aaabbcaaa aa bbc aaa bb bbc bbb asgodssgoodsssagodssgood asgodssgoodsssagoodssgod sdlkjflskdjf3slkdjfdksl slkdjf2lskdjfkldsjl 键入如下指令 cat test 51 grep "a" test 52 grep "a\{3\}" test 53 grep "\<aaa" test 54 grep "\<aaa\>" test 55 grep "b" test 56 grep "b\{2,3\}" test 57 clear 58 cat test 59

God configuration file to monitor existing processes?

半城伤御伤魂 提交于 2019-12-23 03:07:45
问题 I am monitoring my redis server using God (a Ruby gem). However, my existing server may already has an instance of redis up. How can I be sure it monitors the existing Redis server process that is already up? This is my God file for redis: rails_root = ENV['RAILS_ROOT'] redis_root = "/usr/local/bin" # Redis %w{6379}.each do |port| God.watch do |w| w.name = "redis" w.interval = 30.seconds w.start = "#{redis_root}/redis-server /etc/redis/redis.conf" w.stop = "#{redis_root}/redis-cli shutdown" w

Rubygem God: Time limit configuration for process

断了今生、忘了曾经 提交于 2019-12-08 03:20:41
问题 I am using resque, resque-scheduler gems in my rails app. To monitor the working of resque workers, I am using God tool. I want to add such a god configuration, which will monitor the time of job running in the resque worker. If process execution exceeds the time limit, then it should restart the worker. I read post at http://god.rubyforge.org/. However, couldn't peek the right code base for my requirement. Any information will be highly appreciated. Thanks. 回答1: You could do something where

God not running: The server is not available (or you do not have permissions to access it)

北城余情 提交于 2019-12-05 01:04:26
问题 I'm attempting to get god to start up my resque queue. However when I run god load config/resque.god it returns The server is not available (or you do not have permissions to access it) This is my resque.god file: rails_env = ENV['RAILS_ENV'] || "production" rails_root = ENV['RAILS_ROOT'] || "/Users/andrewlynch/sites/wellness/wellbot" God.watch do |w| w.name = "resque-worker" w.group = "resque" w.interval = 60.seconds w.dir = "#{rails_root}" w.start = "RAILS_ENV=development QUEUE=* rake

God not running: The server is not available (or you do not have permissions to access it)

余生颓废 提交于 2019-12-03 17:30:35
I'm attempting to get god to start up my resque queue. However when I run god load config/resque.god it returns The server is not available (or you do not have permissions to access it) This is my resque.god file: rails_env = ENV['RAILS_ENV'] || "production" rails_root = ENV['RAILS_ROOT'] || "/Users/andrewlynch/sites/wellness/wellbot" God.watch do |w| w.name = "resque-worker" w.group = "resque" w.interval = 60.seconds w.dir = "#{rails_root}" w.start = "RAILS_ENV=development QUEUE=* rake resque:work" w.start_grace = 30.seconds end god load is use for loading or reloading configurations into an

How to stop God from leaving stale Resque worker processes?

岁酱吖の 提交于 2019-12-03 12:44:33
问题 I'm trying to understand how to monitor the resque worker for travis-ci with god in such a way that stopping the resque watch via god won't leave a stale worker process. In the following I'm talking about the worker process, not forked job child processes (i.e. the queue is empty all the time). When I manually start the resque worker like this: $ QUEUE=builds rake resque:work I'll get a single process: $ ps x | grep resque 7041 s001 S+ 0:05.04 resque-1.13.0: Waiting for builds And this

究竟是要压榨谁?

点点圈 提交于 2019-12-03 09:56:16
假设 在一个相对封闭的社会构成里面,我们假设有一个god能够代表上帝。 推演 这一个god所希望的就是社会长久的延续。 god所采取的策略是在飞速的发展之后,向外太空进军。 由于资源的有限性,god只能采用要求飞速的发展,才能在资源消耗之前,将科技发展到足够外太空航行的程度。 于是,社会就开始处于这一种非常疯狂的竞争与发展的状态之下。 (值得说明的是:社会本身就是一个筛选的体系,god并不关心社会究竟是怎样组成的,god只采用筛选的方法。在一定的生存压力之下,选出能够生存的个体) 结果 我们假设这样的一个god,在现实中完全可以将其视为社会的整体的意志,社会为一个要求就是延续下去,而最常采用的就是压力筛选。 所以,我猜测,社会的整体意志已经可以呈现出来和智慧大脑一样的特征。现在可以将社会作为一个整体来进行研究。 来源: https://www.cnblogs.com/tanguy/p/11787234.html

How to stop God from leaving stale Resque worker processes?

痴心易碎 提交于 2019-12-03 02:14:30
I'm trying to understand how to monitor the resque worker for travis-ci with god in such a way that stopping the resque watch via god won't leave a stale worker process. In the following I'm talking about the worker process, not forked job child processes (i.e. the queue is empty all the time). When I manually start the resque worker like this: $ QUEUE=builds rake resque:work I'll get a single process: $ ps x | grep resque 7041 s001 S+ 0:05.04 resque-1.13.0: Waiting for builds And this process will go away as soon as I stop the worker task. But when I start the same thing with god ( exact

How do you refactor a God class?

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Does anyone know the best way to refactor a God-object? Its not as simple as breaking it into a number of smaller classes, because there is a high method coupling. If I pull out one method, i usually end up pulling every other method out. 回答1: It's like Jenga. You will need patience and a steady hand, otherwise you have to recreate everything from scratch. Which is not bad, per se - sometimes one needs to throw away code. Other advice: Think before pulling out methods: on what data does this method operate? What responsibility does it have?

God vs. Monit [closed]

不问归期 提交于 2019-11-29 18:59:33
Which one to use for process monitoring and why? Both solutions are good, and there are some pros and cons for both of them. God config file is written in Ruby, so you can do basically everything Ruby allows you to do, and it's a lot of stuff. Monit has to be configured using its own syntax, it's usually OK but more restrictive. Anyway, you can also generate monit config with Ruby (as a part of your deployment strategy). Also, monit uses less resources, so if you're on VPS or just don't have any spare memory, monit could be a better choice. Personally, I prefer god, as it's more configurable.