ALERT - [MyServer/check_log] - Check failed to run: invalid byte sequence in US-ASCII, ["/etc/sensu/plugins/check-log.rb:187:in `match'", "/etc/sensu/plugins/check-log.rb:187:in `match'", "/etc/sensu/plugins/check-log.rb:187:in `block in search_log'", "/etc/sensu/plugins/check-log.rb:184:in `each_line'", "/etc/sensu/plugins/check-log.rb:184:in `search_log'", "/etc/sensu/plugins/check-log.rb:136:in `block in run'", "/etc/sensu/plugins/check-log.rb:130:in `each'", "/etc/sensu/plugins/check-log.rb:130:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-plugin/cli.rb:56:in `block in <class:cli>'"] .
But there is nothing wrong with the log file itself. No binary characters and any other rubbish.
I fixed it by removing the related file in the check log job’s state directory.
]]>cask
to install projectile
. But projectile
projects says I need to use package.el
. I have misunderstood the use of cask
– It is for the dependency management of package development
]]>The goal of the #5 speech is about using body language and gesture to tell a story. I suppose the best way to do it is to talk about something exciting and uplifting. Then I can wave my arms like this. Maybe I can go around here truly excited. But somehow I want to set the a bar a bit higher. I want to do something different. I actually want to talk about boring, not-interesting. Something people don’t want to think too much about. Something rather depressing and sad.
Dear fellow toastmasters and guest, I would like to talk today is Getting Old. Yes, G-e-t-t-i-n-g O-l-d.
How many of you have looked forward to getting old when you are teenager? Exactly what I thought. None. When we are young, growing old is such an alien concept. To live like a 60 years old or older is simply beyond imagination.
But somehow, someone would like to remind you actually your biological clock is ticking.
This someone is none other than your passive aggressive … BODY!
I got my first notice not long ago: Hair is growing inside my ears! To me it is absolutely absurd for hair to grow inside my ears. What is point of having hair in the ears? I don’t even feel cold inside my ears! I will assert that hair has absolutely no business whatsoever inside the ears. That’s right. There I said it! [Wave fist] But somehow there they are. They are growing inside the ears. Then the hair in the nostril joins the party. Maybe somehow they don’t like the damp environment anymore. They start to grow longer and longer. Kind of feel like they want to retire and move to the sunshine coast and enjoy more sun.
The problem does not stop here. For the lucky ones gary hair starts to take over, “Snow on the roof” as you may call it. Not sure if they got snow in the basement too but I am not keen to find out.
I suppose to wink here but I think I gonna scare the ladies, since I am already on a rather uncomfortable, hairy subject here. I’ll probably look creepy.
For the unlucky ones, like me, the hair simply goes Missing in Action. The receding hair line is going backward like the French army in WWII. They are disappearing rapidly like the water in a water hole in a drought season. Looking myself in mirror I understand why hair growth industry is such a multi-billion dollar business. If nothing works, I can understand why to some combover is an option.
Of course, on a serious note, ageing is actually no a laughing matter. As a matter of fact, more and more resources are devoted to the study of ageing. I did a quick search on google scholar. Merely 30 years ago, there were roughly 50,000 medical papers on ageing. But in recent years, number of papers has grown to 200,000 ~ 250,000. The focus of research has changed as well. The focus has changed from longevity and life expectancy to more qualitative aspect of ageing such as quality of life. While modern medicine is capable of keeping us healthy for longer, degenerative disease like dementia can have huge impact on the patient and his/her carer. Another shift of focus is from addressing the symptom of ageing to deeper understanding of the mechanism of ageing. For example, the Sydney based biomedical researcher David Sinclair has made a breakthrough in the understanding of the ageing process at the DNA level. As we know, DNA controls the formation of cell by turning certain on and off. And depends on the gene expression we have different kind of cells like liver cell, skin cell and brain cell. Sinclair discovers that for human, our DNS is programmed to turn on all the genes when we ages. It causes damages to our gene. More importantly Sinclair discovered a molecules known as SIR2, which stands for Silent Information Regulator 2, that can turn off these genes that should not be turned on. Or in the other word, we can reverse the aging process!
Oh, wait a minute, there is a good news when talking about getting old after all! [Arm waving!]
In the end Aging is not just about your body, it is about you mind too. I would like share this saying about getting old with you: “You become old when all your dream and hope is replaced by regrets”
]]>parent
property of the WebElement, however, will give you an instance of WebDriver.
You can find this out by
parent = element.find_element_by_xpath('..')
]]>It’s the story of a place called Mouseland. Mouseland was a place where all the little mice lived and played, were born and died. And they lived much the same as you and I do.They even had a Parliament. And every four years they had an election. Used to walk to the polls and cast their ballots. Some of them even got a ride to the polls. And got a ride for the next four years afterwards too. Just like you and me. And every time on election day all the little mice used to go to the ballot box and they used to elect a government. A government made up of big, fat, black cats.
Now if you think it strange that mice should elect a government made up of cats, you just look at the history of Canada for last 90 years and maybe you’ll see that they weren’t any stupider than we are. Now I’m not saying anything against the cats… They passed good laws -– that is, laws that were good for cats. But the laws that were good for cats weren’t very good for mice… They voted the black cats out. They put in the white cats. Now the white cats had put up a terrific campaign. They said: “All that Mouseland needs is more vision.” They said:“The trouble with Mouseland is those round mouseholes we got. If you put us in we’ll establish square mouseholes.” And they did. And the square mouseholes were twice as big as the round mouseholes, and now the cat could get both his paws in. And life was tougher than ever… Presently there came along one little mouse who had an idea. My friends, watch out for the little fellow with an idea. And he said to the other mice, “Look fellows, why do we keep on electing a government made up of cats? Why don’t we elect a government made up of mice?” “Oh,” they said, “he’s a Bolshevik. Lock him up!” So they put him in jail.
But I want to remind you: that you can lock up a mouse or a man but you can’t lock up an idea.
]]>gem
$ pod install
[!] Your Podfile requires that the plugin `cocoapods-keys` be installed. Please install it and try installation again.
$ sudo gem install cocoapods-keys
]]>I want to add a line to the /etc/apache2/envvars. However I did not install this file using a cookbook. I installed it by package apach2
. So partial template does not work for me.
I usds FileEdit
instead
Having look through the apache2
cookbook, I start to feel chef cookbook replicates a lot of what a dpkg
is currently doing. Does it mean the downstream maintainer have to keep the cookbook up to date with various package management systems on every other platform?
https://github.com/danielsdeleo/partials
https://docs.chef.io/resource_template.html#partial-templates
]]> ==> default: [2015-03-14T22:04:52+00:00] INFO: Running queued delayed notifications before re-raising exception
==> default: [2015-03-14T22:04:52+00:00] ERROR: Converge failed with error message undefined local variable or method `role' for #<Chef::Mixin::Template::Temp
lateContext:0x000000032e4368>
==> default: [2015-03-14T22:04:52+00:00] DEBUG: Re-raising exception: Chef::Exceptions::RunFailedWrappingError - Found 1 errors, they are stored in the backtr
ace
==> default: 1) Chef::Mixin::Template::TemplateError - undefined local variable or method `role' for #<Chef::Mixin::Template::TemplateContext:0x000000032e436
8>
This is my template
resource:
template '/etc/profile.d/server-env.sh' do
source 'server/profile-env.erb'
variables(
:role => role
)
end
This is my template file profile-env.erb
:
set APP_ROLE=<%= role -%>
]]> 2015-03-13 08:12:51.087 Counter[9123:418395] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "9pv-A4-QxB-view-tsR-hK-woN" nib but didn't get a UITableView.'
]]>Thanks Chair.
Dear fellow toastmasters and guest. Welcome to our table topic segment
Table Topic is about impromptu speaking. I will invite 8 of us to come forward and speak to us on the spot for 1 min, on topic I will reveal just before you’re picked.
The purpose of the table topic is to help us to develop our ability to organize our thoughts quickly and respond to an impromptu question or topic. That’s why we don’t want the Table Topic participant to just ramble for a minute, just saying one word after another.
In fact, a good table topic should appear well-organised. It should have an opening, a body and a conclusion.
You will have a minute of time to give your speech. The ember light will come on at 45sec. The red will come on at 1 minute. If you hit the one minute mark, I’d appreciate if you can wrap up immediately. It is because in a real TT contest, overtime will result in disqualification. We also want to keep the meeting time under control.
For the even number speakers we will have [XXX] as the evaluator. For the odd number speakers we will have [YYY] as the evaluator.
Without further ado, let’s start!
The theme of tonight’s Table Topic: What will you do if you receive an unexpected fortune? I will give you different scenario and let see how you will handle it.
Situation number one: You are one lucky Toastmaster. You stumbled upon a genie in a bottle and you have released it from years of confinement. He can grant you a wish, but you have to choose between one of these two choices: Stay young forever or have abundant wealth. How would you choose? [Stay young forever or have abundant wealth]
Look like we have yet another lucky toastmaster. Another TM stumbled upon a genie in a bottle. Unfortunately this genie’s power is bit limited. You are given two choices again, but they are: to become a boss of a bottle shop or a car wash business. Which one would you choose? [Bottle shop or car wash?]
Looks like another toastmaster strikes it lucky too! Another genie in a bottle is found! Again there are two things to choose from: You can have a beautiful voice like Susan Boyle that will let you make millions out of singing, but a face like the Orc from Lord of the ring; or you can have a good look like Emma [Mma] Watson or Brad Pitt that will let make millions out of acting, but a voice like an Orc from Lord of the Ring. How would you choose? [Beautiful voice or beautiful face]
You will not believe the luck of this club! One more fellow Toastmaster find a genie in a bottle! But oh no, it is the small business genie again. Now you have a choice between a fish and chip shop and a pizza restaurant. Which one will you choose and why? [fish and chip or pizza]
Tonight is the night of genie! Yet another fellow Toastmaster has rescued a genie! This genie has a gift in languages and he can make you instantly fluent in either one of these three languages: Spanish, Italian or Russian. Which one will you choose and why? [Spanish, Italian or Russian]
We are on a roll! Another Toastmaster has saved a genie again! On no, guess what, it is the small business genie again! Apparently he keeps getting back into a bottle because of tax evasion! Again you can choose between these two choices: a new apple iphone every year or a new samsung galaxy every year. How would you choose? [Apple or Samsung]
Finally there is no more genie in a bottle to be found. However when you are walking on beach looking out for a bottle, you run into this legendary Nigerian prince! You gave him 50 bucks and he gave you back a princely sum of 20 million aussie right away. How are you going to spend the 20 million dollars?
We all know what is at the end of a rainbow! You are the lucky fellow who have reached the end of the rainbow and found the pot of gold! What will you do with the pot of gold?
$ packer build -var 'aws_access_key=ABC' -var 'aws_secret_key=XYZ' my-basebox.json
amazon-ebs output will be in this color.
==> amazon-ebs: Inspecting the source AMI...
==> amazon-ebs: Creating temporary keypair: packer 54fc1177-7d3f-51fe-03ea-f16fea52ec2d
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing SSH access on the temporary security group...
==> amazon-ebs: Launching a source AWS instance...
amazon-ebs: Instance ID: i-ead72be7
==> amazon-ebs: Waiting for instance (i-ead72be7) to become ready...
==> amazon-ebs: Waiting for SSH to become available...
==> amazon-ebs: Connected to SSH!
==> amazon-ebs: Provisioning with chef-solo
amazon-ebs: Installing Chef...
amazon-ebs: % Total % Received % Xferd Average Speed Time Time Time Current
amazon-ebs: Dload Upload Total Spent Left Speed
amazon-ebs: 100 18378 100 18378 0 0 48243 0 --:--:-- --:--:-- --:--:-- 48363
amazon-ebs: Downloading Chef for ubuntu...
amazon-ebs: downloading https://www.opscode.com/chef/metadata?v=&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64
amazon-ebs: to file /tmp/install.sh.1372/metadata.txt
amazon-ebs: trying wget...
amazon-ebs: url https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_12.1.0-1_amd64.deb
amazon-ebs: md5 b86c3dd0171e896ab3fb42f26e688fef
amazon-ebs: sha256 9bbde88f2eeb846a862512ab6385dff36278ff2ba8bd2e07a237a23337c4165a
amazon-ebs: downloaded metadata file looks valid...
amazon-ebs: downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_12.1.0-1_amd64.deb
amazon-ebs: to file /tmp/install.sh.1372/chef_12.1.0-1_amd64.deb
amazon-ebs: trying wget...
amazon-ebs: Comparing checksum with sha256sum...
amazon-ebs: Installing Chef
amazon-ebs: installing with dpkg...
amazon-ebs: dpkg: error: requested operation requires superuser privilege
amazon-ebs: Installation failed
amazon-ebs: Version:
amazon-ebs:
amazon-ebs: Please file a Bug Report at https://github.com/opscode/opscode-omnitruck/issues/new
amazon-ebs: Alternatively, feel free to open a Support Ticket at https://www.getchef.com/support/tickets
amazon-ebs: More Chef support resources can be found at https://www.getchef.com/support
amazon-ebs:
amazon-ebs: Please include as many details about the problem as possible i.e., how to reproduce
amazon-ebs: the problem (if possible), type of the Operating System and its version, etc.,
amazon-ebs: and any other relevant details that might help us with troubleshooting.
amazon-ebs:
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' errored: Error installing Chef: Install script exited with non-zero exit status 1
==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Error installing Chef: Install script exited with non-zero exit status 1
==> Builds finished but no artifacts were created.
Check the following:
prevent_sudo
is not set to trueinstall_command
and execute_command
are set, make sure they use sudo
$ brew install emacs
==> Downloading https://homebrew.bintray.com/bottles/emacs-24.4.yosemite.bottle.3.tar.gz
######################################################################## 100.0%
==> Pouring emacs-24.4.yosemite.bottle.3.tar.gz
==> Caveats
To have launchd start emacs at login:
ln -sfv /usr/local/opt/emacs/*.plist ~/Library/LaunchAgents
Then to load emacs now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.emacs.plist
==> Summary
🍺 /usr/local/Cellar/emacs/24.4: 3914 files, 104M
]]>wmic
is a command line tool. gwmi
stands for ‘get-WMIObject`, a command of Powershell.
]]>Summary of the remedy:
1. Download
https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem
2. Find out installation location
C:\>gem which rubygems
C:/Ruby21/lib/ruby/2.1.0/rubygems.rb
3. Install the file
Then just copy the .pem file into ../2.1.0/rubygems/ssl_certs/
wget
or curl
preinstalled. So to download a file from internet I do
lynx -source url > file.txt
]]>Windows is not suitable for datacenter.
]]>I want to dump some output from powershell. It is a very common task but somehow Powershell takes the liberty to truncate the output based on arbitrary condition.
Apparently when I am testing the powershell script I use a resized and large DOS prompt for my work.
Use of ft -autoresise
prints the full string of the Commandline field in one line. It is what I need. wrap
or nowrap
does not produce desired result.
After testing is done, I deploy the script to run as a background task.
Now powershell decides it wants to truncate the commandline field. Now I am getting some “c:\some\path…” instead of the full path of the executables.
Utter maddenss. A waste of everyone’s time!
Solution:
ft -AutoSize | out-string -width 4096
]]> /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:950:in `check_response': 454 4.7.0 TLS not available due to local problem (Net::SMTPServerBusy)
from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:919:in `getok'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:819:in `starttls'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:561:in `do_start'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/smtp.rb:519:in `start'
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:2141:in `do_delivery'
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/message.rb:238:in `deliver'
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mail-2.6.3/lib/mail/mail.rb:140:in `deliver'
from /etc/sensu/handlers/notification/mailer.rb:138:in `block in handle'
from /opt/sensu/embedded/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
from /opt/sensu/embedded/lib/ruby/2.0.0/timeout.rb:97:in `timeout'
from /etc/sensu/handlers/notification/mailer.rb:137:in `handle'
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:55:in `block in <class:Handler>'
After checking the mail log, I found these errors:
Mar 1 04:19:20 ip-172-31-37-216 postfix/smtp[7642]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen('/etc/postfix/cacert.pem','r'):
Mar 1 04:19:20 ip-172-31-37-216 postfix/smtp[7642]: warning: TLS library problem: error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:172:
Mar 1 04:19:20 ip-172-31-37-216 postfix/smtp[7642]: warning: TLS library problem: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib:by_file.c:274:
So here is a solution:
sudo openssl req -new -x509 -nodes -out cacert.pem -keyout cacert.pem -days 3650
]]>