{"id":462,"date":"2014-04-22T15:05:39","date_gmt":"2014-04-22T20:05:39","guid":{"rendered":"http:\/\/bitc.bme.emory.edu\/~lzhou\/blogs\/?p=462"},"modified":"2014-04-22T15:05:39","modified_gmt":"2014-04-22T20:05:39","slug":"solution-for-_x11transsocketinetconnect-cant-get-address-for-localhost","status":"publish","type":"post","link":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/?p=462","title":{"rendered":"Solution for &#8220;_X11TransSocketINETConnect: Can&#8217;t get address for localhost&#8221;"},"content":{"rendered":"<p>To the public knowledge, this is caused by missing<br \/>\n127.0.0.1 localhost<br \/>\nline in your \/etc\/hosts<br \/>\nfile.<br \/>\nHowever, for some applications, even if you have that line, you will still get this error.  Or what if you do not have access\/privilege to modify the \/etc\/hosts file?<br \/>\nThere is still a work around:<br \/>\nSuppose the affected program is named cccccc<br \/>\nyou may make a shell script like:<br \/>\n$!\/bin\/sh<br \/>\n( DISPLAY=`echo $DISPLAY | sed -e &#8216;s\/localhost\/127.0.0.1\/g&#8217;`;  export DISPLAY;\\<br \/>\n  cccccc<br \/>\n)<br \/>\nand make this file executible.<br \/>\nThen when you execute this file, it will replace the hostname localhost to the rightful IP 127.0.0.1, such that your program will not have to do name look up for localhost.<br \/>\nAfter your program is ended, this script will automatically void the modification to the $DISPLAY parameter, so that your other applications won&#8217;t be affected.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To the public knowledge, this is caused by missing 127.0.0.1 localhost line in your \/etc\/hosts file. However, for some applications, even if you have that line, you will still get this error. Or what if you do not have access\/privilege to modify the \/etc\/hosts file? There is still a work around: Suppose the affected program [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,3],"tags":[],"class_list":["post-462","post","type-post","status-publish","format-standard","hentry","category-computer-tips","category-mri-technical-support","post-blog"],"_links":{"self":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=462"}],"version-history":[{"count":1,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":463,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/462\/revisions\/463"}],"wp:attachment":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}