• [linux] 주요 명령어

    현재 폴더 용량확인

    $ du -hs
    


    특정폴더 용량확인

    $ du -hs foldername
    


    하위 폴더별 용량확인

    $ du -h --max-depth=1
    
  • [mongoDB] 자동 백업

    backup.sh 작성

    #!/bin/sh
    mongodump -h 127.0.0.1 -u root -p xxxx -o /home/ec2-user/dbbackup/dump_$(date +%y%m%d-%H%M)
    


    Read on →

  • [express] https 세팅

    private key 생성

    $ openssl genrsa 1024 > key.pem
    Generating RSA private key, 1024 bit long modulus
    ............................................++++++
    ............................................................++++++
    e is 65537 (0x10001)
    $ cat key.pem
    -----BEGIN RSA PRIVATE KEY-----
    MIICXQIBAAKBgQDyjJcALHArMrTK1j67ZjZhW55r9vxHKw7VmFWksYSGkXsiu4kA
    V4Um9xDqGw3Ghpur4X9V1qU6qp83IcNSSQ4UES9HtTGjMTlSCeIugdPKB2KYOzz8
    qVG/bRIoviVaqNdKNk4ICUttxdfxG7GsmA7fW+JEkDi2ZdtbUEkQYJ5YdQIDAQAB
    AoGALm+SHTtkwjB0An1gBzq7YIpM2ziu9eUdcvE2PFCsIaNKosyqnwEigeI9P8Ss
    L3zn4taKMqHkgkXWM5ToMyG/auKuIFeFqiStM6r9pOn99JVU84mmaqG4wfQFT1m/
    pBpZ1ZbiWlTz14FrsK6PejvPA6qoJgNLL0SDHqJiuPJWoOECQQD9XXkWhRKZMgm3
    obbFB4SDh3YE01yPXRyYkMvQbTRnq92gffXrprga/Jalhq2DPg+Hkl4xR6+1mKcb
    209s7n0ZAkEA9RJSZDK5Jgx1OZkpqVs0iJ6UUNsvL9HqkpOyrrGaXqyOyW8r0VTh
    9SQwMtGNeFFC3qkMbzfq0uW+WvaXfb6FvQJAd0IIP6FmL7Xd3RHBdfyT41Vft+XF
    K7YoP6foR7Mfd6zuJR0lJEbVYd6CsAc0pRIRPT8oFwonKtMv1WzldeDMAQJBAIIv
    T3FGuLALoiIMyOLcPlXs16D0Lmbavh9LMno2gmiUhe1fjwlObBILPUdhpiMqF7ms
    V5yikbeir7ImmGcF1IkCQQChTL6TXGbPmQZQvT/mIygIeCF4JYR2G4tnDsdPkvRi
    BduVNDzKkBk/8AvfqAxWEARL9QX5jVx3LsfmtpsABvqC
    -----END RSA PRIVATE KEY-----
    $ ls -al
    total 80
    drwxr-xr-x   9 sm  staff    288  7  9 12:40 .
    drwxr-xr-x  20 sm  staff    640  7  4 11:08 ..
    -rw-r--r--   1 sm  staff    887  7  9 12:39 key.pem
    $ 
    

    Read on →

  • [js] 배열의 마지막 요소 참조

    일반적으로 배열의 마지막 요소를 아래와 같이 인덱스 참조로 접근할 수 있지만,

    let arr = [1,2,3];
    arr[arr.length-1]
    

    Read on →

  • Fuction.prototype.apply, call, bind 차이점

    Function.prototype.apply

    문법

    function.apply(thisArg, [argsArray])
    

    Read on →