{"id":132,"date":"2024-04-27T08:43:08","date_gmt":"2024-04-27T16:43:08","guid":{"rendered":"https:\/\/salemdata.net\/johnpress\/?p=132"},"modified":"2024-04-27T08:43:08","modified_gmt":"2024-04-27T16:43:08","slug":"pastebin-digital-paper-scraps","status":"publish","type":"post","link":"https:\/\/salemdata.net\/johnpress\/?p=132","title":{"rendered":"Pastebin &#8211; Digital Paper Scraps"},"content":{"rendered":"\n<p>Having a place to put snippets of code, logs for Linux, and output I might need only once in a blue moon is helpful.  In lieu of saving text files in a directory tree, having the content in a database makes searching easier.   <\/p>\n\n\n\n<p>There is a public service <a href=\"http:\/\/pastbin.com\">Pastebin<\/a> which touts &#8220;#1 paste tool since 2002!&#8221;.  I have an account at <a href=\"http:\/\/pastbin.com\">Pastebin<\/a> and use it extensively to share with other developers various logs &amp;etc. which can sometimes be 100k or more of lines, but contain one or two critical lines.   Context is everything, so while a single line may be causing the problem, how we got there is important to know.  Thus, having a huge complete log is necessary to troubleshoot a problem.<\/p>\n\n\n\n<p>Here is a screenshot from my public Pastebin page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-unset-1\"><img loading=\"lazy\" decoding=\"async\" width=\"1037\" height=\"732\" src=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-18.png\" alt=\"\" class=\"wp-image-133\" srcset=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-18.png 1037w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-18-300x212.png 300w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-18-768x542.png 768w\" sizes=\"auto, (max-width: 1037px) 100vw, 1037px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-right\">Source: <a href=\"https:\/\/pastebin.com\/VubC5XRN\">https:\/\/pastebin.com\/VubC5XRN<\/a><\/p>\n\n\n\n<p>While Pastebin offers the ability to share public URLs, URLs not published (&#8220;private&#8221;), and password protected URLs, I&#8217;d like to know that my own pastes which are <em>for my eyes only<\/em> are not on some remote server that will eventually get compromised.  So, I found an open source project, <a href=\"https:\/\/github.com\/claudehohl\/Stikked\/blob\/master\/README.md\">Stikked<\/a>, which mimics the basics of a pastebin server.  I installed Stikked on one of my internal servers, ares,  which is limited to my network only &#8212; it is not accessible from the Internet.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/claudehohl\/Stikked\/blob\/master\/README.md\">Stikked<\/a> is hosted on Github which is a public repository now owned by Microsoft which allows people to share open source code.  <a href=\"https:\/\/github.com\/claudehohl\/Stikked\/blob\/master\/README.md\">Stikked<\/a> was abandoned about 5 years ago.  So what I did is &#8220;fork&#8221; the project to <a href=\"https:\/\/github.com\/jlpoolen\">my own Github<\/a> account and then I have modified the code to keep it compliant with updates from the ever-evolving PHP.  <\/p>\n\n\n\n<p>What is really sweet is that I can be in a shell and pipe the output I want to save directly to my pastebin server.  Here&#8217;s an example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-unset-2\"><img loading=\"lazy\" decoding=\"async\" width=\"884\" height=\"221\" src=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-39.png\" alt=\"\" class=\"wp-image-134\" srcset=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-39.png 884w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-39-300x75.png 300w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-39-768x192.png 768w\" sizes=\"auto, (max-width: 884px) 100vw, 884px\" \/><\/figure>\n\n\n\n<p>produces:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-unset-3\"><img loading=\"lazy\" decoding=\"async\" width=\"1104\" height=\"756\" src=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-41.png\" alt=\"\" class=\"wp-image-135\" srcset=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-41.png 1104w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-41-300x205.png 300w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_08-41-768x526.png 768w\" sizes=\"auto, (max-width: 1104px) 100vw, 1104px\" \/><\/figure>\n\n\n\n<p>Here&#8217;s the simple URL returned to my console (which will not work for you) http:\/\/ares\/paste\/view\/f54ed115<\/p>\n\n\n\n<p>Lastly, what is really helpful is that all the text of a pasted item is stored in a database, so I can visit my paste bin server and perform a search, e.g. for the term &#8220;xen&#8221;, and all the pastes I have stored containing that term appear.  This makes finding the needle in a haystack easier and, most importantly, it is not on someone else&#8217;s server that will be a target for hackers.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-unset-4\"><img loading=\"lazy\" decoding=\"async\" width=\"1063\" height=\"956\" src=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_09-30.png\" alt=\"\" class=\"wp-image-136\" srcset=\"https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_09-30.png 1063w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_09-30-300x270.png 300w, https:\/\/salemdata.net\/johnpress\/wp-content\/uploads\/2024\/04\/2024-04-27_09-30-768x691.png 768w\" sizes=\"auto, (max-width: 1063px) 100vw, 1063px\" \/><\/figure>\n\n\n\n<p>For Gentoo users: the versions of PHP &amp; Apache as of April 26, 2024, where I run my fork of Stikked is on this <a href=\"https:\/\/pastebin.com\/Ssf3fRAK\">public paste<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Organizing Your Snippets<\/p>\n","protected":false},"author":2,"featured_media":136,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[36,14,33,35,34],"class_list":["post-132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gentoo","tag-apache","tag-gentoo","tag-pastebin","tag-php","tag-stikked"],"_links":{"self":[{"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=132"}],"version-history":[{"count":1,"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":137,"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions\/137"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=\/wp\/v2\/media\/136"}],"wp:attachment":[{"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salemdata.net\/johnpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}