728x90 반응형 SMALL 분류 전체보기695 macOS에 MySQL 설치하기 1. Homebrew 설치 $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2. MySQL 설치 MySQL 8.x $ brew install mysql MySQL 5.7 $ brew install mysql@5.7 이후부터 자신이 설치한 버전의 이름을 사용함. 5.7을 설치했다면 mysql 이 아닌 mysql@5.7 임. 3. MySQL 서버 시작 $ brew services start mysql 4. 설정 관리자 실행 $ mysql_secure_installation n 입력 후 비밀번호 입력. 익명유저 삭제 : y 외부에서 접속 : y/n test db 삭제 : y privi.. 2022. 6. 23. macOS SSH Port 변경 1. #Port 22 주석 풀고 원하는 포트로 변경 $ sudo vi /private/etc/ssh/sshd_config 2. 22번 포트 찾아서 원하는 포트로 변경 $ sudo vi /etc/services 3. SSH 재시작 $ sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist $ sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist 영어, 중국어 공부중이신가요? 홈스쿨 교재. 한 권으로 가족 모두 할 수 있어요! 한GLO 미네르바에듀 : 네이버쇼핑 스마트스토어 한글로 영어가 된다?! 한글로[한GLO]는 영어 중국어 일어 러시아어 스페인어가 됩니다!! smartstore.naver... 2022. 6. 20. [Python] Django(장고) 시작하기 1. 파이썬(Python) 설치 https://www.python.org/downloads/ 2. 장고 설치 $ pip install django 3. 매니저 생성 (폴더가 새로 생성됨) $ django-admin startproject django_test 4. 프로젝트 생성 $ cd django_test $ python manage.py startapp banjubu 5. django_test/settings.py 수정 INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django... 2022. 5. 27. [ElastiCache::Redis] 테스트 결과 1. Redis와 사용법 동일함. 2. 명시적 재부팅 불가. (버튼 비활성) 3. 데이터 유지. - 메모리 DB이므로 재부팅시 데이터가 삭제되어야 하지만 ElastiCache를 사용하면 영구적으로 유지된다고 봐도 무방함. - 인스턴스 업그레이드하더라도 데이터 유지됨. (복제본이 없어도 됨) 4. 인스턴스 업그레이드시 다운 타임 없다고 봐야 함. (데이터 양이 많은 경우는 테스트 못했으나 거의 없을 듯) 5. 높은 안정성을 위해 복제본 1개 이상 두는걸 권장. 6. 멀티 AZ를 두면 안정성이 더 높아지지만 추가 비용 발생. 2022. 5. 21. 기분을 항상 좋게 유지하는 방법 기분은 어디있을까. 머리일까 가슴일까. 옛날 사람들은. 배에 있다고 생각했지. 어디에 있던지. 기분을 간질어야겠다. 항상 기분이 좋아지겠지. 기분이 안 좋은 날이었다. 나는 대부분 기분이 좋기 때문에 기분이 나쁜게 너무 거슬렸다. 기분은 어차피 손으로 만질 수 없고 느끼는 것이기에. 어디에 있던지 상관없이 느낌으로 간지를 수 있다. 이걸 확신하는 이유는 기분을 간질었더니 다시 기분이 좋아졌기 때문이다. 2022. 5. 21. [Node.js] 초간단 공통 라이브러리 구축하기 (Github) 1. 공통 라이브러리용 깃헙 저장소 만들기 - 예) https://github.com/banjubu/banjubu-common-lib.git 2. 공통 라이브러리 저장소 루트에 index.js 생성 > 커밋 & 푸시 module.exports.banjubu = { go: function() { return "Go! Banjubu!"; } } 3. 신규 프로젝트 생성 > package.json 에 아래 코드 추가 - 처음 설치: yarn install - 코드 업데이트: yarn upgrade "dependencies": { ..., "banjubu-common-lib": "git+https://github.com/banjubu/banjubu-common-lib.git#main" } 4. app.js im.. 2022. 5. 19. [Golang] Gin + gqlgen [GraphQL] 새로운 폴더 만들고 시작할께요. 1. 설치 $ go mod init banjubu $ go get github.com/gin-gonic/gin $ go get github.com/99designs/gqlgen $ printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go $ go run github.com/99designs/gqlgen init $ rm -rf server.go 2. main.go package main import ( "banjubu/graph" "banjubu/graph/generated" "github.com/99designs/gqlgen/graphql/handler.. 2022. 5. 19. [Golang] 단숨에 GraphQL 적용하기 [gqlgen] 새로운 폴더 만들고 시작할께요. 1. 설치 $ go mod init banjubu $ go get github.com/99designs/gqlgen $ printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go $ go run github.com/99designs/gqlgen init $ go run server.go 2. graph/resolver.go package graph import "banjubu/graph/model" // This file will not be regenerated automatically. // // It serves as dependency injecti.. 2022. 5. 19. [Golang] Supervisor로 데몬 실행하기 Supervisor: Node.js 진영의 PM2와 유사한 프로세스 컨트롤러. 1. Go 빌드 > main 파일 생성 $ go build main.go 2. Supervisor 설치 $ pip install supervisor 3. supervisor.conf [supervisord] [supervisorctl] serverurl=http://127.0.0.1:9001 [inet_http_server] port = 127.0.0.1:9001 [program:ginTest] command = ./main autostart = true autorestart = true startsecs = 1 4. 실행 $ supervisord -c supervisor.conf 5. 확인 http://localhost:90.. 2022. 5. 18. [Golang] AWS CloudFront > 무효화 (CreateInvalidation) 1. S3 업로드 2022.05.18 - [IT 인터넷/Golang] - [Golang] 파일 업로드 > S3 2022. 5. 18. [Golang] 파일 업로드 > S3 1. 패키지 다운로드 $ go get github.com/aws/aws-sdk-go-v2/aws $ go get github.com/aws/aws-sdk-go-v2/config 2. 주요 코드 // 업로드된 파일 정보 imageFile, imageFileHeader, _ := c.Request.FormFile("imageFile") // 바이트 버퍼로 변환 buf := make([]byte, imageFileHeader.Size) imageFile.Read(buf) // AWS 세션 생성 session, err := session.NewSession(&aws.Config{ Region: aws.String("ap-northeast-2"), Credentials: credentials.NewStaticCr.. 2022. 5. 18. [Golang] Gin + MySQL 1. .env MYSQL_HOST = "" MYSQL_USER = "" MYSQL_PASSWORD = "" MYSQL_DBNAME = "" MYSQL_PROTOCOL = "tcp" MYSQL_PORT = 3306 2. go.mod module myproject/main go 1.16 require ( github.com/gin-contrib/cors v1.3.1 // indirect github.com/gin-gonic/gin v1.7.7 // indirect github.com/go-playground/validator/v10 v10.11.0 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/golang/protobuf v.. 2022. 5. 16. [Golang] Hello Gin 1. 설치 $ go get -u github.com/gin-gonic/gin 2. main.go package main import "github.com/gin-gonic/gin" func main() { r := gin.Default() r.GET("/echo", func(c *gin.Context) { msg := c.DefaultQuery("msg", "Banjubu") c.JSON(200, gin.H{ "message": msg, }) }) r.Run(":8080") } 3. 실행 $ go run main.go 4. 확인 http://localhost:8080/echo {"message":"Banjubu"} http://localhost:8080/echo?msg=Golang {"message":".. 2022. 5. 16. [Golang] echo 샘플2 한 줄 받는 샘플. 2022.05.15 - [IT 인터넷/Golang] - [Golang] echo 샘플 [Golang] echo 샘플 문자열을 입력하면 그대로 출력하는 예제에요. stdin.ReadString 은 주어진 delimeter 까지의 문자열을 돌려줘요. package main import ( "bufio" "fmt" "os" ) func main() { stdin := bufio.NewReader(os.Stdin).. banjubu.tistory.com 여러 줄을 받아볼께요. 엔터만 치면 빠져나가요. package main import ( "bufio" "fmt" "os" ) func main() { sc := bufio.NewScanner(os.Stdin) for sc.Scan() { tx.. 2022. 5. 15. [Golang] echo 샘플 문자열을 입력하면 그대로 출력하는 예제에요. stdin.ReadString 은 주어진 delimeter 까지의 문자열을 돌려줘요. package main import ( "bufio" "fmt" "os" ) func main() { stdin := bufio.NewReader(os.Stdin) s, _ := stdin.ReadString('\n') fmt.Println(s) } 결과. $ go run main.go Banjubu Banjubu 만약 s, _ := stdin.ReadString('=') 이렇게 했다면. $ go run main.go Banjubu=Banjubu Banjubu= 여러 줄 받는 샘플. 2022.05.15 - [IT 인터넷/Golang] - [Golang] echo 샘플2 [Go.. 2022. 5. 15. 이전 1 ··· 33 34 35 36 37 38 39 ··· 47 다음 728x90 반응형 LIST