god

字符串的一些内置方法和简单的异常处理

青春壹個敷衍的年華 提交于 2019-11-28 22:50:30
字符串内置方法 只有字符串可以用,列表不能用 索引取值 s = 'i am god' print(s[0]) # i 切片 print(s[0:5]) # i am 成员运算 判断是否在字符串中 print('god' in s) #ture print('zz' in s) #false for循环遍历字符串 for i in s: print (i) #i a m g o d len()方法统计字符串字符个数 print(len(s)) #8 接下来是字符串 .出来的放法 .strip()方法去掉字符串两端的空格 s = ' i am god ' print(s.strip()) #'i am god' s = '*** i am god ***' print(s.strip('*'))#去掉* print(s.strip('n*'))#去掉 和* .lstrip()/rstrip()方法去掉左端/右端空格 s = '***i am god***' print(s.lstrip('*'))#'i am god***' print(s.rstrip('*'))#'***i am god0' startswith()/endswith()以···开头/以···结尾 s = '***i am god***' print(s.startswith('*'))#true print(s

Using God to monitor Unicorn - Start exited with non-zero code = 1

点点圈 提交于 2019-11-27 12:55:35
问题 I am working on a God script to monitor my Unicorns. I started with GitHub's examples script and have been modifying it to match my server configuration. Once God is running, commands such as god stop unicorn and god restart unicorn work just fine. However, god start unicorn results in WARN: unicorn start command exited with non-zero code = 1 . The weird part is that if I copy the start script directly from the config file, it starts right up like a brand new mustang. This is my start command

How to monitor delayed_job with monit

China☆狼群 提交于 2019-11-27 09:59:50
Are there any examples on the web of how to monitor delayed_job with Monit ? Everything I can find uses God , but I refuse to use God since long running processes in Ruby generally suck. (The most current post in the God mailing list? God Memory Usage Grows Steadily .) Update: delayed_job now comes with a sample monit config based on this question. Luke Francl Here is how I got this working. Use the collectiveidea fork of delayed_job besides being actively maintained, this version has a nice script/delayed_job daemon you can use with monit. Railscasts has a good episode about this version of

How to monitor delayed_job with monit

跟風遠走 提交于 2019-11-26 14:58:53
问题 Are there any examples on the web of how to monitor delayed_job with Monit? Everything I can find uses God, but I refuse to use God since long running processes in Ruby generally suck. (The most current post in the God mailing list? God Memory Usage Grows Steadily.) Update: delayed_job now comes with a sample monit config based on this question. 回答1: Here is how I got this working. Use the collectiveidea fork of delayed_job besides being actively maintained, this version has a nice script