Tag: software

  • 리모드 서버에 ssh private key를 저장하지 않으려면

    Agent forwarding 을 쓰면 됩니다. 그러면 매번 서버에 키를 만들지 않아도 되고 특히 서버를 믿지 못하는 경우 (남의 서버를 임대한다거나) 보안 문제를 피할 수 있습니다.

  • What to do when resource is exhausted in GCE

    If “resource is exhausted” and can’t start a VM instance for that reason, one way would be creating reservations. Downside of that is that it’s too costly since “Reservations are billed at the same rate as their reserved resources”. Instead, one can try creating the instance in other cells. For that, they need do these…

  • Auto shutdown idle gce instance

    There’s a few posts to do this on the net, but it looks like they miss some points, e.g., not resetting counts when a machine has been idle. This code is improved version. And then you can add it to your VM like this:

  • Timeseries dataset generation in tensorflow

    I find tf.keras.utils.timeseries_dataset_from_array difficult to use for the reasons like 1) it picks the first number in an array as y value (as opposed to the last), 2) it doesn’t allow to use multiple values as y. So I wrote a trivial code example that anyone can easily customize. In the code below, given [0,…

  • Out of memory in Executor.map

    https://github.com/python/cpython/issues/74028 Executor.map 은 iterator에 있는 모든 입력을 submit 한 뒤에야 결과를 yield 합니다. 따라서 입력이 매우 크거나 무한의 데이터라면 out of memory 로 인해 죽게됩니다. 실제 에러는 이보다는 좀더 알기 어렵게 나오지만 메모리 사용량을 모니터링해보면 결국 메모리 탓인건 알 수 있습니다. Executor.map을 쓰겠다면 데이터를 잘라서 메모리에 맞게 주거나 아니면 producer consumer 형태로 큐에 데이터를 넣고…

  • Causal profiling

    실험적으로 일부 코드의 속도를 늦추거나 빠르게하면 해당 부분이 전체 latency 에 주는 영향을 알 수 있다는 방법이 causal profiling 입니다. https://www.usenix.org/conference/atc16/technical-sessions/presentation/curtsinger 만약에 distributed critical path tracing 이 있다면 좋겠지만 그런건 만들기도 어렵고 정착시키기도 어렵기때문에 정말 똘똘한 아이디어인듯 합니다. https://queue.acm.org/detail.cfm?id=3526967 비슷한 사례로 legacy code deprecation을 할때 카운터 넣어서 legacy code 로 얼마나 많은 traffic 이 가는지…

  • keras의 timeseries_dataset_from_array 사용시 주의할 점

    timeseries_dataset_from_array 에 대한 github issue 예를들어 X=[1, 2, 3], y=[2, 3, 4] 일때 sequence_length=2 라면 X=[1, 2], y=[3] 이 올거라고 생각하지만 아니다. y=[2]가 옴. 다시말해 y는 x 의 시작점의 값임. 간단하게는 y를 shift 해서 호출하면 해결되지만 API에 이런 점이 있다는걸 놓치기 너무 쉽다. 이슈가 그냥 닫혀버려서 더욱 아쉬움.

  • Google Cloud Workstation vs Codespace

    https://cloud.google.com/workstations?hl=ko#section-7 구글 클라우드 워크스테이션이란 서비스가 ec2 보다 ide 연결해서 쓰기는 훨씬 좋아보입니다. 유휴 시간이 길어지면 자동 종료로 비용 절약하고, 종료뒤 재시작시에는 보안 패치등이 잘 적용된 최신 이미지로 실행됩니다. 홈 디렉토리는 종료와 상관없이 유지됩니다. 다만 gcp 를 직접 사용하는 경우 대비 비용은 높고 (e2 기준 약 2배?) 현재까진 gpu 인스턴스는 없습니다. 비슷한 서비스로 github codespace가 있습니다.…

  • 간단한 파일 암호화

    개인 파일을 클라우드 등에 저장할때 보안이 걱정된다면 – 예를들어 동기화시킨 윈도우가 해킹 된다거나 – ccrypt가 정말 간편한 툴입니다. 이렇게 간단하게 암호화하고 풀때는 ccrypt -d 파일명으로 합니다.

  • 보고 잘 하는 법

    주니어에서 시니어 엔지니어로 넘어가는 단계에 반드시 익혀야 하는 기술이 보고하는 방법입니다. 그게 잘 안되서 정체가 되는 사람도 있고 하루가 다르게 달라지는 사람도 있습니다. 자리에 앉혀졌기에 크게 달라지는 사람도 있고, 앉혀져도 끝까지 하던데로만 하는 사람도 있습니다. 저는 심지어 주간 회의에 자기가 한일을 “메일을 보냈는데 답이 안와서 다시 메일을 보냈습니다” 라고만 딱 말하는 박사 학위 팀원도 봤습니다.…