flutter 에서 fcm 을 추가하기 위해 firebase core 와 firebase messaging 을 추가하고 빌드하려니 에러 발생.

--------------

firebase_core: Using Firebase SDK version '8.10.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '8.10.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In Podfile:
    firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.11.0, which depends on
      Firebase/CoreOnly (= 8.10.0)

None of your spec sources contain a spec satisfying the dependency: `Firebase/CoreOnly (= 8.10.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

-----------------------

 

대략 이런 에러.. 이게 M1 프로세스에서 주로 발생하는 에러인듯하다.

 

뭐 이것저것 많이 해봤다

ios/Podfile.lock 파일을 지우고 pod update 하세요~ 등등

해결이 안되더라.. pod update 부터가 막혀버려서.

 

그러다 찾은 해결법

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

이렇게 하니 바로 설치가 되었다. pod install 명령은 ios 폴더에 들어가서 해야할지도..? ios 폴더에서 작업중이었어서 루트폴더에서도

되는진 확인 안해봤다.

 

해결~

어떤 기능에 대한 코드를 아주 많이 작성하는 경우도 있다.

이런 느낌으로?

 

이게 줄이 길어질수록 한눈에 딱딱 보기가 조금 어려워진다

예전에 유니티할땐 #region ~~ 으로 묶을수가 있었는데 flutter[dart] 에서는 그런기능이 없나? 찾아봤다

 

https://marketplace.visualstudio.com/items?itemName=maptz.regionfolder 

 

#region folding for VS Code - Visual Studio Marketplace

Extension for Visual Studio Code - Provides folding for text wrapped with #region comments in VS Code.

marketplace.visualstudio.com

 

vscode의 이 extension을 쓰면 되더라.

사용법은 간단하다

vscode 에서 해당 extension 을 설치하고 코드에 #region, #endregion 만 입력해주면 끝

 

 

//#region 과 설명을 적고

//#endregion 으로 어디까지 묶을것인가 적는다

 

그다음 #region 왼쪽의 화살표를 누르면

 

이렇게 #region ~ #endregion 까지 접힌다. 굿.

nginx로 웹서버를 하나 열었더니 권한 에러가 뜬다

 

"/root/master/index.html" is forbidden (13: Permission denied),

 

해당 index.html 의 권한을 먼저 보고 

 

ls -l

 

root 사용자로 돼있다.

 

이후 nginx 설정 파일을 수정하자

 

nano /etc/nginx/nginx.conf

 

첫줄의 user 를 root 로 바꿔주니 해결됐다.

 

이것저것 찾아보니 방법이 많던데

나는 이걸로 해결돼서 일단 올려놓음

'Dev' 카테고리의 다른 글

Nginx 에서 Socket.io 세팅하기  (0) 2023.02.11
[Nginx] 에러 로그 실시간 확인 하기  (0) 2021.11.23
Fail2ban 설치  (0) 2021.06.07
[Raspbian] 라즈베리 파이 VNC 접속하기  (0) 2021.03.17
[Linux] ssh server 자동 실행  (0) 2021.02.16
tail -f /var/log/nginx/error.log

tail 명령어에 -f 옵션을 줘서 실시간으로 변경되는걸 확인 할 수 있다

'Dev' 카테고리의 다른 글

Nginx 에서 Socket.io 세팅하기  (0) 2023.02.11
[Nginx] 403 forbidden ( 13 : permission denied )  (0) 2021.11.23
Fail2ban 설치  (0) 2021.06.07
[Raspbian] 라즈베리 파이 VNC 접속하기  (0) 2021.03.17
[Linux] ssh server 자동 실행  (0) 2021.02.16

0.

 

집에 라즈베리파이를 설치, 서버를 열어놨다.

근데 어느순간부터 ssh가 렉이 엄청 먹길래

무슨일인가 싶어서 보니 cpu 사용량이 100%를 찍고있었다. 아무것도 안했는데

 

그래서 해킹인가 싶어서 ssh 접속 기록을 찾아봤다

 

sudo nano /var/log/auth.log

 

난리가 났다. 모르는 아이피에서 엄청나게 짧은 간격으로 계속 접속을 시도하고 있었다.

fail2ban 을 설치해서 한번 무차별 접속을 막아보자

 

1. 설치

 

sudo apt install fail2ban

 

2. 세팅

 

세팅 파일을 작성하자

sudo nano /etc/fail2ban/jail.local
# jail.local

[DEFAULT]
# 최대 입력 허용 횟수
maxretry = 5

# 밴 시간 (초), -1 : 영구
bantime  = -1

[sshd]
enabled = true

# 22번 포트가 아닌 다른 포트를 사용 중 이라면 변경
port = ssh
filter = sshd
logpath = /var/log/auth.log

 

간단하게 이정도만 작성했다. 필요한 기능이 있으면 공식 홈페이지에서 찾아보는걸로.

제일 하단에 공홈 링크 첨부

 

sudo service fail2ban restart

 

서비스를 재시작해서 작성한 세팅 파일로 시작되도록

 

3. 확인

 

밴이 잘 되고 있는지 확인해보자

sudo fail2ban-client status sshd
Status for the jail: sshd
|- Filter
|  |- Currently failed: 3
|  |- Total failed:     11
|  `- File list:        /var/log/auth.log
`- Actions
   |- Currently banned: 5
   |- Total banned:     5
   `- Banned IP list:   116.252.80.181 123.207.198.153 139.155.55.250 218.92.0.208 223.39.219.159

 

5개의 ip가 밴된걸 확인 할 수 있다.

 

나도 실수로 밴 될수도 있으니 밴 해제 명령어도 있다

sudo fail2ban-client set sshd unbanip [ip]

 

https://www.fail2ban.org/

 

Fail2ban

Since spammers were way too much active on this wiki, user account creation has been disabled. Please, ask on the mailing-lists if you require a new user account. Thank you for your understanding and sorry about that. To experiment with this wiki try Sandb

www.fail2ban.org

 

+ Recent posts