2022년 11월 21일 월요일

[ubuntu] ubuntu 20.04 고정ip 수동 설정 방법

 ubuntu 20.04  고정ip 수동 설정 방법


설정된 항목 확인

# nmcli con


설정된 이더넷 항목 상세내용보기

# nmcli con show eno1 | grep ipv4

=> eno1 대신 자신의 보고자하는 이더넷포트네임을 적는다.


고정ip 설정하기

# nmcli con mod eno2 ipv4.method manual

# nmcli con mod eno2 ipv4.address 172.16.10.110/21

# nmcli con mod eno2 ipv4.gateway 172.16.10.2

# nmcli con mod eno2 ipv4.dns 172.16.10.17,172.16.10.18

=> 수동 : manual, 자동할당시에는 : auto


설정정보 적용
# nmcli con down eno1; nmcli con up eno1

이때, 원격연결시, 연결하는 ip를 변경한거였다면 터미널 연결이 끊김을 주의



2022년 11월 18일 금요일

[bitcoin] 파이썬으로 비트코인 지갑 주소 만들기

 

1. https://www.python.org/downlaods/ 에서 파이썬 다운받아 설치

2. cmd 창열기

3. pip install bitcoin

4. python 엔터로 파이썬 프롬프트로 진입

5. >>>  from bitcoin import *

   >>> private = random_key()

   >>> print(private)

   >>> pub = privtopub(private)

   >>> pub 

   >>> public= pubtoaddr(pub)   

   >>> public

6. 비트코인주소확인하기

https://www.blockchain.com/explorer/assets/BTC



2022년 11월 2일 수요일

[Flutter] Dart에서 getter, setter 함수 만들기

 Dart 에서 get, set 함수를 만들수있습니다.

private 변수를 get, set 함수를 이용해서 값을 가져오거나 넣을 수 있습니다.




get 함수와 set 함수 입니다.

get함수 name을 호출하면,  _name 의 변수가 null이 아니라면, _name 의 값을,

null 이라면, empty 를 출력합니다.


set함수 name에 값을 넣어주면, 넣어준 값이, _name에 저장됩니다.


위 get, set 함수 사용 예 입니다.



이 구문의 실행 결과입니다.



set을 통해 입력한값들을 확인 할 수 있습니다.

2022년 10월 31일 월요일

[Flutter] android 릴리즈모드 빌드한 apk 를 스마트폰 설치 후, 네트워크 에러 해결방법

 Flutter 개발 하다보면, 릴리즈 모드로 빌드해서 apk 를 직접 스마트폰에 설치하는 일을 해 볼 것이다.


개발 모드 그러니까, 개발 피시에서 직접 폰에 바로 빌드를 하면, 앱에서 사용하는 네트워크동작이 잘 되는데, 

릴리즈 모드로 apk를 빌드해서 직접 스마트폰에 설치해서 실행해 보면,

로그인 페이지는 뜨지만 로그인되지 않고 네트워크오류가 발생 한다.


원인은 Internet 권한 문제 때문이다.




개발 모드에서 네트워크 연결이 잘 되는 이유는,

profile 폴더아래, AndroidManifest.xml 파일에, 이미 권한 허용 구문이 들어있기 때문이다.

<uses-permission android:name="android.permission.INTERNET"/>


이 구문이, main 폴더아래, AndroidManifest.xml 파일에 넣어 줘야한다.



해당 권한 구문을 넣으면 네트워크 오류 없이 개발모드와 동일하게 동작하는 것을 볼 수 있을 것이다.

2022년 10월 27일 목요일

[Flutter] Dart 문법설명 (try catch, rethrow, finally, assert, forEach, for in, continue, break)

Dart 문법설명을 해보자

중요해보이는 문법 위주로 정리한다.


try catch

//try catch
try {
var num = null;
num ++;
} catch (e) {
print('e : ${e.toString()}');
}
print('finish!');
=>
e : NoSuchMethodError: method not found: '$add' on null
finish!

catch 에 잡힌후, 다음 구문 실행 됨.


try catch rethrow

//try catch rethrow
try {
var num = null;
num ++;
} catch (e) {
print('e : ${e.toString()}');
rethrow;
}
print('finish!');
=>
e : NoSuchMethodError: method not found: '$add' on null
Uncaught TypeError: Cannot read properties of null (reading '$add')Error: TypeError: Cannot read properties of null (reading '$add')

rethrow를 만나고 프로그램 정지됨.


try catch finally

//try catch finally
try {
var num = null;
num ++;
} catch (e) {
print('e : ${e.toString()}');
rethrow;
} finally {
print('print finally!');
}
print('finish!');
=>
e : NoSuchMethodError: method not found: '$add' on null
print finally!
Uncaught TypeError: Cannot read properties of null (reading '$add')Error: TypeError: Cannot read properties of null (reading '$add')

rethrow를 만나도, finally 는 무조건 실행됨.


assert

//assert
var count1 = 10;
assert(count1 == 1); // => Exception has occurred

=>

Uncaught Error: Assertion failed

코드실행 하다 assert 문구 false 면 정지.


var count2 = 10;
assert(count2 == 10); // => pass
print('finish');
=>
finish

assert 문구  true이면 코드 통과


forEach

//forEach()
var collection1 = ['bmw', 'hyundai', 'kia', 'honda'];
collection1.forEach((element) {print('collection1 : ${element}');});
=>
collection1 : bmw
collection1 : hyundai
collection1 : kia
collection1 : honda


for in

//for in
var collection2 = ['bmw', 'hyundai', 'kia', 'honda'];
for(var element in collection2) {
print('collection2 : ${element}');
}


=>
collection2 : bmw
collection2 : hyundai
collection2 : kia
collection2 : honda


continue

//continue
var collection3 = ['bmw', 'hyundai', 'kia', 'honda'];
for(var i=0; i<collection3.length; i++) {
if(i>=2) continue; // => exit to for
print('i=${i}');
}
=>
i=0
i=1

for문에서 continue 를 만나면 for문을 빠져나감.


break

//break
var i = 0;
while(true) {
i++;
print('i=$i');
if(i>=2) break; // => exit to while
}
=>
i=1
i=2

while문에서 break를 만나면 while문을 빠져나감.



---- English ----



Let's explain Dart grammar

Focus on the most important grammar.


try catch

//try catch
try {
var num = null;
num ++;
} catch (e) {
print('e : ${e.toString()}');
}
print('finish!');
=>
e : NoSuchMethodError: method not found: '$add' on null
finish!

After being caught by catch , the next statement is executed.


try catch rethrow

//try catch rethrow
try {
var num = null;
num ++;
} catch (e) {
print('e : ${e.toString()}');
rethrow;
}
print('finish!');
=>
e : NoSuchMethodError: method not found: '$add' on null
Uncaught TypeError: Cannot read properties of null (reading '$add')Error: TypeError: Cannot read properties of null (reading '$add')

Meets rethrow and program halts.

try catch finally

//try catch finally
try {
var num = null;
num ++;
} catch (e) {
print('e : ${e.toString()}');
rethrow;
} finally {
print('print finally!');
}
print('finish!');
=>
e : NoSuchMethodError: method not found: '$add' on null
print finally!
Uncaught TypeError: Cannot read properties of null (reading '$add')Error: TypeError: Cannot read properties of null (reading '$add')

Even if rethrow is encountered, finally is executed unconditionally.


assert

//assert
var count1 = 10;
assert(count1 == 1); // => Exception has occurred

=>

Uncaught Error: Assertion failed

Execute the code and stop if the assert statement is false.


var count2 = 10;
assert(count2 == 10); // => pass
print('finish');
=>
finish

If the assert statement is true, the code will pass.


forEach

//forEach()
var collection1 = ['bmw', 'hyundai', 'kia', 'honda'];
collection1.forEach((element) {print('collection1 : ${element}');});
=>
collection1 : bmw
collection1 : hyundai
collection1 : kia
collection1 : honda


for in

//for in
var collection2 = ['bmw', 'hyundai', 'kia', 'honda'];
for(var element in collection2) {
print('collection2 : ${element}');
}


=>
collection2 : bmw
collection2 : hyundai
collection2 : kia
collection2 : honda


continue

//continue
var collection3 = ['bmw', 'hyundai', 'kia', 'honda'];
for(var i=0; i<collection3.length; i++) {
if(i>=2) continue; // => exit to for
print('i=${i}');
}
=>
i=0
i=1

If continue is encountered in the for statement, the for statement is exited.


break

//break
var i = 0;
while(true) {
i++;
print('i=$i');
if(i>=2) break; // => exit to while
}
=>
i=1
i=2

When a break is encountered in a while statement, the while statement is exited.




2022년 10월 26일 수요일

[Flutter] mutable 과 immutable 에 대해서

 Dart 언어에서 뿐만 아니라, 다른 개발 언어에서도, 마찬가지로 알고 가야 할 개념인

mutable과 immutable 개념을 알아보자


mutable  : 변경가능, immutable : 변경 불가능


예를 들어, 

class Car {
int? id;
String? model;

Car({this.id, this.model});
}

void main() {
Car car = Car(id:1, model:'m1');
Car car2 = car;

print('car, id=${car.id}, model=${car.model}');

car2.model = 'm2';

print('car2, id=${car.id}, model=${car.model}');
print('car, id=${car.id}, model=${car.model}');
}

결과값

car, id=1, model=m1
car2, id=1, model=m2
car, id=1, model=m2

car2 에 car를 받아서, car2의 변수를 변경했는데, car2 의 model 변수 뿐아니라,

car의 model 변수 값도 변경되었다.

이경우, car의 주소값이 car2에게 복사 된것이므로 같은 주소값을 가지고 있기때문이다, 그래서 car 객체 변수는 mutable 한 것 이다.


car2를 다른 주소값으로 갖게하게끔 Car객체를 생성하고 싶다면,

Car car2 = car;

대신, Car car2 = Car(id:1, model:'m2'); 라고 새로 객체를 생성해주면, car와 별개의 주소값

을 갖게된다.


다른예로,

final name1 = 'David';

const name2 = 'Paul';

둘다, immutable에 해당하는 변수 이다.

값을 할당하면, 다시 변경 불가능한 변수가 되게 final과 const를 붙였기 때문이다.ㅏ

final과 const는 값이 할당되는 시점의 차이가 있다.

final은 컴파일 이후, 런타임 에서 값을 할당 할 수 있다.

그러나 한번 할당 된 값은 변수가 초기화 되기전에는 다시 다른 값으로 변경불가하다.

const는 컴파일 될 때, 값을 할당되는 것이다. 따라서, 런타임 시에는 더이상 값을 할당할수 가 없다.


---- English ----


Not only in Dart language, but in other development languages as well, it is a concept that you need to know.


Learn the concepts of mutable and immutable


mutable : mutable, immutable : immutable


for example,

class Car {
int? id;
String? model;

Car({this.id, this.model});
}

void main() {
Car car = Car(id:1, model:'m1');
Car car2 = car;

print('car, id=${car.id}, model=${car.model}');

car2.model = 'm2';

print('car2, id=${car.id}, model=${car.model}');
print('car, id=${car.id}, model=${car.model}');
}

result

car, id=1, model=m1
car2, id=1, model=m2
car, id=1, model=m2


I received car in car2 and changed the variable of car2, not only the model variable of car2,

The value of the model variable of car has also been changed.

In this case, the car's address value is copied to car2, so it has the same address value, so the car object variable is mutable.


If you want to create a Car object so that car2 has a different address value,

Car car2 = car;

Instead, Car car2 = Car(id:1, model:'m2'); If you create a new object with

will have


In another example,


final name1 = 'David';

const name2 = 'Paul';

Both are variables that are immutable.


This is because when you assign a value, it becomes final and const so that it becomes an immutable variable again.


The difference between final and const is when a value is assigned.


final can be assigned a value at runtime after compilation.


However, the value assigned once cannot be changed to another value until the variable is initialized.


const is a value assigned at compile time. Therefore, it is no longer possible to assign a value at runtime.





2022년 10월 25일 화요일

[Flutter] 함수 파라미터 설명



Dart언어에서 함수 파라미터 사용방법을 설명한다.


Positional parameters : 함수 인자 위치대로, 파라미터를 입력해줘야한다.

Named parameters : 함수 인자를 위치에 상관없이, 파라미터명 이름으로 지정하여 값을 입력해 줘야한다.

optional : 함수에서 받는 파라미터와 상관없이 입력할 값을 생략할 수 있는 사항인 경우이다.

required : 반드시 해당 파라미터는 값을 입력해 줘야한다.



아래 예제 코드에서,
Positional parameters 의 경우에서, 파라미터가 optional 인지, required 인지 예제이며,

또는

Named parameters 의 경우에서, 파라미터가 optional 인지, required 인지 예제를 설명한

사항이다.


class Car {
int? id;
String? model;

// Positional parameters
// int id, String model => required
Car(int id, String model) {
this.id = id;
this.model = model;
}
}

class Train {
int? id;
String? model;

// Named parameters
// int? id, String? model => optional
Train({int? id, String? model}) {
this.id = id;
this.model = model;
}
}

class Ship {
int? id;
String? model;

// Named parameters
// required int id, required String model => required
Ship({required int id, required String model}) {
this.id = id;
this.model = model;
}
}

class Bike {
int? id;
String? model;
int? price;

// Positional parameters
// int id => required, [String? model, int? price = 1000] => optional
Bike(int id, [String? model, int? price = 1000]) {
this.id = id;
this.model = model;
this.price = price;
}
}

class Airplan {
int? id;
String? model;
int? price;

// Named parameters
// int id => required, {String? model, int? price = 3000} => optional
Airplan(int id, {String? model, int? price = 3000}) {
this.id = id;
this.model = model;
this.price = price;
}
}

void main() {
Car car = Car(1, 'm1');
print('Car, id=${car.id}, model=${car.model}');

Train train = Train(model: 't1');
print('Train, id=${train.id}, model=${train.model}');

Ship ship = Ship(model: 's1', id: 3);
print('Ship, id=${ship.id}, model=${ship.model}');

Bike bike1 = Bike(4, 'b1');
print('Bike1, id=${bike1.id}, model=${bike1.model}, price=${bike1.price}');
Bike bike2 = Bike(4, 'b1', 5000);
print('Bike2, id=${bike2.id}, model=${bike2.model}, price=${bike2.price}');

Airplan airplan = Airplan(4, model: 'b1', price: 4000);
print('Airplan, id=${airplan.id}, model=${airplan.model}, price=${airplan.price}');
}


--- English ---

Describes how to use function parameters in Dart language.




Positional parameters: You must input parameters according to the position of the function argument.


Named parameters: Regardless of the location of the function argument, you must specify the parameter name and input the value.


optional : This is a case where the value to be input can be omitted regardless of the parameters received from the function.


required : The parameter must be entered with a value.



In the example code below,

In the case of Positional parameters, an example of whether the parameter is optional or required,


or


In the case of named parameters, this is an example of whether a parameter is optional or required.

2022년 10월 24일 월요일

[Flutter] factory 싱글톤 클래스 테스트

 factory를 사용해서 싱글톤 클래스를 만들어 테스트 해보기.


생성자에 factory 문구 추가

class DB {
static final Map<String, dynamic> _table = <String, dynamic>{};
static final DB _db = DB._internal();

DB._internal();

factory DB() {
return _db;
}

set(String key, dynamic value) => _table[key] = value;
get(String key) => _table[key];
}

main 함수에서 위 DB클래스를 테스트

DB db1 = DB();
db1.set('id', '1');
db1.set('lang', 'korean');

print('db1_id: ${db1.get('id')}, db1_lnag: ${db1.get('lang')}');

DB db2 = DB();

print('db2_id: ${db2.get('id')}, db2_lnag: ${db2.get('lang')}');

실행 결과

I/flutter ( 7655): db1_id: 1, db1_lnag: korean

I/flutter ( 7655): db2_id: 1, db2_lnag: korean



_table은 DB 클래스에서 데이터 저장하는 static final Map 변수입니다.

_db는 DB 객체화 하며 내부 함수 호출하여 실행

main() 에서 DB객체 1번을 만들어 set 으로 데이터 넣어주고, 

print출력하고

DB 객체 2번을 만들어서 다시한번 print출력으로 DB 2번객체의 get 값을 확인하면,

DB객체1 번에 저장한 값이 가져옮을 알수 있다.

DB객체를 계속 생성해도, 처음 사용된 객체를 사용하고 있음을 확인할 수 있다.



--- english ---


Create and test a singleton class using factory.


Add factory statement to constructor

class DB {
static final Map<String, dynamic> _table = <String, dynamic>{};
static final DB _db = DB._internal();

DB._internal();

factory DB() {
return _db;
}

set(String key, dynamic value) => _table[key] = value;
get(String key) => _table[key];
}

Test the above DB class in the main function

DB db1 = DB();
db1.set('id', '1');
db1.set('lang', 'korean');

print('db1_id: ${db1.get('id')}, db1_lnag: ${db1.get('lang')}');

DB db2 = DB();

print('db2_id: ${db2.get('id')}, db2_lnag: ${db2.get('lang')}');

Execution result

I/flutter ( 7655): db1_id: 1, db1_lnag: korean

I/flutter ( 7655): db2_id: 1, db2_lnag: korean



_table is a static final map variable that stores data in DB class.

_db is a DB object and executed by calling an internal function

Create DB object No. 1 in main() and put data as set,

print out

If you create DB object 2 and check the get value of DB 2 object again with print output,

You can see that the value stored in DB object 1 can be moved.

Even if you continue to create DB objects, you can confirm that the first used object is being used.


2022년 10월 23일 일요일

[Flutter] Future, async, await 사용방법

 async 는 비동기 명령사용시 함수에 사용합니다.

비동기 명령은 네트워크통신으로 서버에서 데이터를 요청할 때 또는 delay time이 필요한 명령을 사용할때 사용합니다.

비동기 명령을 사용하는 이유는, 처리시간이 걸리는 명령(코드)에서 메인쓰레드를 잡아 기다리게하지 않고, 별도 쓰레드에서 처리하기 위해서 입니다. 비동기 명령을 통해, 메인쓰레드에서 하는 터치또는 화면표시 렌더링은 비동기명령 처리 시 기다리지 않고 처리됩니다.

await을 설명하겠습니다. 비동기 명령을 사용하는 함수에서 async를 붙여 사용하는데, 비동기명령을 실행 할 때 await를 명령 또는 함수 앞에 붙여주면, 해당 async 붙인 함수 내에서는 await 를 붙인 함수가 실행될때 까지 기다린 후, 다음 명령을 실행합니다.

Future 는 async 를 붙인 함수의 return값을 반환할때 반환형에 함께 붙여 사용합니다.


---- test code ----

void main() {

    print('test 1');

    print('name: ${getName()}');

    print('test 2');

}

Future<String> getName() async {

    print('test 3');

    var name = await requestName();

    print('test 4');    

    return name;

}

---- run result ----

test1

test2

test3

test4






---- english ----


async is used for functions when using asynchronous commands.


Asynchronous commands are used when requesting data from the server through network communication or when using commands that require delay time.


The reason for using asynchronous commands is to process them in a separate thread, rather than waiting for the main thread to wait for commands (code) that take time to process. With an asynchronous command, the touch or display rendering done in the main thread is processed without waiting when processing the asynchronous command.


Let me explain await. Async is used in a function that uses an asynchronous command. When executing an asynchronous command, if await is added before a command or function, the async function waits until the awaited function is executed and then executes the next command. .


Future is used together with the return type when returning the return value of a function to which async is attached.





2022년 10월 21일 금요일

[Flutter] 서버에 데이터 보내는 방법과 서버에서 데이터 받는 방법

✌ 안녕하세요.

Flutter는 Http post 방식으로 서버에 API 요청 할 때, 파라미터를 넘기는 방법에 대해 설명 합니다. 

http.post 함수를 사용할 때, body 에, 파라미터를 담아서 보냅니다.

json 형태로 작성하되, jsonEncode() 함수에 담아서 보냅니다.

예시) jsonEncode([{'id':1, 'date':'2022-10-21'}, {'id':1, 'date':'2022-10-21'}])


위 와 같이 Flutter에서 서버에 있는 API를 파라미터를 담아 요청 시, 파라미터가 API에 제대로 전달이 되어야만 합니다.

이때 서버의 API 수신 파라미터 수신객체가 Object 로 받으면, 파라미터의 포맷은 Map 형태가 됩니다.

서버의 언어가 JAVA인 경우, 그리고 Spring boot 에서 API를 만들고, 파라미터를 Object로 받으면, LinkedHashMap 형태로 들어옵니다. 

그러면 Map에서 각 항목을 key값으로 꺼내서, 사용해야합니다.

매번 Map에서  각 항목을 key값으로 꺼내와야 하는 번거로움이 생깁니다.

불편하다면, 다른 방법으로, 수신파라미터 형태를 Object로 받지말고 특정객체로 생성하는 걸로 받으면 됩니다.

예를들어, Searched.java파일을 만들어, 변수로, 수신 받을 key값으로 정의합니다.

그러면, Map 형태 대신, Searched 형태로 받을 수 있습니다.

다른 API함수에 대해서도 같은 Searched.dart 파일을 사용하기 위해, 요청하는 Flutter의 요청 함수에서 사용하는 모든 파라미터 를 Searched.java파일에 넣어놓으면 Searched.java 파일하나로 Flutter의 API 요청을 모두 받아서 처리할 수 있습니다.

😄 감사합니다.


2022년 10월 20일 목요일

[Flutter] Android Studio에서 에뮬레이터 사용 시 알면 도움이 되는 정보

😃 안녕하세요. 10.0.2.2 ip를 이야기 해 봅니다.

Android Studio 를 사용하면서, 에뮬레이터를 통해 빌드한 화면테스트를 합니다.

대부분의 앱은 서버와의 통신으로 데이터를 화면에 표시하는 모습입니다.

서버개발자가와 협업을 하면, 서버 개발자가 API를 개발하고 개발한 API를 앱 개발자가 사용합니다.

그러나, 서버개발과 앱개발을 혼자서 하는 경우도 많습니다. 

서버에서 동작하는 API를 개발 할때, 앱개발 요청 시 API 동작의 정상여부 및 필요사항을 모두 확인해서 수정 및 완료하고, 앱개발을 들어 갈 수 있다면, 정말 좋은 개발 프로세스 일 것입니다.

하지만, 모두 테스트하고 제대로 동작하는 API를 개발했더라도, 앱개발 시, API 요청 시에, 앱에서의 요청시 좀더 부드럽고 편리한 뷰가 보이게 될 수 있습니다.

그래서 앱과 서버의 서비스 동시에 디버깅하며 서버 서비스 개발도 보완하고, 앱도 더 잘 만들고 싶을 것입니다.

그러면 서버의 서비스하는 API를 localhost에서 디버깅모드로 피시내에서 실행 할 수 있다면, 편리하게 앱도 피시에서 실행하며 서버의 API 개발 디버깅과 앱 디버깅을 동시에 할 수 있을 것 입니다. 

그 때 로컬 피시에서의 디버깅 하는 앱에서 동일한 로컬 피시에서의 디버깅 하며 실행 시킨 서버의 API 호출 요청 시, 앱에서는 http://localhost:8080 또는 http://127.0.0.1:8080 과 같은 URL을 이용하고 싶을 것 입니다.

하지만, 앱에서 http://localhost:8080 또는 http://127.0.0.1:8080 이렇게 요청을 하면(하위 경로는 편의상 생략하여 설명중) 서버의 API로부터 호출 거절 수신을 앱에서 받게 될 것 입니다.

앱에서는 localhost 또는 127.0.0.1  대신, 10.0.2.2를 사용 해야 localhost또는 127.0.0.1 로 호출 하는 것 처럼 호출이 가능합니다.

따라서, 앱에서는 http://10.0.2.2:8080 이런 식 으로 로컬 피시내의 API를 호출 해야 합니다.

앱 개발에 사용해 보세요. 이상입니다.😉


2022년 6월 13일 월요일

[git] git 정리

 ~ 

git 설치후, CMD 에서 git 사용가능



~ 버전확인

git --version :  깃버전확인



~ 환경설정

git config --global user.name [깃허브이메일아이디]

git config --global user.email [깃허브이메일주소]



~ 폴더생성



~ github 프로젝트 저장소 복사

git clone https://github.com/[깃아이디]/[프로젝트명.git]



~ 사용명령

git status : 현재 스테이징에어리어의 상태 보기

git add . : 현재 위치한 곳의 모든 파일 추가

git checkout -- [파일명] :  수정한파일이원래상태로 되돌릴수있다.

git commit -m 'msg' : commit 및 commit 메시지 입력

git commit --amend : commit 메시지 수정가능

git reset --hard [commit hash값] : 특정 commit 위치로 변경(특정 위치 이후 commit은 모두 삭제), 로컬만해당

=> 원격지도 동기화하려면 : git push -f (-f옵션은 강제)

=> git --soft 도있음..

git log : 커밋이력을 확인



~ 브랜치

git branch : 현재 브랜치 개수확인

~~ 브랜치 만들고 브랜치이동

git branch develop : develop 브랜치 만들기

git checkout develop : develop 브랜치로 접속 

~~ 만든브랜치에서 작업한 것을 master에 합치는방법

git checkout master : master 로 이동

git merge develop : develop 에있는 것을 master에 합치기

git push : 원격지에 반영

git log : master와  develop에 둘다 반영된것을 확인

git branch -d develop : develop 브랜치 제거

~~ 충돌처리 (동일한파일 수정시)

일반적으로병합은 마스트 브랜치에서 수행

git checkout master : 마스터로 이동

git merge develop : master에 develop브랜치를 합치기

=> merge conflict 발생

=> 소스파일에 develop 브랜치에서 수정한것과 master 브랜치에서 수정한 코드가

모두들어가있음. 선택해서 삭제후 merge하면됨



~ git에서 원격지 저장소 관리

git remote : 원격저장소로 어떤것이 등록되있는지 확인

git remote show origin : 원격저장소 상세정보확인

git remote add test [git주소] : 원격저장소 추가

git remote -v : 전체목록확인

git remote rename [현재 git저장소 이름] [변경할 git저장소 이름] : 저장소이름변경

~~ 원격저장소에 대해 명령 사용가능

git log origin/master : origin 의 로그보기

git merge origin/master : origin의 merge 수행

git remote rm [저장소명] : 특정 저장소명을 삭제 



~ git에서 로그보기

git log : 최신순서대로 커밋내역을 볼수있음, 엔터로 내려가면서보고, 큐로 나가기

git log --stat : 커밋라인마다 얼마나추가됬는지 확인가능

git log -p -3 : 위에서 3개까지 체적인항목

git log --pretty=online : 각각의 커밋라인이 한줄마다 출력

git log --pretty=format:"%h -> %an, %ar : %s" --graph : 그래프형태로



~ git 프로젝트 소개글 : README.md

Create README.md

markdown 문법


# 큰글머리 ( #~##### : 점점 작아지는 글머리)


``` c 

```

: c언어로 표현


[블로그주소](http://naver.com) : 링크


* 가

  * 가

    * 가

: 순서없는 목록


> '공부하자' - ㅅㄷㄴㅅ - 

: 인용문


이름|ㅇㅇ|ㄹㄹ|ㄹㅇ|

---|---|---|---|

ㅁㄴㅇㄹ|1|2|2

: 테이블


**구문**

:강조


~~취소선~~

:취소선



~ git 내에 소스파일을 압축해서 내보내기

git archive --format=zip master -o Master.zip

: 압축포맷 zip, branch명 master, -o 는 output, Master.zip 은 압축파일명

Master.zip은  ../Master.zip  상대경로명으로 표기가능



~ 특정commit을 수정 : commit 제거하거나 commit message를 수정

git rebase -i HEAD~3 : 최근 커밋 3개 를 수정

git rebase -i [hash값] : 특정 커밋 해시값으로도 수정가능



~ git 환경설정

git config --list : git 의 환경설정상태

~~최초 설정시 글로벌하게 설정

git config -global user.name ""

git config -global user.email ""



~ git 커밋 날짜 변경방법

~~첫번째방법

git rebase -i 변경하려는 특정커밋의 이전 값을 선택

=> 목록에서 pick 글자를 수정 : edit

=> GIT_COMMITER_DATE="Oct 1 10:00:00 2018 +0000" git commit --amend --no-edit --date "Oct 1 10:00:00 2018 +0000"

git log 확인

git rebase --continue : 변경된 날짜 반영

~~두번째방법

git filter-branch -f --env-filter \

'if [ $GIT_COMMIT = 20435adbsadf32423421sadfafs ]

then

  export GIT_AUTHOR_DATE="Mon Oct 1 10:00:00 2018 +0000"

  exprot GIT_COMMITER_DATE="Mon Oct 1 10:00:00 2018 +0000"

fi'





* 해당 글은 유트뷰 [동빈나]링크 채널을 참고 하였습니다.








2022년 4월 7일 목요일

부자아빠가난한아빠_돈을위해일하지말고돈이나를위해일하게하라

 부자아빠가난한아빠를 읽으며


돈을위해 일하지말고, 돈이 나를위해 일하게 해야한다.


돈을 위해 일하는 것은, 두려움과 욕망 때문이다.

두려움과 욕망을 다스릴수 있어야한다.

직장은 돈이 나를 위해 일하게 하기 위한 단기 전력이어야 한다.

직장에서 받는 돈으로 두려움과 욕망이 없어지게 하려고 해도, 돈이 떨이질때쯤 다시 두려움으로 인해 직장에 나간다. 대부분의 사람들이 이렇게 자신의 영혼을 갉아먹힌다.


돈이 나를 위해 일하게 한다는것은,

현금흐름이 생기는 자산을 구입하거나 구축하는 것이다.

현금흐름을 구축하는 방법을 생각해봤다.


1. 임대수익

부동산을 통해 임대수익을 만드는 것이다.

부동산을 구입하거나 임대할 자본이 필요하다.

2. 돈버는 게임

요즘 블록체인으로인해 코인을 채굴하는 돈버는 게임들이 나오는데, 적은돈으로 적은시간게임으로 수익을 만들 수 있다.

그러나 대부분의 경우 참여자의 기대만큼 수익이 크지않은 경우가 많다.

3. 온라인쇼핑몰창업

쇼핑몰은 가진기술없이도 자본없이도 창업이 가능하다. 

소비자와판매자가 많은 시장이 레드오션이긴하지만, 없어지지 않을 유통시장이라면, 

작은파이라도 노리며 현금흐름을 만들 수 있지않을까?

4. NFT작품판매

디지털컨텐츠로써, 그림(직접그린그림을 사진으로찍어 디지털화), 일러스트이미지, 음악, 영상과 같은 것들을 NFT로 발행(민팅)해서 마켓에 판매 하는 것이다.

인지도없는 일반인이 라면 처음부터 팔리진 않는다.

블로그또는 유튜브 처럼 자신만의 컬렉션을 만들어서 꾸준한 작품을 게시하고, 진정성있는 작가로써 활동(계속 작품만들어올리기)을 한다면, 좋은 자산이 될 것이다.

5. 블로그글쓰기

주제를 정해서 꾸준히 글쓰기를 한다.

글도 좋은 자산이라고 생각한다. 남겨진 글은 없어지지 않는다.(지워지거나 지우지않으면)

내가 적은 글이 누군가에게 도움이 된다면, 당장 돈이 되지 않아도 의미있다고 생각한다.

많이 쓰고 많이 남기면, 나중에 쌓인 글로 책을 내면 더 좋은 자산이 될 수 도 있다.

6. 유튜브하기

영상도 영원히 남는 자산이 될 수 있다.

7. 앱개발

자기가 필요한 앱을 만들어 안드로이드 또는 애플 마켓에 올린다.

자기가 필요한 앱을 만들었지만, 내가 필요한 앱이면 다른누군가도 필요할 것이기 때문에 좋은 자산이 될 수 있다.

인앱결제수익 또는 광고수익으로 돈을 벌 수 있다. 

좋은앱이라면 창업의 기회가 될 수 도 있을 것이다.

8. 주식투자

주식은 장기로 보유하라는 말도많지만, 단기매매를 하는 사람이 있기 때문에 거래가 되는 것이기도 하다. 투기로 보기보다는 투자의 하나로 자산으로 만들어 볼 수 도 있겠다.

적은 돈이지만, 경험을 통해 주식의 감을 익히고, 공부하는 것은 경제를 배우는데도 돈을 배우는 데도 도움이 될 것이다. 더불어 잘 알면 큰 자산의 하나로 만들 수 있다.

9. 코인투자

비트코인에 투자하자. 비트코인은 신뢰없는 신뢰시스템이다. 인류가 만든 유일한 화폐이고, 정복자이다. 미래에는 비트코인을 진정한 돈이라 부를 것이다. 그것을 믿고 기대한다면 훌륭한 자산이다.(알트는 주의)

10. 메타버스 컨텐츠제작

제페토라는 메타버스 에서, 옷을만들어 팔고, 공간을 디자인 해주고 돈을 벌 수 있다.

자신만의 공간을 꾸며서 사람들을 모으고 마케팅에 활용 할 수 있다.

해당 메타버스 플랫폼에 한정되있지만, 오래 가는 메타버스플랫폼이라면 좋은 자산이 될 것 이다.





2022년 4월 6일 수요일

돈을 버는 방법

돈을 버는 방법


1. 취업하기

취업해서 5년간 업무에 집중한다.

35살 이하라면 개발자 직군에 도전해서 5년간 업무를 통해 기술을 연마한다.

2-3년 마다 이직하여, 두세개 다른산업또는 다른플랫폼에서 개발 기술을 연마한다.

이 후, 새 직장에서 5년간 기술을 쌓는다.


대체불가능한 개발자가 되어, 연봉을 올려간다.


2. 투잡하기

5년이상 자신의 업무에서 쌓은 기술 및 전문분야가 있다면, 그 것을 남에게 알린다.

나를 필요로 하는 사람, 또는 기업을 찾는다.

알리는 방법은, 알바매칭사이트를 접근해도 좋다. 국내 유명 사이트로 크몽, 숨고가 있다.

그곳에 내가 생각하는 나의 기술의 대가를 건다.

그리고 주문이 들어오는 작업을 정당한 대가보다 더 많은 서비스를 고객에게 제공한다.

또는 내가 받는 대가를 생각하지 않고 최고의 서비스를 제공한다.

재 주문또는 구매요청이 올거고, 그곳이 아니더라도, 나만의 기술과 강점을 다른사람에게 팔아본 경험으로 더 자신감있고 수월하게 다른 고객을 다른 곳에서 만나게 될것이다.


3. 투자하기

내가 내 시간과 노동력을 사용하는 건 자산이 없는 가운데서 바로 돈을벌기에 좋은방법이지만, 내가 시간과 노동력을 멈추면, 돈을벌수 없다. 

나 대신 내 자산이 돈을 벌게 해야한다. 투자는, 내 돈이 돈을 벌게하는 방법이다.

미국 나스닥 우량주 이왕이면 1등 주식을 사놓는다. 1등 주식이아니면, 우량주이면서 배당주를 산다. 배당은 돈이 돈을 버는데 일정하게 눈에 보이고, 계산이 되어 돈을 버는데 예상이 되어 취업해서 돈을 버는 것과 비슷하게 심리적 안정감을 가질 수 도 있다.


비트코인을 모은다. 금과 은보다 2100만개로 고정된 비트코인은 더 정직하고 더 투명하며, 더 돈이다. 아직 비트코인으로 생활에 필요한 물건들을 구입할 수 없다.(일부국가 또는 일부사이트에서는 가능하지만, 더 많은나라에서 더 다양한 라이트네트워크를 활용한 결제 서비스가 생겨나야 한다. 기술적으로 미흡해서, 사람들이 사용을 못하고있지만, 서비스가 발전해서 사용하는데 쉬워지면 많은 사용자가 사용하게될것이다.) 하지만, 이미 시작된 비트코인의 화폐현상은 다시 없었던 이전 시절로 돌이킬 수 없다. 블록체인 산업도 돌이킬 수 없는 신 산업이면서, 비트코인이 신뢰할수 있는 사람이 없는 신뢰를 만드는데 적임자이기에, 자산으로써 자리를 매김하고 오히려 더 커지고 더 흡수하여, 인간이 창조해낸 가장 큰 신뢰의 하나가 될 것이기 때문에, 그것에 가치를 둔다면, 결코 돈을 버는 중요한 방법으로 알 수 있다.

(하지만 비트코인외에 알트코인들은 모으는 이유가 달라질것이다.)


4. 사업하기

작은 장사만 해봤다. 길거리에서 빵을 구워 팔거나, 음료수를 팔았다.

작은 장사의 과정을 거처 큰 장사를 할 수 있다. 내가 투입하는 자본과 노동력과 지적능력과 정신력과 마음으로 사업을 키워서 돈을 버는 방법이다.

작은 장사만 얼마간 해본 경험이라서, 더 해서 더 큰장사를 만드는 방법과 큰장사 경험이 없다.

하지만, 스타트업을 주변지인들을 통해 보거나 경험해보았다.(프로젝트 일부에 참여함으로)

원대한 꿈과 이상을 추구하며, 과정 속 문제를 하나하나 해결하고, 위에서 먼저 언급한 자본과 열정과 마음과 지식과 시간을 쏟아야 한다. 그런데 이런것을 나혼자서가 아니라 나의 원대한 꿈과 이상을 동의하여, 설득당한 또는 참여하는 다른 사람과 함께 해야 한다. 

돈벌기 방법중 제일 어려운것 같다.


5. 임대하기

사회 초년생은 어렵다 모은돈이 없기 때문에, 어느정도 돈을 모았거나 있다면, 집을 구매하거나, 전세를 얻거나 월세를 얻어서 재 임대를 두는 것이다.

내 임대료의 이자보다 높게 임대료를 받아서 이자내고 남은 임대료 수익을 버는 것이다.

집 유지보수 비가 발생할 수 있어서, 노후가 덜된 집 또는 노후가 많이 된 집이면 어떻게 유지보수 비용을 줄이거나 수지가 타당할지 계산을 먼저 해봐야한다.


6. p2e 게임으로 코인을 벌기

요즘 블록체인 산업가운데, NFT 와 NFT 로 거래할수있는 캐릭터를 사서 게임을 하고 게임에서 코인수익을 만드는 p2e 게임이 게임업계에 새 장르 또는 새 수입모델로 부상하고있다.

p2e 게임의 수입모델은 모든 게임에 들어가게 될것이다.

하지만 미래를 위해서 p2e 게임을 시작해보는게 아니라 현재 p2e 게임에서도 코인을 모을수있는 그래서 돈을 벌수 있는 게임들이 있어서 할 수 있다.

내가 추천하는 p2e게임은 '히어로캣' 이다. 현재 6개월 이상 프로젝트가 진행되온 게임으로 이미 진입장벽이 높아진 '엑시인피니티' 또는'갈라' 게임들 보다 저렴한 비용으로 쉽게 해 볼 수 있다고 생각한다. 


7. 책을 쓰고 책을 판매하기

부자아빠에서 자산을 만들어 자산으로 돈을 벌어야 한다고 한다. 바보가 아니라면 그렇게 할 것이라고 한다. 책은 누구나 자기가 아는 분야를 컨텐츠화 할 수 있다.

인기가 있어서 책이 많이 팔린다면 정말 좋은 자산이 될것이고, 그것으로 더 많이 돈을 벌수 있을 것이다.

나는 이 방법을 직접 해보진 않았지만, 가장 마음에 끌리고, 그래서 지금 이렇게 글을 쓰고 있다.