2015-08-01ãã1ã¶æéã®è¨äºä¸è¦§
ã¡ã¾ã¡ã¾xpathã¨rubyã§å¤æãã¦ããã®ãé¢åã«ãªã£ã¦ããã®ã§ãXMLãå¤æãããªãXpath+nokogiriãããããããã便å©ãããããªãXSLT使ã£ã¦ã¿ãã ãªã¯ã³ã³èæ¼ãXMLçéã§ãããã«å¿ããããåå¨ã®XSLTã§ãããã XSLT XSLT ( Extensible Stylesheet Langâ¦
dig ã®åºåçµæãä»ã§ä½¿ããã short ãªãã·ã§ã³ã使ãã¨ä¾¿å© dig +short github.com 192.30.252.128 short ã¯è²ã ã¨ä¾¿å©ã«ä½¿ããã dig +short example.com @dns.eample.com ãã¨ãã°ãããã¨ï½ï½ãè¦ãã dig +short mixi.jp mx 20 alt2.aspmx.l.google.coâ¦
ãã¡ã¤ã«ãæ±ãã¨ãã«ãCè¨èªã§æ¸ããªãããã« ã¤ãã¤ãstdio.h ã§æ¸ãã¦ãã¾ãã®ã§ãä¸çªãã使ããããªãã®ãããã«æ®ãã¦ãããã fileHandleForWritingAtPath ããã¡ã¤ã«ãTruncateãã¦ãããªãã®ãã¡ãã£ã¨ãããæ°ã¥ãã ã£ãã // // main.m // workinâ¦
mp4 ã®çµåããã ts ãã¡ã¤ã«ã®çµåãªãã«ã³ã¿ã³ãªãã ãã©ã»ã»ã»mp4 ã¯ã³ã³ãããé¢åãªã®ã§ãcat ã§ããªã ts ã«å¤æããã for i in `ls -v *.mp4` ; do ffmpeg -i $i -c copy -bsf:v h264_mp4toannexb -f mpegts $i.ts done ä¸æ¦ã¯ä¸éãã¡ã¤ã«ã®TSãçµâ¦
PEMã®ç§å¯éµã«ã¤ãã¦èª¿ã¹ã¦ã¿ãã 詳ããã¯ãããã«æ¸ãã¦ãã®ã§ãå®éã«ã¤ã£ã¦ã¿ãçµæãªã©ãã d.hatena.ne.jp ç§å¯éµã®çæ ä»åã¯ãããã£ã¨ããã£ã¨ä½¿ãæ¹ã¨ä½¿ããæ¹ãæ¶ããããã«ãé常ã«å°ããªç§å¯éµã使ã£ã takuya@:~/Desktop$ openssl genrsa 128â¦
openssl ã³ãã³ã㯠openssl ãµãã³ãã³ã å¼æ° å¼æ° .... ã¨ãªã£ã¦ããããµãã³ãã³ããå®éã«å¿ è¦ãªã®ã§ãããã¨ãå¤ã openssl ã®ããã¥ã¢ã« ( man pages )ã¯ã¡ãã£ã¨ã³ããå¿ è¦ã ãµãã³ãã³ããã¡ã¤ã³ã§ããã®ã¨ãopenssl èªä½ã®man ãæ£ãã°ã£ã¦ããã®â¦
opensslã¯æ®ã©ã®ç°å¢ã§ä½¿ããã ã¨ã³ã³ã¼ã openssl enc -base64 > out.base64 < some.zip ãã³ã¼ã openssl enc -base64 -d > out.zip < out.base64 ã«ã³ã¿ã³ Base64ãã¨ã³ã³ã¼ãã»ãã³ã¼ãããã¨ãã«ãrubyã¨ãnode使ã£ã¦ããã©ãè¨å®é¢åã ã£ããããã
openssl rsautl ã ã¨å¤§ããªãã¼ã¿ãæå·åã§ããªã éµã®é·ãã«ä¾åããã®ã§ã大ããªãã¼ã¿ãæå·åããã«ã¯å ±æéµã使ã ãããç¸æã«å®å ¨ã«ãã¼ã¿ãåã渡ãããã¨ãããã®éã«ç¸æã¨äºåã«å®å ¨ãªçµè·¯ã§éä¿¡ã§ããªãæã æå·åããããã¼ã¿ããã¹ãã¬ã¼ãºâ¦
ç§å¯éµâ PEM å ¬ééµ æ¹æ³ï¼ ssh-keygen ã使ã ssh-keygen -y -f ~/.ssh/id_rsa -e -m PKCS8 > ~/.ssh/id_rsa.pub.pkcs8 æ¹æ³ï¼ openssl ã³ãã³ãã使ã openssl rsa -in ~/.ssh/id_rsa -pubout -out ~/.ssh/id_rsa.pub.pem openssl ã³ãã³ãã§ä½¿ããå ¬ééµâ¦
å ¬è¡ç¡ç·LANã«ã¤ãªãã¨WiSPrã®ãããã¢ããã æ¯ååºã¦ãã¦é¬±é¶ãããããã ç¡ç·LANããã§ãã¯ãã¦ããã®ã¯ãã㤠/System/Library/CoreServices/Captive Network Assistant.app ããã¤ã http://www.apple.com/library/test/success.html ã«ã¢ã¯ã»ã¹ãã¦ãâ¦
éªç¥ãªãã°ç·ãééãã¦ã絶è³å©ç¨ä¸ã§ãã ééæ°å¹´ã®éªç¥ãªãã°ç·ã§ããªãã§ãããªã«å¤èãã¦ã¬ãããªæããããã ãããé度ã®é ãã¨åè»é§ ã®å¤ããã¬ããæãéç«è¶³ãã¾ãã *1 ã¨ããã§éªæ¥éªç¥è¿éå±±é½ã®å®æç¸äºå©ç¨ããä¾¿å© ä¾¿å©ãªãã ãã©ãå®æå¸â¦
.ssh/id_rsa ã使ã£ã¦æç« ãæå·åããã openssl ã§æå·åããã®ã«RSAã使ãããopenssh ã®RSA éµã ã£ã¦ãã¡ãã使ããã openssl 㨠id_rsaã§æå·å id_rsa ãç§å¯éµãªã®ã§ãç§å¯éµã§æå·ååºæ¥ãã echo "Hello takuya " > takuya.txt openssl rsautl -enâ¦
ãã¹ã¯ã¼ãããã¡ã¤ã«ã«ããã¦github ã«ã³ããããã¦å·æ±ããã ãã¹ã¯ã¼ããã¤ãã¤ãå¹³æã®ããæ¸ãã¡ãã£ã¦ããã¡ã§ããã ãã®çãç´ããªãã¨github ã«ã³ãããæãåºæ¥ã¾ããã ãã®ããbitbucket ã使ã£ã¦ããã©ãbitbucket ã¨github 両æ¹ã§ç®¡çãããâ¦
ãã¡ã¤ã«ãããã£ã¨æå·å ãªã«ãèªã¾ããããªããã¡ã¤ã«ãæå·ãã¦éãã¾ãã¨æã£ãã ãããã¾ãHTTPSã§éãã°ãããã ãããã©ã ãªã³ã¯ãæ¬æå ¥ãããã¡ã¼ã«æ¶ããããã ã¡ã¼ã«ã§zipæ·»ä»ãéããªãä¸ã®ä¸ãããããä¸ç¥è¾ã ãã¡ã¤ã«ãæå·å ãã¡ã¤ã«â¦
ãã¹ã¯ã¼ãããã¡ã¤ã«ã«ç´æ¥æ¸ãã¡ãã ã ãã¹ã¯ã¼ãããã¡ã¤ã«ã«æ¸ãã¡ããã¡ãã¨ãããã¦ããããè¡ããªããããã ãã¡ã¤ã«ã·ã¹ãã ã®ãã¼ã¸ã§ã³ãã³ã° ãã¡ã¤ã«ã·ã¹ãã ã«ã¸ã£ã¼ãã«æ©è½ããã£ã¦èªåããã¯ã¢ããã ã£ããããã®ã§ãOSXã®ããã¯ã¢ãããLâ¦
youtube-dl ã£ã¦youtubeé対å¿ã®raspberryPiã§åç»åçã«ä½¿ã£ã¦ã¾ããã deibain ã«youtube-dl ã¨ããã³ãã³ããããã¾ãã¦ãyoutubeããå種ãã¼ã¿åãåºããã¨ã«ä½¿ãã¾ãã youtube-dl ã³ãã³ãã¯ã¨ã¦ã便å©ããã¦é¼»è¡ãåºã¾ãã youtube-dl ã§ãã¬ã¤ãªã¹â¦
身å å ¨å¡ã®å°éç»é²ã¨å°é証æãå¿ è¦ã ã£ãã®ã§ãã¤ãã§ã«å°éç»é²ã«ã¤ãã¦èª¿ã¹ã¦ããã å°éç»é²ã¨ã¯ æ¸é¡ã«æºå°ã®éã«ããã®å°éãæ£ãããã¨ãã第ä¸è æ©é¢ã§ããè¡æ¿ï¼ä½æ°ç¥¨ãããå¸åºçºæï¼ã証æãã¦ãããã ã¤ã¾ãä¸è éèªè¨¼ã§ããã éè¦ãªåå¼ã®â¦
FILE ã¯ããã®ã¾ã¾ã ã¨ã¢ãã«ãªããªãã ruby ã® ruby-doc ã«ã¯ãã®ããã«æ¸ãã¦ããã FILE ç¾å¨ã®ã½ã¼ã¹ãã¡ã¤ã«å ãã«ãã¹ã¨ã¯éããªãããããã«ãã¹ãå¿ è¦ãªå ´å㯠File.expand_path( FILE) ã¨ããå¿ è¦ãããã¾ãã ãã«ãã¹ã¨ã¯éããªãã¨ããããã·â¦
ãã¡ã¤ã«ã®ãªã³ã¯ãããã«å¥ã¸ã®ãªã³ã¯ã ã£ããããã§ãã¯ããã®ã¯ã¡ãã£ã¨å¤§å¤ ãªã³ã¯å ããæ´ã«ãªã³ã¯ã ã£ãããã¦ããããçµæ§ããããããã ããã«ããªã³ã¯å ãæ£ãããã©ããããã§ãã¯ããããä¸æ£ã«æ¸ãæãã£ã¦ãªãã調ã¹ãã®ã¯ããé å²ãããã«ãªâ¦
youtube åç»ãããã£ã¨åçã§ããã便å©ã§ãããã play_youtube https://www.youtube.com/watch?v=meThrx0zEEE ã¨ããããã youtube ã®URLããåç»ã®URLãåå¾ã§ããã°ãããã㧠URLã¯youtube-dl ããåå¾ã§ãã youtube-dl -J $1 | jq -r '.formats| .[â¦
ruby ã§ãã¡ã¤ã«æ¸ãæãã£ãæã«å¦çããããã¨æã£ãã®ã§ããã¡ã¤ã«ã®ç£è¦ã¨ã¤ãã³ãã¨ããã° inotify ãªã®ã§ãrb-inotify ã使ã£ã¦ã¿ã require 'rb-inotify' path_a = "/home/takuya/test/FileA" path_b = "/home/takuya/test/FileB" path_list = [ "/hoâ¦
Ruby ã§å®ç¾©æ¸ã®å®æ°ã確èªããã ã¯ã©ã¹å®ç¾©ã®å¤(ãã ãã¬ãã«)ã§å®ç¾©ãããå®æ°ã¯ Object ã«æå±ãããã¨ã«ãªãã¾ãã Object.constants ã¨ãããã¨ã«ãªãã ãã¨ãã°ãRUBY_XXXXãè¦ã¤ããã«ã¯ >> Object.constants.grep(/ruby/i) [ [ 0] :RubyVM, [ 1] â¦
å ¬è¡ç¡ç·LANããã使ãã®ã§ãæ´çããã å ¬è¡ç¡ç·LANã§HTTPãªãã¤ã¬ã¯ãã§ãCaptiveãããã¯ã¼ã¯ã£ã¦å°æ±ãä»æ§ã ã¨æããã§ããããéä¿¡ã®æé©åã©ããããURLãã®ã¾ã¾ã§å®å ¨ã«æ¸ãæãã£ã¡ãããã§ãã ã§ãããã解決ãããã¦ããããã¨æ¸ãç¶ãã¦ãã¾ãâ¦
ãã¡ã¤ã«åãé£çªã«ãããã¨ããã£ã ãã¨ãã°ãruby ã§æ¸ãã¨ãããããã«ãªãã Dir.glob("*.jpg").each.with_index{|e,i| puts "mv #{e} #{sprintf('%03d.jpg' ,i)}" } ã§ããjpeg ã¨ã¯éããªãããFinderã§é¸æãã¡ã¤ã«ãå¤æããããªã¨æã£ãã ãµã¼ãâ¦
docomo ã®èªåãã°ã¤ã³ã«å¿ è¦ãªæ å ±ãè¦ã¤ãã ãã°ã¤ã³ãã¦ãdocomoWiFiæ¥ç¶ã«å¿ è¦ãªæ å ±ã¯ã次ã®å ´æã«ããã docomo ã客æ§ãµãã¼ãï¼ã¹ããçï¼ ãµã¼ãã¹ã¡ã¼ã«è¨å® docomo Wifi ã®è¨å® ãªãããPCçã¯è¦ã¤ããããªãã£ããæ¢ãæ¹ãæªãã®ãã ãã°ã¤ã³â¦