Hyper-V에 NAT Virtual Switch 생성하기


Windows 10/11의 Hyper-V에는 Default Switch라는 NAT를 해주는 가상 스위치가 있다
하지만 이것의 IP 대역을 관리자 마음대로 정할 수가 없다
그래서 관리자 마음대로 IP 대역을 지정하기 위해서는 수동으로 Virtual Switch를 생성하면 된다
그리고 Windows Server의 Hyper-V에서는 Default Switch라는 NAT용 가상스위치가 없기 때문에,
수동으로 Virtual Switch를 만드는 방법을 알고 있어야 한다

  1. 내부용으로 사용하는 가상 스위치(NATSwitch) 생성하기
    New-VMSwitch -SwitchName “NATSwitch” -SwitchType Internal
    이 스위치를 New-NetNat 명령으로 NAT 기능을 구현하여 인터넷으로 연결할 수 있다

Get-VMSwitch (##생성한 Virtual Switch 확인하기)
Get-NetAdapter (##Application에 의해 Virtual Switch가 생성되면 Virtual Adapter가 생성된다)

  1. 생성된 Virtual Adapter에 IP Address 지정하기
    New-NetIPAddress -IPAddress 10.10.10.1 -PrefixLength 24 -InterfaceAlias “vEthernet (NATSwitch)”
    이것이 NATSwitch를 사용하는 VM들의 Default Gateway 역할을 한다
  2. 10.10.10.0/24 대역의 Internal IP를 NAT 해주도록 설정하기
    New-NetNat -Name “NATNetwork” -InternalIPInterfaceAddressPrefix “10.10.10.0/24”
  3. 생성한 NAT의 IP 대역 설정 보기
    Get-NetNat -Name NATNetwork | fl
  4. Hyper-V Manager에서 각 VM들의 Network Adapter를 NATSwitch라는 가상 스위치를 사용하도록 변경한다
  5. NATSwitch 스위치를 사용하는 VM들의 NIC에 10.10.10.0/24의 IP를 수동으로 설정해주어야 한다
    10.10.10.10
    255.255.255.0
    10.10.10.1
    8.8.8.8

이렇게 수동으로 입력하면 VM간의 통신을 위해서 추가적인 Virtual Switch가 필요가 없다

이렇게 만든 NATSwitch는 virtual Box의 NATNetwork와 동일하다. 즉, 인터넷 접속도 되고, VM간의 통신도 된다

  1. Virtual Switch 생성으로 만들어진 Virtual Adapter 삭제하기
    Get-VMSwitch
    Get-NetAdapter

Get-VMSwitch -Name Natswitch | Remove-VMSwitch -Force (##가상 스위치 제거하기)
Get-HNSNetwork | Where-Object {$_.Name -Like “*NATSwitch”} | Remove-HNSNetwork (##삭제한 가상 스위치에서 생성된 Virtual Adapter 삭제하기)

Get-VMSwitch
Get-NetAdapter
성공!!

리눅스 find 명령어 40개 예제


참고 자료: https://bit.ly/3DTvDpA

Example 1: Check Find command version
find -version

Example 2: Find all the files Only created in last 40 mins
find /home/example -type f -cmin -40
-cmin n: File’s status was last changed n minutes ago.
-type f: regular file

Example 3: Find all the files Only modified in last 40 mins
find /home/example -type f -mmin -40
-mmin n: File’s data was last modified n minutes ago.

Example 4: Find all the files Only accessed in last 40 mins
find /home/example -type f -amin -40
-amin n: File was last accessed n minutes ago

Example 5: Find all the files and directories created in last 40 mins
find /home/example -cmin -40

Example 6: Find all the files and directories modified in last 40 mins
find /home/example -mmin -40

Example 7: Find all the files and directories accessed in last 40 mins
find /home/example -amin -40

Example 8: Find all the files only created in last 40 mins
find /home/example -type f -cmin -40

Example 9: Find all the files only modified in last 40 mins
find /home/example -type f -mmin -40

Example 10: Find all the files only accessed in last 40 mins
find /home/example -type f -amin -40

Example 11: Find all the created files and directories older than 40 mins
find /home/example -cmin +40

Example 12: Find all the modified files and directories older than 40 mins
find /home/example -mmin +40

Example 13: Find all the accessed files and directories older than 40 mins
find /home/example -amin +40

Example 14: Find all the created files only in last 5 days
find /home/example -type f -mtime -5
-mtime n: File’s data was last modified n*24 hours ago.

Example 15: Find all the modified files only older than 5 days
find /home/example -type f -mtime +5

Example 16: Find all the files and directories modified in last 5 days
find /home/example -mtime -5

Example 17: Find all the modified files and directories older than 5 days
find /home/example -mtime +5

Example 18: Find a file “test.txt” at the maxdepth of level 2
find /home/example/ -maxdepth 2 -name test.txt
-maxdepth levels: Descend at most levels (a non-negative integer) levels of directories below the starting-points

Example 19: Find a file “test.txt” at the mindepth of level 2
find /home/example/ -mindepth 2 -name test.txt
-mindepth levels: Do not apply any tests or actions at levels less than levels(a non-negative integer)

Example 20: Find a file test.txt between mindepth of 2 and maxdepth of 4
find /home/example -mindepth 2 -maxdepth 4 -name test.txt

Example 21: Find all the files created by User “example”
find /home -user example

Example 22: Find all Empty Files
find /home/example -empty
-empty: File is empty and is either a regular file or a directory

Example 23: Find all Executable Files and Directories
find /home/example -executable
-executable: Matches files which are executable and directories which are searchable (in a file name resolution sense) by the current user.

Example 24: Find all Executable Files Only
find /home/example -type f -executable

Example 25: Find all Empty Files Only
find /home/examples -type f -empty

Example 26: Find all the Case Insensitive match pattern
find /home/example -iname File1
-iname pattern: Like -name, but the match is case insensitive

Example 27: Find all the files on ext4 filesystem
find . -fstype ext4
-fstype type: File is on a filesystem of type ext4

Example 28: Find all the files with group name test
find /home/example -group test
-group gname: File belongs to group gname (numeric group ID allowed)

Example 29: Find all the files which does not belong to any known group
find . -nogroup
-nogroup: No group corresponds to file’s numeric group ID.

Example 30: Find all the files which does not belong to any known User
find . -nouser
-nouser: No user corresponds to file’s numeric user ID.

Example 31: Find all the files by their Group ID
find /home/example -group 500

Example 32: Find all the files by their User ID
find /home/example -user 500
-user uname: File is owned by user uname (numeric user ID allowed

Example 33: Find all the files which are either executable by User or by Group
find /home/example -perm /u=x,g=x
-perm -mode: Any of the permission bits mode are set for the file. Symbolic modes are accepted in this form. You must specify u',g’ or `o’ if you use a symbolic mode.

Example 34: Find all the files which are executable by both User and Group
find /home/example -perm -g+w,u+w
-perm -mode: All of the permission bits mode are set for the file. Symbolic modes are accepted in this form, and this is usually the way in which you would want to use them. You must specify u',g’ or `o’ if you use a symbolic mode

Example 35: Find all files and directories having execute permission
find /home/example -perm /111

Example 36: Find all the files created between last 5-10 days
find . -ctime -10 -ctime +5

Example 37: Find all the files accessed between last 5-10 days
find . -atime -10 -atime +5

Example 38: Find all the files modified between last 5-10 days
find . -mtime -10 -mtime +5

Example 39: Find all the files which is either readable by User or by Group
find /home/example -perm /u=r,g=r

Example 40: Find all the files which is readable by both User and Group
find /home/example -perm -g+r,u+r

G-mail 효과적으로 사용하기


매우 유용하네.

일단 설정에서 단축키 사용을 활성화를 해야 한다

<메시지 작성>

메시지 작성: c (또는 d )

작성 중 메시지를 임시 저장하기: ctrl + s

메시지 보내기: ctrl + enter

메시지 회신: r (또는 shift+r )

모든 사람에게 회신: a (또는 shift+a )

전달하기: f (또는 shift+f )

## 별도의 창을 띄우는 것이 shift를 누르고 d, r, a, f를 사용한다

<메시지 읽기>

이전 메시지: j

다음 베시지: k

즐겨찾기: s

모든 대화 펼치기: ;(세미콜론)

모든 대화 접기: : (콜론)

<메시지 검색하기>

before:2020/12/31 (2020/12/31이전 메일을 모두 검색)

after:2022/09/01 (2022/09/01 이후 메일 모두 검색)

7회동안 주고 받은 메시지가 있으면 이것들을 모두 열어보려면 semicolon, 윗 줄 내용만 보려면 colon

읽지 않은 메일만 검색: label:unread

읽은 모든 메시지: label:read

용량별로 검색하려면 larger, smaller 사용

larger: 50MB라고 하면 50MB 이상의 메시지만 검색

smaller:1MB라고 하면 1MB 이하의 메시지만 검색

첨부파일이 있는 메시지만 검색하기:

has:attachment

발신자/수신자별 검색

from:jesuswithme@hotmail.com

from:임서영

to:jesuswithme@gmail.com

to:이지선

2020/12/31이전 메시지 중 용량이 1MB 이상인 것만 검색:

before:2020/12/31 larger:1MB