{"id":61560,"date":"2018-07-20T08:15:16","date_gmt":"2018-07-19T23:15:16","guid":{"rendered":"https:\/\/www.softantenna.com\/wp\/?p=61560"},"modified":"2018-07-20T08:15:16","modified_gmt":"2018-07-19T23:15:16","slug":"cheat-sh","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/cheat-sh\/","title":{"rendered":"cheat.sh - \u30d6\u30e9\u30a6\u30b6\u3084\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u5229\u7528\u3067\u304d\u308b\u4e16\u754c\u6700\u5f37\u306e\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u30b5\u30fc\u30d3\u30b9"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2018\/07\/s_20180713_204539.jpg\" alt=\"S 20180713 204539\" title=\"s_20180713_204539.jpg\" border=\"0\" width=\"1066\" height=\"686\" \/><\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3001\u5404\u7a2e\u30c4\u30fc\u30eb\u306e\u4f7f\u3044\u65b9\u306a\u3069\u3001\u4e16\u754c\u4e2d\u306b\u306f\u3055\u307e\u3056\u307e\u306a\u5206\u91ce\u306b\u95a2\u3057\u3001\u60c5\u5831\u3092\u5b8c\u7d50\u306b\u307e\u3068\u3081\u305f\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8(\u864e\u306e\u5dfb)\u304c\u591a\u6570\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<p>\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300c<a href=\"https:\/\/cheat.sh\/\">cheat.sh<\/a>\u300d\u306f\u3053\u308c\u3089\u591a\u304f\u306e\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u306b\u7d71\u4e00\u7684\u306a\u30a2\u30af\u30bb\u30b9\u3092\u63d0\u4f9b\u3059\u308b\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002<\/p>\n<p>Web\u30b5\u30fc\u30d3\u30b9\u306e\u5f62\u5f0f\u3068\u3057\u3066\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u305d\u306e\u307e\u307e\u78ba\u8a8d\u3067\u304d\u308b\u307b\u304b\u3001curl\u3092\u4f7f\u3063\u3066\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u3088\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7279\u5fb4\u3092\u6301\u3063\u3066\u3044\u307e\u3059<\/p>\n<ul>\n<li>\u7c21\u5358\u306acurl\/\u30d6\u30e9\u30a6\u30b6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9<\/li>\n<li>55\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3001\u8907\u6570\u306eDBMS\u30011000\u7570\u5e38\u306e\u91cd\u8981\u306aUNIX\/Linux\u30b3\u30de\u30f3\u30c9<\/li>\n<li>\u4e16\u754c\u6700\u9ad8\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u4e3b\u5c0e\u306e\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u308a\u3063\u307d\u3058\u9ce5\u3068StackOverflow\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u63d0\u4f9b<\/li>\n<li>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4e0d\u8981<\/li>\n<li>\u8d85\u9ad8\u901f\u3002\u539f\u5247\u3068\u3057\u3066100m\u79d2\u4ee5\u5185\u306b\u56de\u7b54<\/li>\n<li>\u30a8\u30c7\u30a3\u30bf\u5185\u90e8\u304b\u3089\u3082\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<li>\u30b9\u30c6\u30eb\u30b9\u30e2\u30fc\u30c9\u642d\u8f09<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u4f7f\u7528\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>curl\u304b\u3089\u5229\u7528<\/h2>\n<p>cheat.sh\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528\u3059\u308b\u306b\u306fcurl\u3092\u5229\u7528\u3057\u3066\u95b2\u89a7\u3059\u308b\u306e\u304c\u4e00\u756a\u7c21\u5358\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<code>curl cheat.sh\/\u30ad\u30fc\u30ef\u30fc\u30c9<\/code>(\u3042\u308b\u3044\u306f<code>curl cht.sh\/\u30ad\u30fc\u30ef\u30fc\u30c9<\/code>)\u306e\u5f62\u5f0f\u3067\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>\ncurl cheat.sh\/tar\ncurl cht.sh\/curl\ncurl https:\/\/cheat.sh\/rsync\ncurl https:\/\/cht.sh\/tr\n<\/pre>\n<p>\u4f8b\u3048\u3070<code>curl cheat.sh\/tar<\/code>\u3068\u5b9f\u884c\u3059\u308b\u3068tar\u306e\u5404\u7a2e\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u3044\u65b9\u304c\u305a\u3089\u3063\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>$ curl cht.sh\/tar\n# To extract an uncompressed archive:\ntar -xvf \/path\/to\/foo.tar\n\n# To create an uncompressed archive:\ntar -cvf \/path\/to\/foo.tar \/path\/to\/foo\/\n\n# To extract a .gz archive:\ntar -xzvf \/path\/to\/foo.tgz\n\n# To create a .gz archive:\ntar -czvf \/path\/to\/foo.tgz \/path\/to\/foo\/\n\n# To list the content of an .gz archive:\ntar -ztvf \/path\/to\/foo.tgz\n\n# To extract a .bz2 archive:\ntar -xjvf \/path\/to\/foo.tgz\n\n# To create a .bz2 archive:\ntar -cjvf \/path\/to\/foo.tgz \/path\/to\/foo\/\n\n# To list the content of an .bz2 archive:\ntar -jtvf \/path\/to\/foo.tgz\n\n# To create a .gz archive and exclude all jpg,gif,... from the tgz\ntar czvf \/path\/to\/foo.tgz --exclude=\\*.{jpg,gif,png,wmv,flv,tar.gz,zip} \/path\/to\/foo\/\n\n# To use parallel (multi-threaded) implementation of compression algorithms:\ntar -z ... -> tar -Ipigz ...\ntar -j ... -> tar -Ipbzip2 ...\ntar -J ... -> tar -Ipixz ...<\/pre>\n<p>\u8ffd\u52a0\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4e0e\u3048\u3088\u308a\u8a73\u3057\u3044\u60c5\u5831\u3092\u63a2\u3057\u3060\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070Ruby\u8a00\u8a9e\u3067\u914d\u5217\u3092\u9006\u9806\u306b\u30bd\u30fc\u30c8\u3057\u305f\u3044\u5834\u5408\u3001<code>curl cht.sh\/ruby\/reverse+a+list<\/code>\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre>$ curl cht.sh\/ruby\/reverse+a+list\n# reversing the order of an array in ruby\n\nirb(main):001:0> a = [12,16,5,9,11,5,4]\n=> [12, 16, 5, 9, 11, 5, 4]\nirb(main):002:0> a.reverse\n=> [4, 5, 11, 9, 5, 16, 12]\n\n=begin\n     n I'm not seeing what you're seeing.\n     n\n     n Edit: Expanding on what Ben noticed, you may be reversing a string.\n     =end\n\nirb(main):005:0> \"12,16,5,9,11,5,4\".reverse\n=> \"4,5,11,9,5,61,21\"\n\n=begin\n     n If you have to reverse a string in that manner, you should do\n     n something like the following:\n     =end\n\nirb(main):008:0> \"12,16,5,9,11,5,4\".split(\",\").reverse.join(\",\")\n=> \"4,5,11,9,5,16,12\"<\/pre>\n<p>curl\u304b\u3089\u4f7f\u7528\u3059\u308b\u5834\u5408\u691c\u7d22\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u300creverse+a+list\u300d\u306e\u3088\u3046\u306b\u300c+\u300d\u3067\u7d50\u5408\u3057\u307e\u3059\u3002<\/p>\n<h2>cht.sh\u304b\u3089\u5229\u7528<\/h2>\n<p>curl\u306e\u307b\u304bcht.sh\u3068\u3044\u3046\u540d\u524d\u306e\u5c02\u7528\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u7d4c\u7531\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002Linux\u3084macOS\u306e\u3088\u3046\u306aUNIX\u74b0\u5883\u306e\u5834\u5408\u3001\u5c02\u7528\u30b9\u30af\u30ea\u30d7\u30c8\u3092cht.sh\u5229\u7528\u3059\u308b\u3068\u3082\u3046\u5c11\u3057\u7c21\u6f54\u306b\u554f\u3044\u5408\u308f\u305b\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305acht.sh\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<pre>curl https:\/\/cht.sh\/:cht.sh > ~\/bin\/cht.sh\nchmod +x ~\/bin\/cht.sh\n<\/pre>\n<p>cht.sh\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002curl\u306e\u5834\u5408\u30d7\u30e9\u30b9\u8a18\u53f7\u3067\u7d50\u5408\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u304c\u3001cht.sh\u3067\u306f\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u3067\u3088\u308a\u81ea\u7136\u306b\u6271\u3048\u307e\u3059\u3002<\/p>\n<pre>\n$ cht.sh go reverse a list\n$ cht.sh python random list elements\n$ cht.sh js parse json\n<\/pre>\n<p>\u3055\u3089\u306b\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\u5229\u7528\u3067\u304d\u308b\u30b7\u30a7\u30eb\u30e2\u30fc\u30c9\u3084\u3001\u30c6\u30ad\u30b9\u30c8\u3092\u9078\u629e\u3059\u308b\u3060\u3051\u3067\u554f\u3044\u5408\u308f\u305b\u3067\u304d\u308b\u30b9\u30c6\u30eb\u30b9\u30e2\u30fc\u30c9(\u5b9f\u969b\u306fmacOS\u306e\u5834\u5408iTerm2\u306a\u3069\u306e\u3088\u3046\u306b\u30c6\u30ad\u30b9\u30c8\u9078\u629e\u6642\u306b\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u60c5\u5831\u304c\u30b3\u30d4\u30fc\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002)\u306a\u3069\u3001\u3088\u308a\u4fbf\u5229\u306a\u6a5f\u80fd\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2018\/07\/s_20180713_211215.jpg\" alt=\"S 20180713 211215\" title=\"s_20180713_211215.jpg\" border=\"0\" width=\"865\" height=\"496\" \/><\/p>\n<p>\u25b2\u30b9\u30c6\u30eb\u30b9\u30e2\u30fc\u30c9\u306e\u69d8\u5b50\u3002\u8d64\u5b57\u90e8\u5206\u304c\u81ea\u52d5\u7684\u691c\u7d22\u5bfe\u8c61\u3068\u306a\u3063\u3066\u3044\u308b\u6587\u5b57\u5217\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u4ed6\u3001Vim\u3084Emacs\u306b\u7d44\u307f\u8fbc\u3080\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002\u8a73\u7d30\u306f\u516c\u5f0f\u30b5\u30a4\u30c8\u3067\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>cheat.sh<\/h2>\n<p>cheat.sh\u306f\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30d9\u30fc\u30b9\u3067\u4f5c\u3089\u308c\u305f\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u3078\u306e\u7d71\u4e00\u7684\u306a\u30a2\u30af\u30bb\u30b9\u624b\u6bb5\u3092\u63d0\u4f9b\u3059\u308bWeb\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u306b\u63b2\u8f09\u3055\u308c\u3066\u3044\u308b\u60c5\u5831\u306f\u3070\u3089\u3064\u304d\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u5fc5\u8981\u306a\u60c5\u5831\u3092\u7d20\u65e9\u304f\u53c2\u7167\u3067\u304d\u308b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3001\u5404\u7a2e\u30c4\u30fc\u30eb\u306e\u4f7f\u3044\u65b9\u306a\u3069\u3001\u4e16\u754c\u4e2d\u306b\u306f\u3055\u307e\u3056\u307e\u306a\u5206\u91ce\u306b\u95a2\u3057\u3001\u60c5\u5831\u3092\u5b8c\u7d50\u306b\u307e\u3068\u3081\u305f\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8(\u864e\u306e\u5dfb)\u304c\u591a\u6570\u5b58\u5728\u3057\u307e\u3059\u3002 \u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300ccheat.sh\u300d\u306f\u3053\u308c\u3089\u591a\u304f\u306e\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u306b\u7d71\u4e00\u7684 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":61746,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[2116],"class_list":["post-61560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review","tag-cheatsheet"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/61560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=61560"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/61560\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/61746"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=61560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=61560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=61560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}