기본 콘텐츠로 건너뛰기

cloudatcost 에서 외부 인터넷 연결이 안될 때

전원 한번 껐다 켰더니 모든 linux 서버들이 다 안된다. https://panel.cloudatcost.com/index.php  에서 해당 서버의 console 버튼 눌러서 보니 ifconfig 해본 결과 실제 panel의 IP정보와 다르게 설정이 되있더라. (덧. 여기서 console 이라고 함은 ssh 터미널 같은 게 아니라 cloudatcost에서 VMWare로 관리하는 웹스크린캐스트 같은 거라고 보면 됨) 근데 windows server는 멀쩡하고 linux 서버만 안되는게 이상해서 ticket 넣었더니  VMWare console로 진입한 뒤 network configuration 을 맞춰보라고 하더라. Fabio P Hello, In the case of the VM with IP 64.137.182.39, you have to go inside the configuration file and edit it. Make sure that all the network configuration is the same as the information shown to you on panel. You will have to do the same for the other two VMs. Let us know if further assistance is required. Have a great day. 음. network configuration 이라니 VMWare의 configuration이 있나? 이것저것 뒤져보다가 도저히 모르겠어서 GG 리붓하고 났더니 이번엔 console 자체도 진입이 안됨. ticket 또 쓰고 reboot 했더니 다시 돌아와서 어떤 거 수정하면 되냐 하고 또 물어봄. 내가 어느정도 알고 있을지를 모르니 첨 부터 자세하게 얘기를 안해주는구나. 얘들 스타일인갑다. 결국 Fabio P Hello, For your Ubuntu machine, you can use this lin...

django REST API practice like a boss

pycharm 안녕. django project 생성. 실행환경은 virtualenv로 3.6.x virtualenv 생성에 약간 시간 소모. setting.py와 urls.py가 반겨줌 djex1 프로젝트를 만들었음 __init__.py settings.py urls.py wsgi.py 요렇게 생김. 자, 게임을 시작해볼까? option+R 누름. 이런 애가 나옴. startapp product 라고 쳐서 product 업무를 만들어보자. 자동완성이 된다. product 아래 admin.py apps.py models.py tests.py views.py 이런 파일들이 생겼다. rails 생각이 난다. 내용물은 텅텅 비어서 실망스럽다. comment라도 있을 줄 알았는데. 여튼 텍스트로 hello world 같은 건 안찍어본다. 바로 rest API http://www.django-rest-framework.org/tutorial/quickstart/ 돌입한다. pip install djangorestframework 뭔가 설치했으니 requirements.txt로 pip freeze하여 깡통인 곳에서 설치할때 pip install -r requirements.txt로 설치할 수 있게 만들자. pip freeze > requirements.txt REST API framework는 설치했고 DB를 만들자. 먼저 migrate을 돌려주자. option+R 상태에서 migrate 엔터 Running migrations:   Applying contenttypes.0001_initial... OK   Applying auth.0001_initial... OK   Applying admin.0001_initial... OK   Applying admin.0002_logentry_remove_auto_add... OK...

firebase functions 위에 올라간 apollo server 에 apollo engine 끼얹기

이전 글에서 계속. https://www.apollographql.com/docs/engine/setup-node.html  보고 진행해보자. 미리 가입하고 키도 받아놓자. ENGINE_API_KEY 를 잘 copy 해놓자. app.use '/graphql',   bodyParser.json()   graphqlExpress {     schema     context: {}     tracing: true     cacheControl: true   } 먼저 /graphql 쪽 graphqlExpress 에 두개의 키(tracing, cacheControl)를 추가하자. npm install --save compression apollo-engine 두 패키지를 설치하고 compression = require 'compression' { Engine } = require 'apollo-engine' 압축과 엔진을 추가하고 engine을 하나 만들자. engine = new Engine   engineConfig:     apiKey: 'service:acidsound-6459:wKt62uPKS9dmxmBhFh-cZA'   endpoint: '/api/graphql'   graphqlPort: process.env.PORT or 80 engine.start() 여기서 graphqlPort를 지정하지 않으면  Error: Neither 'graphqlPort' nor process.env.PORT is set. In order for Apollo Engine to act as a proxy for your GraphQL server, it needs to know which port your GraphQL server...

firebase /w functions + graphQL backend 만들기

persistence 영역을 graphQL 로 일반화 하고 apollo engine 같은 cache를 사용하고 싶다. firebase의 functions를 통해 firebase를 불러오는 건 사실상 이중 작업인 것 같지만 apollo engine이 매우 맘에 들어 끌어들이고 싶다. 먼저 해볼 것은 functions에 graphql을 집어넣고 정적데이터를 읽어오는 것 먼저 로컬에서 구현해본다. 프로젝트 폴더를 생성하고 firebase init functions 부터 하자. 프로젝트를 선택(혹은 생성하고 ? What language would you like to use to write Cloud Functions? JavaScript ✔  Wrote functions/package.json ✔  Wrote functions/index.js 그냥 firebase init 하고 functions를 선택하는 것과는 달리 뭔가 기본 scaffold를 생성해줘서 좋다. {   "functions": {     "source": "functions"   } } 디폴트로 이렇게 해주자. index.coffee 로 get 테스트. exports하는 놈 이름이 functions 이름이 되고 경로도 /[exports한 놈]/ 이 되는 점이 특징이다. functions = require 'firebase-functions' admin = require 'firebase-admin' admin.initializeApp functions.config().firebase exports.addMessage = functions.https.onRequest (req, res)->   original = req.query.text?   admin.firestore()     .collection 'messages'     .add { origin...

cycle.js driver에 대한 정리.

cyclejs는 observable을 logic, subscribe를 effect로 각각 분리하고 서로 순환하는 구조인 full reactive framework 이다. 예를 들면 1초(1000ms)마다 스트림을 발산하는 text$는 매번 fold(reduce)하여 1씩 증가하고 "Second elapsed xx"로 map하는 text$=xs.periodic(1000)   .fold(prev=>prev+1,0)   .map(i=>`Second elapsed ${i}`) 를 logic. 이를 subscribe 하여 #app element의 텍스트로 넣는 것을 text$.subscrbie({   next: str => document.querySelector('#app').textContent = str }) 를 effect로 볼 수 있다. 이를 각각 함수로 구분하여 const sink = ()=> xs.periodic(1000)     .fold(prev=>prev+1,0)     .map(i=>`Second elapsed ${i}`); const domDriver = text$ => text$.subscribe({   next: str => document.querySelector('#app').textContent = str }); domDriver(sink); 이와 같이 재정의 할 수 있다. 같은  logic에 대해 DOM 렌더링과 log를 분리하려면 logDriver를 아래와 같이 추가하여 const logDriver = msg => console.log(msg); logDriver(sink); 하여도 마찬가지. subscribe한 객체의 observable만 있으면 DOM이건 console이건 canvas건 websocket이건 어느쪽이든 effect를 만들어 낼 수 있다. ...

Rasbperry Pi Zero W 에 Docker 설치함. (/w raspbian)

w3c 컨퍼 갔다왔더니 docker를 다시 잘 써보고 싶어졌다. 귀염둥이 Raspberry Pi Zero W를 꺼내서 ssh 접속하고 docker-ce를 설치해본다. $ echo "deb [arch=armhf] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list deb [arch=armhf] https://download.docker.com/linux/debian jessie stable $ sudo apt update && sudo apt install docker-ce -y --force-yes Get:1 https://download.docker.com jessie InRelease [20.2 kB]                                  Hit http://mirrordirector.raspbian.org jessie InRelease                                        Ign https://download.docker.com jessie InRelease                          Hit https://download.docker.com jessie/stable armhf Packages Hit http://archive.raspberrypi.org jessie InRel...

LG G Pro 2 Custom Rom +Rooting 기록

선 루팅 https://forum.xda-developers.com/lg-g3/general/guide-root-lg-firmwares-kitkat-lollipop-t3056951 1.2버전 스크립트 모드로. echo Looking for LG serial port.. echo. adb.exe wait-for-device 여기에서 정체 상태여서 강제로 adb kill-server 했더니 알아서 재부팅하심. 폰에선 "펌웨어 업데이트"화면이 나오고 Phone found at COM5! Rooting phone.. If you don't see the SuperSu installer script runs within about a minute, then the root failed. Author : blog.lvu.kr SPECIAL COMMAND : ENTER, LEAVE ## 이런 상황이 됨. #이 느린 속도로 하나씩 증가하고 있음. 한 시간 기다려도 성과없음. 뭐 몇번해봐도 안되고 결국 불안하긴 하지만 kingroot.net  로 설치 롤리팝이니까  https://drive.google.com/file/d/0B4kfGU1z_PClQ3AyM2lKOGR1S3M/view  이걸 받아서 압축 풀기. d838recovery.bat 만 있어서 당황스럽긴한데 실행하고 1번 하니까 리커버리 모드 진입까진 잘 되는 듯. adb sideload 라는게 있어서 해봄. Advance에서 adb sideload 선택하고 USB연결한 PC에서 adb sideload RR-N-v5.8.5-20171010-d838-Final.zip 하니까 착착 잘 진행됨. 이제 흉측한 U+LTE 가 없어짐. ㅇㅋ 군더더기 없고 깔끔한데 남은 건 gapps 를 설치해야함. http://opengapps.org/  를 권해줘서 갔는데 지옥 느림. ARM + 7.1 + stock 이 기본이...