dns server

apt install dnsmasq

vi /etc/dnsmasq.conf

1
2
3
4
server=8.8.8.8
server=114.114.114.114
 
address=/keycloak.euhat.com/192.168.188.134

sudo systemctl restart dnsmasq

把Docker当沙盒用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo docker run -itd \
  --name srv1 \
  -v /mnt/hgfs/share:/home/work/share \
  -p 9083:9083 \
  fedora:latest \
  /bin/bash
 
sudo docker exec -it srv1 /bin/bash
 
sudo docker stop srv1
#sudo docker start srv1
sudo docker rm srv1
sudo docker rmi fedora:latest
sudo docker system df -v

Docker Memo

不写dockerfile,快速运行镜像:
docker run -it --name redhat85 redhat/ubi8:8.5

Docker容器中ADD的文件是旧的:
docker-compose stop some-docker-id
docker-compose rm -v some-docker-id
docker-compose build --no-cache some-docker-id

Vue3 自定义组件传参

父组件

1
2
3
4
5
6
7
8
9
<template>
  <HelloWor v-model:aaa="foo" />
  {{foo}}
</template>
<script setup>
import HelloWor from './Hello.vue'
import{ref}from 'vue'
const foo=ref()
</script>

子组件

1
2
3
4
5
6
7
8
9
10
11
<template>
  <input v-model="yyy" />
</template>
<script setup>
import{useAttrs,computed}from 'vue'
const attrs = useAttrs()
const emit = defineEmits(['update:aaa'])//v-model父传子必须要用emit声明,否则父的v-model修饰符会不起作用。
const yyy=computed({
get() {return attrs.aaa},
set(newV) {emit('update:aaa',newV)}})
</script>

refer to:
https://segmentfault.com/a/1190000044885561

Visit Guest Service From Host With VirtualBox

VBoxManage modifyvm "xubuntu" --natpf1 "guest-redis,tcp,,6379,,6379"
VBoxManage modifyvm "xubuntu" --natpf1 "guest-mysql,tcp,,3306,,3306"

Another method is to create two adapters, NAT + Host Only.

ps. Delete the forwarding rules like:
VBoxManage modifyvm "xubuntu" --natpf1 delete "guest-redis"

refer to:
https://blog.csdn.net/chinainvent/article/details/6234368
https://superuser.com/questions/1282666/host-cant-connect-to-guest-with-nat-networking-at-virtualbox-but-others
https://forums.virtualbox.org/viewtopic.php?t=32014

Arthas Memo

dashboard
thread -b	# check dead lock
thread
thread 123
jad TestClass
redefine /root/TestClass.class
jmap -histo 1234 | head -20

refer to:
https://visualvm.github.io/index.html