{"id":474,"date":"2009-09-17T10:05:13","date_gmt":"2009-09-17T16:05:13","guid":{"rendered":"http:\/\/thepizzy.net\/blog\/?p=474"},"modified":"2014-01-24T14:40:07","modified_gmt":"2014-01-24T20:40:07","slug":"hamachi-web-status-images","status":"publish","type":"post","link":"https:\/\/thepizzy.net\/blog\/2009\/09\/hamachi-web-status-images\/","title":{"rendered":"Hamachi Web Status Images"},"content":{"rendered":"<h2>Update&#8230;<\/h2>\n<p>Unfortunately, LogMeIn figured out they forgot about that page, I guess when people started reading this post and hitting it on their servers. They have removed the text status as well as all the others, and I can&#8217;t figure out why they would do such a thing.<\/p>\n<p>I&#8217;m also not sure what they&#8217;re offering as an alternative either. So if you know, please leave a comment below. Thanks.<\/p>\n<h2>Depreciated Process&#8230;<\/h2>\n<p>A while back, I started a project called <a href=\"http:\/\/thepizzy.net\/blog\/?s=tsnlocal\">tsn.lcl or tsnlocal<\/a>, but gave up on it when my electricity bill hit $400 in a month.<\/p>\n<p>Today, I decided to fix up the domain name and get it back on the internet &#8211; at least to remove it from GoDaddy&#8217;s Parking Page &#8211; where they&#8217;re making money, not me, off of it.<\/p>\n<p>When I got it <a href=\"http:\/\/tsnlocal.net\" target=\"_blank\">published<\/a> I noticed that none of the Hamachi Web Status images worked anymore, and that the <a href=\"https:\/\/my.hamachi.cc\/status\/image.php?5.28.161.250\">link to such an image<\/a>, redirected to their login page for your Hamachi Management Dashboard. However, upon further investigation, I found that there was not only an Image version of those status instances, but also a <a href=\"https:\/\/my.hamachi.cc\/status\/text.php?5.28.161.250\">text version<\/a>.<\/p>\n<p>I really wanted to show the online status of all my machines again, so I wrote my own php script to parse that text data, and created some simple images to show on the website based on the returned status.<\/p>\n<p>So here&#8217;s the code so you can do the same thing&#8230;<\/p>\n<h2>The PHP Function<\/h2>\n<p>[cc lang=&#8221;php&#8221;]&lt;?php<br \/>\nfunction hamachiImg($ip) {<br \/>\n$url = &#8220;https:\/\/my.hamachi.cc\/status\/text.php?$ip&#8221;;<br \/>\n$status = file_get_contents($url);<br \/>\n$status = preg_replace(&#8216;\/\\d*\\.\\d*\\.\\d*.\\d* \/&#8217;, &#8221;, $status);<br \/>\n$image_url = &#8220;.\/images\/$status.png&#8221;;<br \/>\nreturn $image_url;<br \/>\n}<br \/>\n?&gt;[\/cc]<br \/>\nThis code creates a $url variable with the address to the text status, based on the $ip that is passed to it. Then it requests the data, removes the ip address and the trailing space, leaving only the status text. On the server, I have a collection of images with the 4 different statuses as their file name, and with that an $image_url is created to be returned.<\/p>\n<p>The 4 possible statuses are:<\/p>\n<ul>\n<li><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"hamachi-online\" alt=\"\" src=\"https:\/\/i0.wp.com\/tsnlocal.net\/images\/online.png?resize=16%2C17\" width=\"16\" height=\"17\" \/> &#8211; online<\/li>\n<li><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"hamachi-offline\" alt=\"\" src=\"https:\/\/i0.wp.com\/tsnlocal.net\/images\/offline.png?resize=16%2C17\" width=\"16\" height=\"17\" \/> &#8211; offline<\/li>\n<li><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"hamachi-unknown\" alt=\"\" src=\"https:\/\/i0.wp.com\/tsnlocal.net\/images\/unknown.png?resize=16%2C17\" width=\"16\" height=\"17\" \/> &#8211; unknown<\/li>\n<li><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"hamachi-error\" alt=\"\" src=\"https:\/\/i0.wp.com\/tsnlocal.net\/images\/error.png?resize=16%2C17\" width=\"16\" height=\"17\" \/> &#8211; error<\/li>\n<\/ul>\n<h2>The HTML Code and PHP Function Call<\/h2>\n<p>Once you have your php function in the page (I stuck mine before the first &lt;html&gt; tag), you can use the php function to insert the image url when you pass it an IP&#8230;<br \/>\n[cc lang=&#8221;html&#8221;]&lt;table&gt;<br \/>\n&lt;tr&gt;<br \/>\n&lt;td style=&#8221;width: 100%&#8221;&gt;[[Neo]]:&lt;\/td&gt;<br \/>\n&lt;td style=&#8221;width: 100%&#8221;&gt; &lt;img src=&#8221;&lt;?php echo hamachiImg(&#8216;5.37.117.104&#8217;); ?&gt;&#8221;&gt;&lt;\/td&gt;<br \/>\n&lt;\/tr&gt;<br \/>\n&lt;\/table&gt;[\/cc]<br \/>\n<a href=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi-example.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"477\" data-permalink=\"https:\/\/thepizzy.net\/blog\/2009\/09\/hamachi-web-status-images\/hamachi-example\/\" data-orig-file=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi-example.png?fit=210%2C201&amp;ssl=1\" data-orig-size=\"210,201\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"hamachi-example\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi-example.png?fit=210%2C201&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi-example.png?fit=210%2C201&amp;ssl=1\" class=\"alignright size-full wp-image-477\" title=\"hamachi-example\" alt=\"hamachi-example\" src=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi-example.png?resize=210%2C201\" width=\"210\" height=\"201\" srcset=\"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi-example.png?w=210&amp;ssl=1 210w, https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi-example.png?resize=150%2C143&amp;ssl=1 150w\" sizes=\"auto, (max-width: 210px) 100vw, 210px\" \/><\/a>Once you&#8217;ve done that, assuming you have entered a valid hamachi IP address, the results should look something like the image at right.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update&#8230; Unfortunately, LogMeIn figured out they forgot about that page, I guess when people started reading this post and hitting it on their servers. They have removed the text status as well as all the others, and I can&#8217;t figure out why they would do such a thing. I&#8217;m also not sure what they&#8217;re offering [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":628,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[506,25,11,3,8],"tags":[233,562,561,401,374],"class_list":["post-474","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-programming","category-projects","category-tech","category-tsnlocal-net","tag-hamachi","tag-images","tag-status","tag-vpn","tag-web"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2009\/09\/hamachi1.jpg?fit=480%2C236&ssl=1","jetpack_likes_enabled":false,"jetpack_shortlink":"https:\/\/wp.me\/prOO4-7E","jetpack-related-posts":[{"id":71,"url":"https:\/\/thepizzy.net\/blog\/2006\/09\/oracle-reborn-tsnlocal-goes-up-beta\/","url_meta":{"origin":474,"position":0},"title":"[[Oracle]] Reborn, tsnlocal goes up beta","author":"[[Neo]]","date":"September 11, 2006","format":false,"excerpt":"This weekend, I hung out with [wizard] and we worked on our servers. He created his [m3rlin] server, and I created my [[Oracle]] server. Originally, as you might recall from previous posts, [[Oracle]] is an IRC bot that we use for auto responding and chanserv purposes. Our bots are still\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/thepizzy.net\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2007\/10\/oracle.png?fit=500%2C500&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8,"url":"https:\/\/thepizzy.net\/blog\/2006\/01\/project-tormachi\/","url_meta":{"origin":474,"position":1},"title":"Project: Tormachi","author":"[[Neo]]","date":"January 25, 2006","format":false,"excerpt":"Project: Tormachi ... what is it? It's file sharing routed through a proxy. Now, some of you might say \"isn't that what hamachi is?\" And some of you might be right. But we're not using hamachi...we're using hamachi and Tor....to do something that has not been done before, to our\u2026","rel":"","context":"In &quot;Projects&quot;","block_context":{"text":"Projects","link":"https:\/\/thepizzy.net\/blog\/category\/projects\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19,"url":"https:\/\/thepizzy.net\/blog\/2006\/03\/project-tormachi-updated\/","url_meta":{"origin":474,"position":2},"title":"Update: Tormachi","author":"[wizard]","date":"March 28, 2006","format":false,"excerpt":"The idea for Tormachi was to make the program, Hamachi, able to connect through any internet configuration. The problem we continually ran into was that in a corporate, and sometimes school network, the handshake to join the Hamachi \"network\", which issues the \"5.\" ip address would fail. The reason for\u2026","rel":"","context":"In &quot;Projects&quot;","block_context":{"text":"Projects","link":"https:\/\/thepizzy.net\/blog\/category\/projects\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":73,"url":"https:\/\/thepizzy.net\/blog\/2006\/09\/oracle-and-tsnlocalnet\/","url_meta":{"origin":474,"position":3},"title":"[[Oracle]] and tsnlocal.net","author":"[[Neo]]","date":"September 21, 2006","format":false,"excerpt":"I've spent the last two weeks working on getting [[Oracle]] into the role she was designed to play...but have found it to be a bit more involved than I realized. Originally, I set up the server to be a web server with php and sql capabilities. Then I realized I\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/thepizzy.net\/blog\/category\/tech\/programming\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2007\/10\/oracle.png?fit=500%2C500&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":29,"url":"https:\/\/thepizzy.net\/blog\/2006\/04\/info-tsnlocal-requirements\/","url_meta":{"origin":474,"position":4},"title":"Info: tsnlocal Requirements.","author":"[[Neo]]","date":"April 7, 2006","format":false,"excerpt":"Ok, here are the requirements for joining tsnlocal. If you have questions, post them here, don't IM me about them - I won't be available. System Requirements: - Windows XP\/2000 or Linux - Hi-Speed Internet Connection (recommended) Procedure: - Visit http:\/\/the-spot.net\/myspot.php and login. - Leave this open in the background.\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/thepizzy.net\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1086,"url":"https:\/\/thepizzy.net\/blog\/2011\/02\/my-favorite-google-chrome-os-extensions\/","url_meta":{"origin":474,"position":5},"title":"My favorite Google Chrome OS extensions","author":"[[Neo]]","date":"February 2, 2011","format":false,"excerpt":"After 2 months of Chrome OS daily use, I've compiled a list of plugins a web developer & casual social network engineer should use.","rel":"","context":"In &quot;Cloud Computing&quot;","block_context":{"text":"Cloud Computing","link":"https:\/\/thepizzy.net\/blog\/category\/cloud-computing-concepts\/"},"img":{"alt_text":"Google Chrome OS Logo - Source: doobybrain.com","src":"https:\/\/i0.wp.com\/thepizzy.net\/blog\/wp-content\/uploads\/2011\/02\/google-chrome-OS-logo1-150x113.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts\/474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/comments?post=474"}],"version-history":[{"count":25,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts\/474\/revisions"}],"predecessor-version":[{"id":1504,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/posts\/474\/revisions\/1504"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/media\/628"}],"wp:attachment":[{"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/media?parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/categories?post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thepizzy.net\/blog\/wp-json\/wp\/v2\/tags?post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}