2016-06-01ãã1ã¶æéã®è¨äºä¸è¦§
swap ã®ãã©ã¤ããå¤æ´ããã swap ãã©ã¤ããSSDã«ç§»åããããã¨æã£ã¦ãæ¶ãããä½ã£ãããã¦ã swap ã確èªããæ¹æ³ åç´ã« swapon ãå©ãã¨ç¾å¨ã®swap ãè¦ããã takuya@:~$ sudo swapon NAME TYPE SIZE USED PRIO /dev/dm-1 partition 20G 39M -1 swaâ¦
GETå¼æ°ãããã·ã¥ã«å¤ããã å®ã¯ãé »ç¹ã«ãããã ãã©ãæ¯åé©å½ã«è¡ã£ã¦ãã¦ãããã¨ãã£ãæ¹æ³ã決ãã¦ãªãã£ãã®ã§ãã¡ããã¨æ¹æ³ã決ãããã¨ã«ããã require 'uri' module URI class << self alias :_parse :parse def parse a, original=false retuâ¦
Swap ã®é©æ£é ã¹ã¯ãããã¡ã¤ã«ã¯ã©ãããããé©å½ãªã®ãï¼ æã¯RAMã®ï¼åã¨è¨ããã¾ãããããã¾ã ã«ãããªããç¡ãã¨æãã®ã§èª¿ã¹ã¦ã¿ãã Redhat ã®è³æã«ãã㨠ã¡ã¢ãªé ã¹ã¯ãããµã¤ãº 2GB ä»¥ä¸ ã¡ã¢ãªã®ï¼åç¨åº¦ãã3åç¨åº¦ 2-8GB ã¡ã¢ãªã¨åç¨åº¦ãâ¦
CentOSã®ãã¼ã¸ã§ã³ã確èªããã cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) ãµãããã
git-diff ã§ã«ã©ã¼è¡¨ç¤ºãã¦ããã©ãæ°è¦ãã·ã³ã«ãªãã£ã æ°è¦ãã·ã³ã«git å ¥ãããã©ãgit-diffããªãã¦æããã diff - highlight ãæã£ã¦ãã curl https://raw.github.com/git/git/master/contrib/diff-highlight/diff-highlight -o diff-highlight chmâ¦
rar ã³ãã³ãã§ãã¡ã¤ã«ãå§ç¸® tar ã¨ã»ã¼åã c ã®ä»£ããã« a rar a -rr3p ãã¡ã¤ã«å.rar 追å å®éã«ã¤ã£ã¦ã¿ãä¾ takuya@~/Desktop$ rar a -rr3p out.rar ScrenCaptured_2016-06-2* RAR 5.30 Copyright (c) 1993-2015 Alexander Roshal 18 Nov 2015 Triaâ¦
JSã§ãã¦ã¹ã¤ãã³ãï¼ã¯ãªãã¯ï¼ãèµ·ãã/ mouseEvent ã Dispatch ãã¦èµ·åãã
Javascript ã§ã¯ãªãã¯ã¤ãã³ããèµ·ããã ã¯ãªãã¯ã¤ãã³ããèµ·ãããªãã¨ãã¹ãã§ããªããã¼ã¸ãæãã ã¯ãªãã¯ã¤ãã³ããFireããã«ã¯ãinitEvent 㨠dispatch ã¤ãã³ãã使ãã ãã¦ã¹ã¤ãã³ã var me = document.createEvent("MouseEvents") me.initMoâ¦
realpath ãä½ã¨ãªãçºãã¦ããã¨ã ãã¡ã¤ã«ãåå¨ããªãæ㯠false ãè¿ãã¨æ¸ãã¦ããããããããªã®ããå½ããåã ãã©ãæ°ã¥ãã¦ãªãã£ã realpath() returns FALSE on failure, e.g. if the file does not exist. file_exists ããå¾ã«ãrealpath ã§æ´â¦
pulse secure ãèªåèµ·åãã¦macOS Xã®èµ·åã妨害ããã ãªããªãã ãã¸ã§ãã®ã½ããã»ã»ã» èªåèµ·åããªãã«ãã¦ãå¿ è¦ãªã¨ãã ãæå¹ã«ãããã¨ã«ããã takuya@~/Library$ launchctl load -w /Library/LaunchAgents/net.juniper.pulsetray.plist takuya@~â¦
netatalk ã®è¨å® afp.conf ãè¦ã¦ãã mimic ãããã¯ï¼æ¬æ ï¼ã¨ããè¨å®é ç®ãçºè¦ï¼ æ©éè¨å®ãã¦ã¿ã ãããã¯ããã¨ãafp ã§Macããè¦ããã¢ã¤ã³ã³ãå¤ããã afp.conf æ¸æ systemctl restart netatlk.conf macOS X å´ã§ Finder åèµ·å mimic = Macminiâ¦
pulse secure ã使ãã¨SSL-VPNãå¼µããã®ã§ããã Pulse Secureã¯OSã®èµ·åæã«èµ·åãã¦èµ·åã妨害ãããã¨ã¦ãéªé 代æ¿ã½ãããæ¢ãã openvpn ã¯æ¹å¼ãå®å ¨ã«éãããç¡çãjnc 㯠jar ã®ã¤ã³ã¹ãã¼ã«ãé¢åãããããè¦éã openconnect ã便å©ã ã£ãã bâ¦
ã¿ã¤ã ãã·ã³ãµã¼ãã¼ãä½ãã ã¿ã¤ã ã«ãã»ã«ãé«ããé«ãããããã¯ã¢ãããåãã®ã«ã¡ãã£ã¨ä¸ä¾¿ã ãã netatalk 㧠ã¿ã¤ã ã«ãã»ã«ãä½ã Samba ã«sparse bundle ãä½ãæãããããã©ãSambaã ã¨ããã¯ã¢ãããéåããæã«ä¸ä¾¿ãªã®ã§ãAFPã§æ§æãã¦ãâ¦
expect 便å©ã§ãããã expect ã³ãã³ããããã°ã¿ã¼ããã«ã®èªåå ¥åãåºæ¥ã¾ãã ruby ã§ã使ã£ã¦ã¾ããã ã§ã ruby 㯠gems ãããå°çã§ã¡ãã£ã¨ã㤠python / javascript ã«ç§»è¡ãããã¨æã£ã¦ãã¾ãã 使ãæ¹:import import pexpect èµ·åã¨å¦çå¾ ã¡ã¯â¦
HTTP ã³ãã¯ã·ã§ã³ã³ãClose ãã
File.rename ã¯ããã¤ã¹ãè¶ ãã¦rename åºæ¥ãªãã File.rename ãä½æ°ãªã使ã£ã¦ãã¾ããã require 'fileutils' ããã®ãé¢åãããã¨ãããããã ãã®çç±ã§ã ããã¦ä»æ¥ã¯è¦äºã«ããããªãããcron ã§ã¨ã©ã¼ãåºã¦ããã®ã§è¿½ãããã¦ã¿ããããªãã¨renaâ¦
lsblk ã§ç©çãã£ã¹ã¯ã®ä¸è¦§ãè¦ããã¨ãåºæ¥ãã PCã«ã©ã®ãããªHDDãä½å°ã¤ãªãã£ã¦ãããè¦ããã¨ãåºæ¥ããããã«ãã¦ã³ããã¤ã³ãã確èªã§ãã¦ä¾¿å©ã§ããã takuya@:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1.8T 0 disk /mnt/464fâ¦
ããªãã¶ãã¯ãªã§ãã æ¸ããã®ã§ã¡ã¢ã diskutil ã³ãã³ãã¯ä½¿ãã¨ãã¯é »ç¹ã«ä½¿ãã®ã«ã使ããªãæã¯å ¨ã使ããªãå¤ãã£ãã³ãã³ãã ãµãã³ãã³ããããå¿ããã®ã§competion ã«ãã¦ããã gist.github.com
2018-03-03 è¿½è¨ ext4fuse ãä¾¿å© â ãã®æç« ã®æå¾ãåç §ãã¦ãã ãã 以ä¸ã®ãã¼ã¸ã§ã³ã§ãR/W åºæ¥ããã¨ã確èªããã Version: ext4fuse-0.1.3 OSXFUSE 2.8.5 ã¨ã³ããªæ«å°¾ã® 追 è¨ ã«æ¸ãã¾ããã ææ°çã使ãéãã§ã¯ã以ä¸ã®ext2ã§ã®å¼·å¶FUSEãã¦ã³â¦
debian / ubuntu ã®å ´åã®ãã©ã³ãã®è¿½å æ¹æ³ 追å ããããã©ã³ãã ~/.fonts 以ä¸ã®å¥½ããªå ´æã«ç½®ãã°å¤§ä¸å¤«ã ã·ã¹ãã å ¨ä½ã§ä½¿ãã·ã¹ãã ãã©ã³ãã追å ãããã®ã§ããã° /usr/local/share/fonts/ ã®ä¸ã«ãã©ã«ããä½ã£ã¦ãã©ã³ãã追å ããã ãã®å¾ suâ¦
javascript ã§ç»é¢ã®æ¡å¤§çãåå¾ããã«ã¯ window.innerWidth == document.width //æ¡å¤§ç¸®å°ãã¦ããã window.innerWidth / document.width //æ¡å¤§ç window.innerWidth / document.body.clientWidth // æè¿ã¯ã³ãã window ã®å¹ ã¨document ã®å¹ ãæ¯è¼ããâ¦
Function ã使ã£ã¦é¢æ°ãä½ã Function ã®ã³ã³ã¹ãã©ã¯ã¿ã使ã£ã¦é¢æ°ãä½ã var a = new Function("c", "return c"); a(1) //=>1 使ãæ¹ new Function ( å¼æ°, å¼æ°,,,, é¢æ°æ¬æ) ãã¤ã³ãã¯ãå ¨ã¦ãæååã§æ¸¡ãç¹ã«ããã function(c){ return c } // ãâ¦
js ã® typeof ã調ã¹ã ããããæãã¨ãããããã調ã¹ã¦ãããã å¤å¥å¼ çµæ typeof 1 'number' typeof "aaa" 'string' typeof 0 'number' typeof null 'object' typeof undefined 'undefined' typeof "" 'string' typeof false 'boolean' typeof true 'bâ¦
eval ããªãã¦ãããæã Function.call(this, "return "+ v )(); javascript ã®æ·±æ·µã«è§¦ããæ°ããã var a = {name:"takuya",say:function(){console.log(this.name)}} //=>{ a: 'takuya', say: [Function] } var b = a.say.toString() //=>'function (){câ¦
é »ç¹ã«ä½¿ãã³ãã³ã㧠ãã¹ã¯ã¼ãå ¥åãã¦ãã¨ãªãªã«ãå°å¹´ã«ãªãã ãã¨ãã°ãyum/aptã³ãã³ãã¯ä½¿ããªãæ¥ãªãã¦ç¡ãã«çããã¨æãã®ã sudo yum install ãã®ãããªã³ãã³ãã§ãã¹ã¯ã¼ããå ¥åãã¦ãã¨ã大ããã§ã¯ãªããã¨æã£ãã ã¾ãå ¥åãé »ç¹ã«è¡â¦
ç»é¢ã®åããå¤å®ããã«ã¯ CSS ã® matchMedia ã使ã ç»é¢ã®åãã横ã縦ãå¤å¥ãããã¨ãåºæ¥ã css ã§ç¸¦ã®æã ãã«é©ç¨ãããã¹ã¿ã¤ã«ã¯ããã @media (orientation : portrailt ){ } ãã®CSSã®ãããã³ã°ããJavascript å´ããè¡ãã«ã¯ window.matchMediaâ¦
ãã©ã¦ã¶çµç±ã§ãã¡ã¤ã«ã®ownerãå¼ããã㪠ã§ãã chown ã£ã¦ root ãã許å¯ããã¦ãªããã§ãããã chown ããã¨ãã¼ããã·ã§ã³ç®¡çãç ´ç¶»ããããããããããã§ããããã 解決ç : sudoers ã«è¨è¿°ãã ãããsudoers 使ãããç¡ãã§ããã Cmnd_Alias â¦
JavaScript ã®JSONã¯primitiveãªå¤æ°ã ãããæ±ããªãã£ãã JSONã¨ããã®ã¯ãæ¬å½ã«ãåãããã¯ãããµã ã©ã¤ã«ãªããªããã ãã JSON var obj = {"a": "takuya", "say":function(){ console.log(`My name is ${this.a}.`) } } obj.say() //=>My name is taâ¦
mysql ã§ã¦ãã«ãªutf-8 ãããªãã«ã©ã ãä½ã£ã¡ãã£ãã å¤æ´ãããã¨ã¯åºæ¥ãªãã®ãï¼ èª¿ã¹ããåºæ¥ããã ã¨åãã£ã Alter Table ã使ã ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; ããã§æ¥æ¬èªã®æååããã解æ¶ãâ¦
HDDãå£ããã¨ã©ããªãã®ã 復æ§ããåã«ç¢ºèªãã¦ãããã¨ã«ããã smart ã§ã¨ã©ã¼ãè¦ãããã®ã§ããããã¾ã¾ã§æå ã®HDDãã¨ã©ã¼ãåºãããã¨ããªãã£ãã ã¨ã©ã¼ãåºãã®ã§è¨å¿µã«æ®ããã¨ã«ããã Smartã§ã¨ã©ã¼ãåºãããããªãã¾ããã£ã¦ã®ãè¦ãã¦ããâ¦
github ã®Issueã¨ã³ããããé¢é£ä»ãã ã³ãããã¡ãã»ã¼ã¸ã§ãIssueã¨é¢é£ä»ããã«ã¯ git commit -m "ããããã«è¿½å #1234" ãã®ããã«ï¼ISSUEçªå·ãæ¸ãã¨é¢é£ä»ãã¦ãIssueã«é¢é£ä»ãããã github issue ãã³ãããã§éãã git commit -m "ãããã fiâ¦