2019-09-01ãã1ã¶æéã®è¨äºä¸è¦§
systemd ã§ã¿ã¤ãã¼ãä½ã£ã¦ã¿ããã§ãããã¿ã¤ãã¼ãåããªãã®ã§æ©ãã§ããã§ãã systemd ã§ã¿ã¤ãã¼ãä½ã£ã¦ãenableãã¦è¦ããã ãã©ãåããªããã§ããã ã¿ã¤ãã¼ãä½ãæé service ä½ã£ã¦ timer ä½ã£ã¦ service ãèµ·åãã start ãã¦ãã§ã㯠enabâ¦
laravel ã® Eloquent ã®ã¢ãã«ãå¥ã®ããã¸ã§ã¯ãããã±ã±ã£ã¨ä½¿ãã Consoleã¨ãããããAPIä½ãã°å®ç¾ã¯ã§ãããã§ãæ¢åã®ãã®ã¨çµã¿åãããã¨ãã¯ãDBãç´æ¥æ¸ãæããã»ããæ©ãæãããã æ¬å½ã¯ããã¸ã§ã¯ãã®å¤é¨ããç´æ¥è§¦ãã®ã¯è¯ããªãã¨æããâ¦
èªåèªèº«ã®é¢æ°ã®ååãç¥ãããã é¢æ°åã¯ãé¢æ°åã表ãå¤æ°ã«å ¥ã£ã¦ããï¼BASHã§ç¢ºèªï¼ echo ${FUNCNAME[0]} ããã使ãã¨ãèªåèªèº«ã®é¢æ°åãå®è¡ä¸ã«åç §ã§ããã takuya@Desktop$ function sample() { echo ${FUNCNAME[0]} ; }; sample sample 便å©â¦
nginx ã§SSHã®æ¥ç¶ã転éãããã¨ãåºæ¥ã¾ãã nginx ã«ã¯ ã¹ããªã¼ã ããã®ã¾ã¾è»¢éãããã¨ãåºæ¥ãæ©è½ãããã®ã§ãTCPã»IPã®ãã¼ããã©ã¯ã¼ããã§ãã¦ãã«ã¼ã¿ã¼çãªåä½ãåºæ¥ã¾ãã nginx.conf stream { upstream ssh { server 192.168.2.8:22; } servâ¦
lvm é¢é£ã®ã³ãã³ã㯠root ã®ã¿ lvm ã³ãã³ããå®è¡ãããã¨æã£ã¦ããroot ã«å¶éããã¦ããã®ã§ã使ããªããã¨ãããå°ã£ãã®ã§ãä¸è¬ã¦ã¼ã¶ã¼ã«éæ¾ãããã¨ã«ããã sudoers ã«è¨±å¯ãããã³ãã³ãã®ãã«ãã¹ãåæããã°ããã Cmnd_Alias LVM = /sbin/â¦
ãã£ã¹ã¯ã®æå·åããã CPUã«AES-NI ã®å½ä»¤ã»ãããè¼ã£ã¦ããã®ã«ããã£ã¹ã¯ãæå·åããªããªãã¦ãå¿ä½ç¡ãã¨ã¡ãã£ã¨æã£ã¦ããã§ãã iPad / iPhone ã® iOS ã¯ãã¡ããã®ãã¨ãAndroidã§ãããã£ã¹ã¯ã¯æå·åããã¦ããã¨ããã®ã«ãPCã使ãæã ã¯æå·â¦
pvcreate ã§ãã£ã¹ã¯ã追å ãããã¨ãããã¨ã©ã¼ã«ãªã£ãã pvcreate /dev/sdb ignoring or filtering ãªããã¨ã©ã¼ã«ã¡ãã»ã¼ã¸ã ignoring or filtering ã§ãã£ã¹ã¯ã追å ã§ããªã ä»ååã£ã対çã fdisk ã§é©å½ãªGPT/MBRã®ãã¼ãã£ã·ã§ã³ã«ãã¦ããã®å¾ â¦
ext4 ã16TiB以ä¸ã®ãã£ã¹ã¯ã«ãªããªãã ext4 㯠ã¨ã¯ãµãã¤ããæ±ããã¯ããªã®ã§ãããresize2fs ããããã¨ããããã¨ã©ã¼ã«ãªãã¾ããã ãªããã¨ãã㨠32bit ã§å©ç¨ããã¦ãããã£ã¹ã¯ãã©ã¼ãããã ã£ããããã ããããã°ãããããã¶ãé·ããã¨æ¡â¦
LVMã§ãã£ã¹ã¯ã交æããã¨ãã¯æåã«ããã®ã¯ãã æ°ãããã£ã¹ã¯ãLVMã«æ¥ç¶ã LVã«å²ãå½ã¦ãã pvmove ã§ãã£ã¹ã¯äº¤æ vg ããåãå¤ã ç©ççã«åãåºã vgããå¤ããã£ã¹ã¯ã®åãå¤ã( VG容éã«ä½è£ãããã¨ãã容éãæ¡å¼µããã¨ãï¼ vg ãããã£ã¹ã¯â¦
ã¤ãªã³ã«ã¼ãã®ãã°ã¤ã³ã«ã¯ã³ã¿ã¤ã ãã¹ã¯ã¼ãã®éä¿¡ç»é¢ãããã©ããã ã¤ãªã³ã«ã¼ãã«PCãããã°ã¤ã³ããã¨ãã¯ã³ã¿ã¤ã ãã¹ã¯ã¼ãã®éä¿¡ç»é¢ã«ãªãã ããã¯ããªã¹ã¯ãã¼ã¹èªè¨¼ã¨å¼ã°ãããã®ã§ããããªã¹ã¯ãé«ãã¢ã¯ã»ã¹ã¯ã追å èªè¨¼ããè¦æ±ããã¨ãâ¦
xargs ãããã¨ããåºæ¥ã¾ãã xargs -n1 echo ä¾ ç©ºç½åºåããããæååãã±ã±ã£ã¨è¤æ°è¡ã«ããã xargs 㨠echo ãçµã¿åãããã¨æ¥½ã takuya@~$ echo hello world hello world hello world hello world | xargs -n1 echo hello world hello world hello â¦
laravel ã§migrate ããã¨ããç¹å®ã®ãã¡ã¤ã«ã ããå®è¡ããã migrate refresh ã¨ãã ã¨å ¨é¨ã®ãã¼ãã«ãåçæããã¡ããã®ã§ãå¥ã®ãã¼ãã«ãã¼ã¿ãæ¶ããã«ç¹å®ã®ãã¼ãã«ã ããåæ§ç¯ãããã ãµã³ãã« æå®ãããã¤ã°ã¬ã¼ã·ã§ã³ã®ãã¡ã¤ã«ã ããå®è¡ãâ¦
ãã使ããã®ã ãæç² lvm ã®ã¢ã¬ã³ã¬ã¯ãã£é£ã°ãã¦ããã使ãã³ãã³ãã ããæç²ãã¦ã¡ã¢ã«æ®ãã¾ãã ä½ã£ã¦ããpv ãã容éã追å ãã pv 㨠vg ã«å®¹éã¯å²ãå½ã¦æ¸ã¿ã¨ããã sudo lvextend -L +10g vg/temp_cache çµãã£ãããext4 ããªãµã¤ãºããã sâ¦
å°å·ãã¬ãã¥ã¼ã®CSSã触ããã å°å·ãã¬ãã¥ã¼ã® media type print css ãããã£ãããã§ãã¯ãããããããã°ãããã表示ããããã®ã§ç´ãããã¨ããããã¾ãã CSSã®ããªã³ããå°å·ãã¬ãã¥ã¼ã§ãã§ãã¯ããã®ã¯éæ¹ãç¡ãæéããããã ããã§ãå°å·ãâ¦
PostgreSQL ã§ã¿ã¤ã ã¹ã¿ã³ããæååã¨ãã¦åãåºããã char ã«ãã£ã¹ãããã¨ãã«é·ããã¤ãã now() ã®å ´å select now()::char(30); å®è¡çµæ sample> select now()::char(30); +--------------------------------+ | now | |-------------------------â¦
ã©ã³ãã ãªINTãã»ãã cast ã®å ´åã¯ãã select cast(random()*100 as integer); ::int ã使ã£ããã£ã¹ãã使ãå ´åã¯ãããªæã floor(random() * 1000 + 1)::int; åèè³æ https://www.postgresql.jp/document/9.4/html/functions-math.html
Google Chrome ã®éçºãã¼ã«ã«æ¡å¼µæ©è½ãéªé ãã©ã¤ãã¼ãã»ãã©ã¦ãºã»ã¢ã¼ãã§ã¢ã¯ã»ã¹ããã°ãæ¡å¼µæ©è½ã®ãªã¯ã¨ã¹ããã°ããé ããã¨ãåºæ¥ããã ããããæ¡å¼µæ©è½ã®ããã«ãã©ã¤ãã¼ããã©ã¦ãºã§æªä¸ããã®ãé¢åã§ãããã ãããã¯ã¼ã¯ã®ãã£ã«ã¿ã使â¦
mac ã§VPNãæ¥ç¶ããã Macã«æ¨æºã®ãµã¼ãã¹ã使ã£ã¦è¨å®ãã¦ããPPPç³» LT2P over TLS ã®ãããªè¨å®ã ã¨networksetup ããåºæ¥ã scutil ããããã©ãnetworksetup ã§ããããç§ã¯ãã£ã¡ã mac ã§VPNã«æ¥ç¶ããã«ã¯ networksetup -connectpppoeservice "$VPNâ¦
sudo -e (ååï¼sudoedit ) ã³ãã³ãã¯ä¸æãã¡ã¤ã«ã§ç·¨éãã sudo -e ã¨ã¯ç°å¢å¤æ°EDITORã使ã£ã¦ã/tmp ãã©ã«ãã«ãã¡ã¤ã«ãä½ã£ã¦ãããéãã¦ãããã ã¨ãã£ã¿ã®ããã»ã¹ãçµäºããããå ã®ãã¡ã¤ã«ã«ä¸æ¸ãããã :w ã ãã§ã¯åæ ãããªã vim ã§éâ¦
xvfb-run ã§å®è¡ãã㨠stderr ãåããªãã /usr/bin/xvfb-run ã使ãã°æ¥½ãã§ããã Xvfb ãèµ·åãã¦DISPLAYå¤æ°ãã»ãããã¦ãDISPLAYå¤æ°ã渡ãã¦å¥éèµ·åãããã¨ããããã»ã¹ç®¡çãã±ã±ã£ã¨ãã£ã¦ãããã·ã§ã«ã¹ã¯ãªããã§ãã ãããstderr ãåããªâ¦
php ã§å®è¡ç°å¢ããã§ãã¯ããã«ã¯ PHP_OS ã¨ãããã¦ã«ãã©ç´ æ´ãããå®æ°ããæåããçµã¿è¾¼ã¾ãã¦ãã¾ãã
Excel ã§æ°åãã¼ãåãããã 000123 ã®ããã«æ°åãï¼ã§åãããã¨ã§ãæ¡æ°ãæã£ãããè¦èªæ§ãããã®ã§æ¡ç¨ãã人ãå¤ãã¨æãã¾ãã ã¾ããæ大æ¡æ°ãä¸ç¥ãã¦ãããã®ãé åã§ããã ã¼ãåãã¯ãã¥ã¼ãã³ã¤ã³ã¿ãã§ã¼ã¹*1ã¨ãã¦ã対人éã¨ã®æ å ±ã®ãâ¦
excelã®æ¸å¼è¨å®ãå¤ããã¨ããã ãªãããã»ã«ã®æ¸å¼è¨å®ã§ 0000 ãè¨å®ããå度ç»é¢ãéãã¨ãæ¸å¼è¨å®ã次ã®ããã«ãéæ¥æ¬èªå¤å®ããã¦ãã¾ãã¾ããã ç§ã¯å°æ¹¾ã¯ã¹ããªãã ãã©ããã¾ãã®Excelã§å°æ¹¾ãæ±ãã¦ãªããã§ãã ãªããä¸å½å¤å®ããã¦ãã¾ããâ¦
PostgreSQL 㧠PostgreSQLã«ãã¨ããUNIQUEå¶ç´ã追å ããã ALTER TABLE "TABLE_NAME" add constraint "your_name_of_constraint_key" uniq ("COLUNM_NAMES"); PostgreSQL ã«ãã¨ããUNIQUEãåé¤ãã ALTER TABLE "TABLE_NAME" drop constraint "your_nameâ¦
Docker ã§èµ·åããUbuntuããããã«åºãããªãã docker ã³ã³ããå´ããã¤ã³ã¿ã¼ãããã¸ã®ãããã¯ã¼ã¯ã®çéã確èªããã ä»åã¯ããªãããéä¿¡ãã§ããªãã£ãã®ã§ãã¨ã©ã¼ã«ãªãããããªãçºçããã®ã§åå ãæ¢ã£ã¦ããã çéç¢ºèª docker run busybox piâ¦
macã®ã¡ãã¥ã¼ãã¼ã®é ç®ã表示ã»é表示ããã®ãã¡ã³ãã¯ãµ VPN ãæ¥ç¶ããã¨ãã ãã¡ãã¥ã¼ãã¼ã«è¡¨ç¤ºãã¦ãããã°ããã®ã«ãVPNã使ããªãã¨ããVPNã¡ãã¥ã¼ãã§ã¦ããã®ã¯éªéã ããã defaults ã§å¶å¾¡ã§ããã ã¡ãã¥ã¼ãã¼ã®é ç®ã¯ãdefaults ã§è¨å®å¤â¦
443 㧠default_server ãå ¥ãããéä¿¡ããããããªã件 nginx ã§ãã¡ã¤ã³ããã£ãããªã¼ã«ãã¦ãå¥ãµã¼ãã¼ã®nginx ã¸ä¸¸æããããå¤æ®µnginx ã®è¨å®ãæ¸ãã¦ãããã80 ã ã¨åããã ãã©ã443 ã§åããªãã listen 443 ssl https default_server ãã¤ããã¨â¦
iOS ã®ã·ã§ã¼ãã«ããã®ã¢ããªã§ä½æãããã®ã¯åãåºãã¾ãã ãã¡ã¤ã«ã¨ãã¦åãåºãããã§ãã ä¿åããã¡ãªãã ã·ã§ã¼ãã«ããããã¡ã¤ã«ã¨ãã¦ä¿åãããã¨ãã§ããä¸èº«ãé²è¦§ãããã¨ãåºæ¥ã¾ããä¸èº«ã¯ plist ã§ããplitul ãªã©ã§ä¸èº«ç·¨éãããã¨ãâ¦