2025年2月19日 星期三

Docker Command

#1 pull images
$docker pull chusiang/takaojs1607

#2 list images
$docker images

#3.1 run docker
$docker run -it ### bash

#3.2 run docker as a daemon
$docker run -it -d ### bash tail -f /dev/null

#3.3 run docker and mount local point (Local前:Container後)
$docker run -it -v ~/Downloads:/data ### bash


#4.1 list running containers
$docker ps

#4.2 list all containers
$docker ps -a

#5 Stop containers
$docker stop ###

#6 Start containers
$docker start ###

#7 Enter containers (exec)
$docker exec -it ### bash

#exit
離開container

#8 提交image (commit)
$docker commit ### Repostitory###

$docker commit -m "submit message" -a "Author Name" ### Repostitory###

#9 Modify Tag (版本控制)
$docker tag ### newname###:1.0

#10 移除image and tag (rmi vs. rm
$docker rmi ###
$docker rmi takaojs1607:1.2

強制移除正在運行的image
$docker run hello-world
$docker rmi -f hello-world

#11 上傳Docker Image
$ docker push <Username>foo
$ docker push <Server name>/foo



2022年5月27日 星期五

check_systemv1.1

 check_systemv1.1.bat 可用於電腦資產盤點

@echo off

REM 後續命令使用的是:UTF-8編碼

chcp 65001

echo ***Thanks for your cooperation***

echo ***感謝你的合作***

timeout 1

echo ****Windows 10 system will be complete soon.****

echo ****Windows 10電腦很快就完成,約30 secs內.****

timeout 2

echo *****Windows 7 system will take 2-3 mins.*****

echo *****Windows 7 電腦稍等2-3分鐘,你可以放著此視窗跑,先做其他工作.*****

timeout 3

echo %time%

ver > %computername%_sys.txt

echo %time%

hostname >> %computername%_sys.txt

echo %time%

ipconfig /all >> %computername%_ifconfig.txt

echo %time%

wmic product get name,version > %computername%_sw.txt

echo %time%

echo ****Wait for a while****

systeminfo > %computername%_systeminfo.txt

echo %time%

echo ******Completed. Thank you very much. *******

echo ******完成了~~~!再次感謝你. *******

echo ******別忘了把文字檔拷貝-貼到到公用區 *******

timeout 10

2021年12月6日 星期一

將資料夾底下的全部檔案列表出來,並儲存成檔案

Command

dir /b /s *.* > file_list.xls

dir /b /s *.* > file_list.txt

Save as bat file -> Double click to execute. 方便


2021年5月23日 星期日

List Domain Group Member

 net group "UserVPN" /DOMAIN


PS C:\Users\max.mu> net group "UserVPN" /DOMAIN

群組名稱     UserVPN

註解


成員


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

Alex               John                Mary

Joe    ......


Arube 6200F switch commands

 show vlan              

configure terminal       進入全局配置模式

interface x/x/x-x/x/x    選擇設定要調整的PORT號

vlan access (VLAN號)     指定VLAN

end                      結束

write memory             將設定寫入


configure terminal

interface x/x/x-x/x/x

show running-config current-context 查看各PORT設定



新SWITCH設定

config t

vsf member 1

link 1 1/1/25

link 2 1/1/26

exit

vsf renumber-to ?  ?=堆疊第幾台


show vsf topology


==============================

show vlan              

configure terminal

interface 3/1/1

vlan access 112 or 103

end

write memory


==============================

configure terminal

interface 3/1/1

no power-over-ethernet

or

power-over-ethernet



vlan access 134


interface 2/1/3-2/1/21


show ip route

Aruba6200F-3F-03# show ip route


Displaying ipv4 routes selected for forwarding


'[x/y]' denotes [distance/metric]


0.0.0.0/0, vrf default

        via  172.16.101.254,  [1/0],  static

172.16.101.0/24, vrf default

        via  vlan101,  [0/0],  connected

172.16.101.71/32, vrf default

        via  vlan101,  [0/0],  local


Record:

Aruba6200F-6F-01# configure terminal

Aruba6200F-6F-01(config)# interface 4/1/2-4/1/24

Aruba6200F-6F-01(config-if-<4/1/2-4/1/24>)# vlan access 116

Aruba6200F-6F-01(config-if-<4/1/2-4/1/24>)# end

Aruba6200F-6F-01# interface 5/1/1-5/1/23

Invalid input: interface

Aruba6200F-6F-01# vlan access 136

Invalid input: vlan

Aruba6200F-6F-01# configure terminal

Aruba6200F-6F-01(config)# interface 5/1/1-5/1/23

Aruba6200F-6F-01(config-if-<5/1/1-5/1/23>)# vlan access 136

Aruba6200F-6F-01(config-if-<5/1/1-5/1/23>)# exit

Aruba6200F-6F-01(config)# interface 5/1/24

Aruba6200F-6F-01(config-if)# vlan access 105

Aruba6200F-6F-01(config-if)# exit

Aruba6200F-6F-01(config)# interface 4/1/1

Aruba6200F-6F-01(config-if)# vlan access 105

Aruba6200F-6F-01(config-if)# end

Aruba6200F-6F-01# write memory

Copying configuration: [Success]


Aruba 7205Mobility Controllers Command

 


local-userdb del username a0a3f048****

(******-BH-Aruba7205-1) *#local-userdb del username a0a3f048****

(******-BH-Aruba7205-1) *#local-userdb add username a0a3f048**** password a0a3f048**** role ******-***-role

User a0a3f048**** successfully added to local-userd


(******-BH-Aruba7205-1) *#show local-userdb | include 0c7a1


(******-BH-Aruba7205-1) *#show log  all | include 50:2f:9b:16:**:**

2021年4月29日 星期四

2019年11月14日 星期四

tcpdump

max@ubuntu:~$ sudo tcpdump -i ens32 icmp -w packet

-i指定要抓封包的介面
icmp只抓icmp的封包
-w 寫入檔案

Ctrl + C

max@ubuntu:~$ sudo tcpdump -nnXr packet|less

13:57:17.027643 IP 192.168.39.33 > 192.168.88.45: ICMP echo request, id 1, seq 320, length 40
        0x0000:  4500 003c 4a56 0000 7f01 f0cb c0a8 2721  E..<JV........'!
        0x0010:  c0a8 582d 0800 4c1b 0001 0140 6162 6364  ..X-..L....@abcd
        0x0020:  6566 6768 696a 6b6c 6d6e 6f70 7172 7374  efghijklmnopqrst
        0x0030:  7576 7761 6263 6465 6667 6869            uvwabcdefghi
13:57:17.027694 IP 192.168.88.45 > 192.168.39.33: ICMP echo reply, id 1, seq 320, length 40
        0x0000:  4500 003c ed9d 0000 4001 8c84 c0a8 582d  E..<....@.....X-
        0x0010:  c0a8 2721 0000 541b 0001 0140 6162 6364  ..'!..T....@abcd
        0x0020:  6566 6768 696a 6b6c 6d6e 6f70 7172 7374  efghijklmnopqrst
        0x0030:  7576 7761 6263 6465 6667 6869            uvwabcdefghi
13:57:18.029860 IP 192.168.39.33 > 192.168.88.45: ICMP echo request, id 1, seq 321, length 40
        0x0000:  4500 003c 4a57 0000 7f01 f0ca c0a8 2721  E..<JW........'!
        0x0010:  c0a8 582d 0800 4c1a 0001 0141 6162 6364  ..X-..L....Aabcd
        0x0020:  6566 6768 696a 6b6c 6d6e 6f70 7172 7374  efghijklmnopqrst
        0x0030:  7576 7761 6263 6465 6667 6869            uvwabcdefghi
13:57:18.029888 IP 192.168.88.45 > 192.168.39.33: ICMP echo reply, id 1, seq 321, length 40
        0x0000:  4500 003c ee91 0000 4001 8b90 c0a8 582d  E..<....@.....X-
        0x0010:  c0a8 2721 0000 541a 0001 0141 6162 6364  ..'!..T....Aabcd
        0x0020:  6566 6768 696a 6b6c 6d6e 6f70 7172 7374  efghijklmnopqrst
        0x0030:  7576 7761 6263 6465 6667 6869            uvwabcdefghi

Linux command egrep

max@ubuntu:~$ ifconfig |egrep "HWadd|inet"
ens32     Link encap:Ethernet  HWaddr 00:0c:29:b8:26:8e
          inet addr:192.168.88.45  Bcast:192.168.88.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feb8:268e/64 Scope:Link
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host

max@ubuntu:~$ route |egrep "Dest|168.88"
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.88.1    0.0.0.0         UG    0      0        0 ens32
192.168.88.0    *               255.255.255.0   U     0      0        0 ens32

2019年10月27日 星期日

Ubuntu 16.04/18.04 installation


Ubuntu 在安裝完成時會設DHCP 並自動取得 IP,可透過文字介面來手動設定固定IP。

1.修改 Ethernet 網路設定

root@management:~# vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
auto ens160
iface ens160 inet static # 固定 (靜態) IP
address 10.159.xx.xx # IP 位址
netmask 255.255.255.0 # 網路遮罩
gateway 10.159.xx.xx # 預設閘道
dns-nameservers 168.95.1.1 #DNS第一組
dns-nameservers 8.8.8.8 #DNS第二組


2. 修改完可使用以下指令重新啟動網路讀取網路設定
root@management:~# /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service


Add User Ubuntu create user account commands
Let us say you need to add a new user in Ubuntu called vivek, type the following command in your shell:

$ sudo adduser John

Verify
$ cat /etc/passwd

Ubuntu 快速將使用者設成 Sudoer
max@ubuntu:~$ sudo adduser s01224566 sudo
Adding user `s01224566' to group `sudo' ...
Adding user s01224566 to group sudo
Done.

max@ubuntu:~$ sudo cat /etc/group | grep sudo
sudo:x:27:max,sena,gary,s01224566


Ubuntu 18.04 Configuring the network interface
Edit /etc/netplan/00-installer-config.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
     dhcp4: yes/no
     addresses:  [192.168.1.222/24]
     gateway4: 192.168.1.1
     nameservers:
       addresses: [8.8.8.8,8.8.4.4]


$sudo netplan apply

2019年10月13日 星期日

Windows Server 2016/2019 Evaluation: How to extend the Trial Period


Windows Server 2016/2019 Evaluation: How to extend the Trial Period

start PowerShell and run slmgr.
slmgr -dlv

When the period comes to an end, run slmgr -rearm to extend it by another 180 days.
slmgr -rearm

Next restart your computer.
Restart-Computer

Once restarted, open PowerShell and check your settings.

slmgr -dli



Unbenannt.PNG

Docker Command

#1 pull images $docker pull chusiang/takaojs1607 #2 list images $docker images #3.1 run docker $docker run -it ### bash #3.2 run do...