{"id":262,"date":"2009-03-04T00:42:31","date_gmt":"2009-03-03T22:42:31","guid":{"rendered":"http:\/\/blog.sqawasmi.com\/index.php\/2009\/03\/04\/linux-examination-machine\/"},"modified":"2009-03-04T00:44:42","modified_gmt":"2009-03-03T22:44:42","slug":"linux-examination-machine","status":"publish","type":"post","link":"https:\/\/blog.sqawasmi.com\/index.php\/2009\/03\/04\/linux-examination-machine\/","title":{"rendered":"Linux examination machine"},"content":{"rendered":"<p>Two days ago i did a nice interview, it was interactive exam, someone ask you through the phone to troubleshoot\/do many things and in the same time he see what you do and what is the output of your commands, in my company, when i was interviewing people, all what i do is oral questions.. its oral conversation, but after making that interview i decided to prepare a examination machine to use it for future interviews i do in the company i work in.<br \/>\nthe trick was using SCRIPT(1) and named pipe (fifo), simply like this:<br \/>\nin the first session do this command:<br \/>\n$ mkfifo foo; script -f foo<br \/>\nin another session do cat for &#8216;foo&#8217;<br \/>\n$ cat foo<br \/>\nand now you will see everything done in the first session, yup so nice.<br \/>\nto use it when the user login (for ex\/ through ssh), you can put it on .bashrc file for that user, for example put those at the end of .bashrc file:<br \/>\nif [ ! -p \/tmp\/`whoami` ]<br \/>\nthen<br \/>\nmkfifo \/tmp\/`whoami` ;<br \/>\nfi<br \/>\nexec script -f \/tmp\/`whoami`<\/p>\n<p>thats it, now after user login, do cat \/tmp\/UserLoginName in your session \ud83d\ude09<\/p>\n<h3>Related Images:<\/h3>","protected":false},"excerpt":{"rendered":"<p>Two days ago i did a nice interview, it was interactive exam, someone ask you through the phone to troubleshoot\/do many things and in the same time he see what you do and what is the output of your commands, in my company, when i was interviewing people, all what i do is oral questions.. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"footnotes":""},"categories":[14,22,7],"tags":[],"class_list":["post-262","post","type-post","status-publish","format-standard","hentry","category-bash","category-cli","category-scripting-cli"],"_links":{"self":[{"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/posts\/262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/comments?post=262"}],"version-history":[{"count":3,"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/posts\/262\/revisions"}],"predecessor-version":[{"id":264,"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/posts\/262\/revisions\/264"}],"wp:attachment":[{"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/media?parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/categories?post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.sqawasmi.com\/index.php\/wp-json\/wp\/v2\/tags?post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}