Bash script to monitor and email when a application stops
January 5, 2012Usage: monitor.sh PID MESSAGE EMAIL_ADDRESS
#!/bin/bash while [ -e /proc/$1 ] do sleep 1 done mail -s "$2" $3 < /dev/null
hack \etal is the blog of Nirmal J. Patel.
Usage: monitor.sh PID MESSAGE EMAIL_ADDRESS
#!/bin/bash while [ -e /proc/$1 ] do sleep 1 done mail -s "$2" $3 < /dev/null
A short note on what my grandfathers were to me.
Dada, my father's father. He was a farmer in India and a businessman in America. No matter where his family moved, he always carved out a little garden that produced a disproportionately large amount of vegetables. Even when the family no longer depended on his efforts he put the same amount of work into his small garden as he did with all of his acres in India. Always provide for your family. He was also a very social man. His wit and impeccable memory allowed him to carry on a conversation with anyone, anywhere. He had a gift for remembering everything about you so the next time you met everything just picked up right where it was left. My mother always said, "If he had practiced his English a little more he could easily become a mayor." Last he was a religious man. He spent many hours reading scriptures. He wanted to know as much as he could so that he could best determine his own path. For him, the best way to understand and be a member of our religion was not simple adherence and blind faith. His goal was to deeply understand every facet of our and others' beliefs. To dive deep and know everything. Work is important because it provides for your family. Thinking of others is important because it strengthens your community. Deeply understanding your beliefs is important because it strengthens you.
Dadaji, my mother's father. He was an intellectual through-and-through. He was a civil engineer in India. He had a completely positive outlook and it was a rare and confusing moment to ever see him upset. His focus was always laser sharp on understanding the world through science. Many of my mornings in India were spent discussing various scientific topics. Physics was the primary subject. We focused on the beginnings of everything from the elements to fundamental forces such as gravity. We discussed the evolution of scientific concepts such as Mass/Energy Conservation and Relativity. As concerns about the future on a human timescale became more important to him we often discussed topics in Biology and Chemistry. How can we support everyone on the planet when the gifts of nature are no longer sufficient? What can be done with technologies such as genetic engineering when we barely understand what we are modifying? What about limited water supplies? How can we reverse the effects of global warming while continuing to produce energy at a sufficient level? Not too far from all these questions was the place of religion in a world of science. Was there a happy medium between science and religion? While some around him thought that such resolution to such difficult questions and the mysteries of the universe should be left to God, he, and I, deeply believed that God has left it to us.
My Dada and my Dadaji taught me that life is about many things. To better know yourself, know the world. To better know yourself, know others. To better know yourself, question yourself. Their lessons were implicit in the way they lived. In the end you should be happy, not just with what you've earned, what you've created or how other's feel about you. In the end, you should be happy with the effort you have put forth.
This weekend, Mansi and I got away to see Yosemite National Park. We were really astounded with the beauty of the park. We also found a really nice place to stay. If you can get a room there, we really recommend staying at the Poppy Hill Bed and Breakfast. We were hosted by a wonderful woman named Mary Ellen. Every morning, we had a hot, fresh breakfast and Mary Ellen may be the nicest person in the whole world.
Day 1 - Yosemite Valley
Our first day was all about waterfalls. Drive in on 140E. Stop at Bridleveil Falls as you drive in. The walk from the parking spot to the base of the fall is only 1000 feet so it is a nice start to the morning. Then head on further and park at the Visitor Parking. From here you can use the free shuttle to get all over the valley. We planned on seeing both the Lower Yosemite Falls and Vernal Falls on this day. However, due to a freak thunderstorm we pushed the Vernal Falls to Day 2. I include it here because both are doable on the same day if you get there early and push it. Both are beautiful although be prepared for a bit of a uphill hike to get to Vernal Falls. Climbing on the rocks around the waterfalls can be a lot of fun and great for getting some really nice photos. We did this a lot for Yosemite Falls but didn't for Vernal because the water was pretty fast and just getting there was pretty exhausting. We ended the day by driving up to Tunnel View and watching the sunset from Glacier Point.
Day 2 - Mariposa Grove
Wow! Mansi and I have seen lots of various Redwood forests but nothing prepared us for just how large the sequoias were. We spent a long time hiking all over Mariposa Grove. We were lucky to find a parking spot but you can always take the free shuttle from Wawona. We checked out every tree on the map and more. The one thing we didn't catch on camera was a beautiful deer crossing the trail and not remotely caring about our presence.
Mobile HCI 2011 was held in Stockholm, Sweden. This was the 13th Mobile HCI. This year there were 63 papers and notes for an acceptance rate of 23%. The attendance was the highest ever with 400 registrations.
The first paper that caught my attention was "Intimate Mobiles: Grasping, Kissing and Whispering as a Means of Telecommunication in Mobile Phones". This paper explores how physical cues of nearness could be transmitted by our mobile devices. Imagine a phone that slipped around your hand like a glove and when your conversational partner tensed up the glove tightened around your hand. Or maybe you're away on travel and your spouse wants to give you a goodnight kiss. She kisses her phone and your phone kisses you. While the technology may be years off, there is lesson to be learned here on how we can close the gap between the conversational experience on both sides of what is just now a auditory connection.
Then there was "Unpacking Social Interaction that Make us Adore – On the Aesthetics of Mobile Phones as Fashion Items". Among my colleagues, there was a lot of discussions as to the relevant importance of this paper. On one hand, the authors attempt to show how understanding how mobile technology fits into the trend setting world of fashion is crucial to helping design products. On the other hand, the practicalities of producing hardware at large scale make it seem like our own only option is the custom phone covers market. My take away from this is that there is a powerful market force to be considered in the fashion magazine/blog world but it is probably drowned out by more tangible issues such as carrier plan and base device costs.
With the more touchy-feely things out of the way I strapped in for a session called "Text and Keyboards". Feel free to skip this paragraph if the session name made you yawn. The winner of this session was definitely "Design and Evaluation of Devanagari Virtual Keyboards for Touch Screen Mobile Phones". The paper focused on coming up with techniques for entering Devanagari script on mobile devices. The key insight of this paper is that there is a false jump to optimize for speed of entry. However, in almost all cases, there users were rarely familiar with the mobile technology much less ready to learn an entirely new layout for their language. So while the overall entry rates of their methods were slow at least some text was being entered. I seriously hope they continue down this work and try to create some techniques for non-touchscreen phones as that is still a prominent form factor in India. Other papers of note in this session, "A Versatile Dataset for Text Entry Evaluations Based on Genuine Mobile Emails" and "Script-Agnostic Reflow of Text in Document Images".
Back to something a little more light-hearted, the next session was "Projections and Visualizations". As the session chair stated, a few years ago it would be odd to hear about a session on projection at Mobile HCI but with the arrival of pico projectors the output space of mobile phones is expanding. The first paper, "PoCoMo: Projected Collaboration using Mobile Devices" may have had the best hack I've seen during the entire conference. Multiple users point their phones at a wall to project small cartoon characters that live on their devices. The phones have a sleeve over them that allow the camera to see the projection. By encoding information into the projection itself, both devices can communicate to keep the cartoon characters at the right scale and rotation. Additionally, as the characters get closer, the projection+vision system is used to sync up animations. The projection surface is the network medium. Great hack. The other paper in this session that really struck a chord with me was "Content Splitting & Space Sharing: Collaboratively Reading & Sharing Children’s Stories on Mobile Devices". The authors explore how giving a group of children multiple devices and having them engage in a story reading exercise with multiple configurations of the story pages effects interpersonal engagement. The paper goes into a lot of depth on the various effects of how devices were oriented to each other as well as the effects of activity (creation or consumption) on the engagement.
Then there was "Ubiquitous Sketching for Social Media". The technology is simple. You have an Anoto pen, augmented paper and a smart phone client that will upload an image of what you sketch to your social network. Simple but powerful. From the paper, "Despite its portability, sketching as a social medium has been largely left behind. Given sketching’s unique affordances for visual communication this absence is a real loss. Sketches convey visuo-spatial ideas directly, require minimal detail to render concepts, and show the peculiarities of handwriting." The paper shows how by combining the unique affordances of pen and paper, the expressiveness of a hand drawn sketch and the connecting power of digital communication, users were able to engage in a richer communication with their friends and family.
My final notes are on "The Phone Rings But the User Doesn’t Answer: Unavailability in Mobile Communication". The researchers goal was to better understand the context around unavailability. I really liked the methodology in this paper. The authors installed some simple logging software on participants phones to record instances where phone calls and text messages didn't connect. Then each night, the logging software uploaded this information to a web server and sent the user an email with a web form which solicited contextual information regarding the lapses in communication. Then at the end of the study, the researchers sat down with the participants and went through the data to fill in more gaps in the contextual information. This gave the researchers a very rich representation of otherwise banal log data. The results were interesting with an almost even split between Unavoidable (couldn't hear the phone), Enforced (in a meeting, would be inappropriate to answer) and Intentional (I'm sleeping or at a movie) unavailability. Another interesting outcome of this study was the amount of cross-modal communication, someone misses an incoming phone call but instead of calling back they reply with a SMS or IM. I would really like to see this methodology taken up a notch by logging all notifications that arrive on a device and monitoring how and when a user interacts with them.
So that does it for me and Mobile HCI 2011. The conference was two simultaneous tracks so I'm sure I missed a lot of good work. I encourage everyone to check out the proceedings as soon as they pop up on the ACM Digital Library. Next year the conference will make its jump across the Atlantic to San Francisco, CA. I hope to see everyone there again!
I'll write up my thoughts on Mobile HCI 2011 later but until then, here are a few photos I took while out and about in Stockholm. Due to all of the flight troubles I ended up having a free day before and after the conference. I checked out the Vasa Museum, Sergels Torg, City Hall and Moderna Museet amongst other places. We also so some pretty weird things, including a wall climber statue, a couple of guys hanging off the side of NK playing a vertical tennis game and some interesting views up and down the canals.
Mansi and I went out to Big Sur today for some light hiking (2 miles). We checked out Pfeiffer Falls and Valley View while at Big Sur. We also stopped at a few scenic points on Highway 1. Here's a few photos.
Mount Hermon is this great park in the Santa Cruz hills. Here are a few photos and videos of Mansi and I enjoying the Redwood tree canopy zipline tour. Big thanks to Thad and Tavenner for taking some great photos.
Eric Ridvan Üner pointed me to Safari Keyword Search, a Safari extension that behaves similarly to Keywurl and works with Safari 5.1.
Pros:
Cons:
Also, it does not work side-by-side with the SafariOmnibar Plugin which allows you to get rid of the Google search box. Not a big deal for me, I just shrunk down the Google box as much as possible because my Default query using any keyword searcher is Google.
I've received a few emails about this so I thought it would be best to just make a quick post about it.
Back in June 2010 when Safari 5 came out it was pretty easy to make Keywurl work by just editing the Info.plist file. Details on that hack are here. However, this same hack doesn't really work with Safari 5.1. While it prevents Keywurl from causing an error when Safari 5.1 starts, it does not allow Keywurl to actually fulfill its purpose.
In the meantime, I am using Safari Omnibar which currently just uses non-URL text as input to Google search but aspires to go further and make the Safari location bar functionally identical to the Chrome location bar. To perform keyword searches from anywhere I switched to Alfred (an app similar to Quicksilver or Launchbar), which has custom keyword searches, and wrote a little script to take all of my Keywurl customizations and add them to Alfred.
2) A tag that changes color with exposure to air. The tag can start normal and go clear in the same amount of time as the recommended brew time.