기본 콘텐츠로 건너뛰기

MariaDB 요약

MariaDB 요약 설치 macOS MariaDB 설치 brew install mariadb 리눅스 (apt) MariaDB 설치 sudo apt update sudo apt install mariadb-server mariadb-client 보안 설정 mysql_secure_installation 명령 sudo mysql_secure_installation 설정 테이블 직접 변경 루트 계정으로 로그인 mysql -u root mysql DB 사용 use mysql root 계정 비밀번호 생성 UPDATE user SET password=password('비밀번호') WHERE user='root' 유저 권한 갱신 flush privileges (혹은 서버 재시작) 이후 루트 계정 로그인 mysql -u root -p 유저 생성 루트 계정으로 로그인 후(위 보안설정 참고) 유저 생성 CREATE USER '유저이름'@'접속위치' IDENTIFIED BY '비밀번호' 권한 설정 GRANT ALL PRIVILEGES ON DB이름.* TO '유저이름'@'접속위치' 권한 갱신 flush privileges (혹은 서버 재시작) 접속위치 : localhost, 특정 아이피, 호스트이름, %(모든 주소 허용) 그 외 mysql 클라이언트 명령어 현재 유저 확인: SELECT USER() 현재 DB 확인: SELECT DATABASE()

Docker on Windows Bash

Docker for Windows 설치 bash에서 유저 홈 디렉토리의 .bashrc파일에 아래 내용을 추가한다. export PATH="$HOME/bin:$HOME/.local/bin:$PATH" export PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin" alias docker=docker.exe alias docker-compose=docker-compose.exe

Docker 요약

Docker 요약 기본 명령어 시작 명령어 및 시작 옵션 (run: pull, create, start) docker run [OPTION] [IMAGE:tag] [COMMAND] [ARGS...] [OPTION] -d detached mode (백그라운드) --name 컨테이너 이름 설정 -it interactive, terminal -p 포트 연결 ( -p HostPort:ContainerPort ) -P EXPOSE된 모든 포트를 연결한다. 이미지 삭제 docker rmi [IMAGE_NAME] 모든 컨테이너 보기 docker ps -a 종료된 모든 컨테이너 삭제 docker rm $(docker ps -a -q) 컨테이너에서 특정 명령 실행 docker exec [OPTION] [CONTAINER_NAME] [COMMAND] 데이터 볼륨 마운트 (예: MySql) docker run -v /my/own/hostDir:/var/lib/mysql mysql:5.7 Dockerfile 이미지 생성을 위한 설정 파일. 이 파일이 있는 디렉토리에서 Docker build 실행 시 이 파일을 기반으로 이미지 빌드. FROM : 기반 이미지 파일 (FROM mariadb/server) USER : 아래 RUN 명령어를 실행할 유저 지정 (USER root) RUN : 터미널 명령 실행. 이미지 빌드 때 실행 (RUN apt-get update) WORKDIR : 터미널에서의 작업 경로 설정 (WORKDIR /etc) ENTRYPOINT : 터미널 명령 실행. 컨테이너 실행 시 실행 (ENTRYPOINT ./npm) CMD : 터미널 명령 실행. 컨테이너 실행 시 실행. 어플 실행, ENTRYPOINT의 파라메터 등에 쓰임 (CMD [“executable”,“param1”,“param2”] - ENTRYPOINT가 설정되어 있으면 [“param1”,“param2”]...

Nano editor shortcut

Command Line Arguments -A Makes the Home key behave more intell­igently (moving to beginning of non-wh­ite­space charac­ters, instead of the beginning of the line, as is default.) -B Backs up edits to a copy of the file in the current directory with the suffix ~. -E Convert typed tabs to spaces. -L Don't add newlines to the ends of files. -N Disable automatic conversion of files from DOS/Mac format. -O Use the blank line below the titlebar as extra editing space. -S Enable smooth scrolling. Text will scroll line-b­y-line, instead of the usual chunk-­by-­chunk behavior. -c Constantly show the cursor position. -w disable wrapping of long lines. -$ Enable softwrap (wraps lines instead of horizontal scrolling.) NOTE: Because  $  is treated as a variable by many execution enviro­nments, it is advisable to flag this option separately from others you may be using, e.g.:  nano -ALNc -$ textfi­le.txt nano [OPTIONS] [[+LIN...

Docker Tutorial (Docker Toolbox)

https://www.docker.com/products/overview 설치파일 다운로드. 내 맥북은 가상화를 지원하지 않는 CPU를 가진 2009년형. 그래서 Docker for Mac 사용불가하여 Docker Toolbox 설치. mkdir yourdockerbuild cd yourdockerbuild touch Dockerfile nano Dockerfile FROM imageNameOnHub:version - 불러올 이미지 RUN *** - 최초 실행할 명령 (설치명령 등. image 안에 설치됨) CMD *** - 이미지가 로딩되면 실행할 명령 docker build -t yourImageName . docker run yourImageName 추가로 hub를 통하지 않고 Image를 이동 하려면 Docker Registry 사용 도커 레지스트리 (Docker Registry) 설치하기 + S3 연동

Install Mongodb on Raspberry Pi (jessie, wheezy)

MongoDB official site has detail install instruction. but there's some difference to follow on Raspberry Pi. Raspberry Pi is based on Debian. so I go with Debian Instruction basically. https://docs.mongodb.com/master/tutorial/install-mongodb-on-debian/#import-the-public-key-used-by-the-package-management-system see briefly 1. Importing the Public Key sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 2. Creating a List File echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list and if you need do  sudo apt-get update 3. Installing and Verifying MongoDB sudo apt-get install -y mongodb 4. Run if use wheezy version Raspbian sudo service mongod start if usejessie version Raspbian sudo systemctl start mongodb

라스트오브어스 멀티 연결오류 해결법 (ps3)

열심히 라오어 멀티를 즐기고 있었는데 갑자기 어느날 멀티가 안되시던 분들 있죠? ps3 최신 업데이트가 되면서 생긴 문제인데요. 임시방편으로 아래와 같이 하면 됩니다.  1. 멀티플레이 접속. 2. 바로 ps버튼 누르고 3. 접속 게이지 3/4 지점에서 다시한번 ps버튼을 누릅니다. 4. 창이 하나 뜨는데 이때 x 버튼을 누릅니다. 5. 연결성공! 도움이 됐길 바랍니다. 

Start GPIO node.js app at Raspberry pi starting (systemd)

/etc/systemd/system/yourService.service [Unit] Description=yourService [Service] ExecStart=/usr/bin/node yourPrj/bin/www User=pi Restart=always [Install] WantedBy=multi-user.target Start node as service sudo systemctl start /etc/systemd/system/yourService.service Check service status  sudo systemctl status /etc/systemd/system/yourService.service View a log sudo journalctl

Linux Terminal Commands

File Permissions chmod 777 – read, write, execute for all  chmod 755 – rwx for owner, rx for group and world  File Commands  ls -al – Formatted listing with hidden files  mkdir dir – Create a directory dir  rm name – Remove a file or directory called name  rm -rf dir – Force remove an entire directory dir and all it’s included files and subdirectories (use with extreme caution)  cp -r dir1 dir2 – Copy dir1 to dir2; create dir2 if it doesn't exist  cp file /home/dirname – Copy the filename called file to the /home/dirname directory  scp -p 22 file user@host.com:/home/ - Secure Copy file to host.com /home directory as user through port 22  mv file /home/dirname – Move the file called filename to the /home/dirname directory  ln -s file link – Create symbolic link link to file  cat originFile > targetFile – Places standard input into new file (not work on ssh)  cat origin...

[ 3D개념 정리 ] Forward Rendering, Deferred Rendering

Forward Rendering 메쉬 하나 그릴때 조명 텍스쳐등도 같이 그린다. 아마도 개별 매쉬 당 연산 시간이 많아질 듯. 조명이 많아지면 렌더링도 더 오래 걸릴듯. Deferred Rendering 버퍼 텍스쳐를 만듦 (조명 등의 적용을 위한 텍스쳐) 버퍼 텍스쳐에 조명 렌더링 메쉬 다시 그리면서 버퍼 텍스쳐 렌더링 (Deffered 텍스쳐 등등) 차이점은 Foward Rendering은 렌더링 한번에 모두 처리, Deferred Rendering은 여러번의 렌더링을 거치며 처리. 참고 자료 [2012 대학특강] 아티스트 + 프로그래머   from  포프 김

[ 3D개념 정리 ] Texture Methods와 Light

Texture diffuse map (color map) : 조명의 확산, 컬러등의 정보가 담긴 텍스쳐 specular map : 재질에 따른 반사율을 다르게 하기위한 텍스쳐 (광택) normal map : 평평한 텍스쳐에 굴곡을 주기위한 텍스쳐 ambient occlusion (A.O.) : 주변물체와 근첩함으로 생기는 암부 표현위한 텍스쳐 Light directional light : 태양 (모든 면에 일정각도로 비췸) point light :  랜턴 (방향있는 조명) rim light : 후광 (윤곽이 또렸해지는 효과) fresnel effect : 빛의 반사각에 따라 밝기나 색상이 다름 (호수표면 효과?)

FlashDevelop에서의 ANE 간단 사용법

1. FlashDevelop에서 AIR 프로젝트 생성. 2. ANE 파일을 프로젝트 폴더의 적당한 곳에 복사해온다. 3. FlashDevelop 프로젝트 창에서 해당 ANE 파일을 오른쪽 클릭하여 Add To Library 클릭. 4. 다시 ANE 파일 오른쪽 클릭 후, Options 클릭 -> External library (not included) 선택. 5. FlashDevelop 프로젝트 창에서 AIR 속성(AIR App Properties) 클릭 후, Extensions 탭에 Extension ID 추가. (Extension ID는 ANE배포자가 문서나 swc등에 명세해놓았을 겁니다.) 6. 프로젝트 폴더안의 bat 폴더에 있는 Packager.bat 파일을 텍스트 에디트 프로그램으로 열어서, adt 옵션에 '-extdir ANE폴더'를 추가해 준다. 7. application.xml에 필요한 퍼미션을 추가해준다.    예) 안드로이드 진동 기능.    Android Permission : <uses-permission  android:name="android.permission.VIBRATE"/> 8. 컴파일 후 테스트 참고로 WIFI 디버깅이 안되면? - 컴과 폰이 같은 네트워크인지 확인. - 프로젝트 폴더\bat\SetupApplication.bat의 DEBUG_IP가 자신의 컴 아이피(IP4v)인지 확인 Android 플랫폼에서 테스트 해 본 내용 입니다. iOS는 좀 다를거에요.

Node.js에서 크롬을 이용해 디버깅해보자

요즘 Node.js를 틈틈히 보고있다. 크롬에서 디버깅 할 수 있는 툴이 있네. node-inspector 1. node.js 설치 ( http://nodejs.org/ 에 설치파일 있음) 2. node-inspector 설치 ( 커맨드라인에서  npm install -g node-inspector  )      github link 3. node.js 실행 ( 커맨드라인에서 node --debug HelloWorld.js ); 4. node-inspector 실행 ( 커맨드라인에서 node-inspector ); 5. 크롬에서 http://127.0.0.1:8080/debug?port=5858 접속 6. 소스파일 열어서 break point를 걸어본다. 7. 마우스 오버 해보면 상세내역 나옴. 우왕 8. 이제 개발 해보자.

Flashdevelop에서 F1키로 한글 도움말 보기

Flashdevelop의 메뉴에서 Tools -> Program Settings -> AS3Context 에서 Documentation의 Documentation Command Line 값을 아래와 같이 변경 http://help.adobe.com/ko_KR/FlashPlatform/reference/actionscript/3/$(ItmTypPkgNamePath).html#$(ItmName) Flashdevelop을 새로 깔았더니 기존 방법이 안되네요. 다른 포스팅들에서 알려주는 방법이 작동 안되면 이 방법으로 해보세요.

Sublime Text 2에서 Haxe, NME를 사용하기 위한 셋팅

1. S ublime Text 2 설치 2. Package Control 설치 Sublime Text 2에서 'ctrl + `' 키를 눌러서 콘솔을 연다. 이걸 붙여넣고 엔터 import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation' 3. Sublime Text 2의 Command Palette를 열어서 Package Control: Install Package 실행 후, Haxe 검색해서 설치 (Haxe 검색결과 없을땐 gitHub에서 가져와야 함. 여기 참조 ) 4. Build System에서 hxml 선택 후, 컴파일 할 파일을 연다. (Haxe: hxml파일, NME: nmml파일) 5. Target Platform 선택 - Ctrl + Shift + b 6. Build And Run - Ctrl + Enter