docker 之服务部署-elasticsearch
系统环境
OS:kali linux 2023.03
Kernel:6.4.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1kali1 (2023-08-21) x86_64 GNU/Linux
Docker:Docker version 20.10.25+dfsg1, build b82b9f3
服务部署部署前的准备1.查找 elasticsearch 的镜像:
12345678910111213141516171819202122232425262728┌──(leazhi㉿kali-desktop)-[~]└─$ sudo docker search elasticsearchNAME DESCRIPTION STARS OFFICIAL AUTOMATEDelasticsearch Elasticsear ...
docker 之服务部署-redis
系统环境
OS:kali linux 2023.03
Kernel:6.4.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1kali1 (2023-08-21) x86_64 GNU/Linux
Docker:Docker version 20.10.25+dfsg1, build b82b9f3
服务部署官方镜像虽然提供了挂载目录,但是不能指定配置文件挂载,且数据不能持久化,一旦服务器重启,数据都会丢失。生产慎用!!!
部署前的准备1.查找 Redis 的镜像:
12345678910111213141516171819202122232425262728──(leazhi㉿kali-desktop)-[~]└─$ sudo docker search redis NAME DESCRIPTION STARS OFFICIAL AUTOM ...
docker 之服务部署-postgresql
系统环境
OS:kali linux 2023.03
Kernel:6.4.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1kali1 (2023-08-21) x86_64 GNU/Linux
Docker:Docker version 20.10.25+dfsg1, build b82b9f3
服务部署部署前的准备1.查找 Postgres 的镜像:
12345678910111213141516171819202122232425262728┌──(leazhi㉿kali-desktop)-[~]└─$ sudo docker search postgresql NAME DESCRIPTION STARS OFFICIAL AUTOMATEDpostgres The PostgreSQL obje ...
docker 之服务部署-mariadb
系统环境
OS:kali linux 2023.03
Kernel:6.4.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1kali1 (2023-08-21) x86_64 GNU/Linux
Docker:Docker version 20.10.25+dfsg1, build b82b9f3
服务部署部署前的准备1.查找 Mariadb 的镜像:
12345678910111213141516171819202122232425262728┌──(leazhi㉿kali-desktop)-[~]└─$ sudo docker search mariadbNAME DESCRIPTION STARS OFFICIAL AUTOMATEDmariadb MariaDB Server is a high performing open so ...
docker 之服务部署-gitlab-ee
系统环境
OS:kali linux 2023.03
Kernel:6.4.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1kali1 (2023-08-21) x86_64 GNU/Linux
Docker:Docker version 20.10.25+dfsg1, build b82b9f3
服务部署部署前的准备1.获取 gitlab-ee 镜像:
1.1.搜索 gitlab-ee 镜像,看看需要使用哪个镜像:
1234567891011121314151617181920212223242526272829┌──(leazhi㉿kali-desktop)-[~]└─$ sudo docker search gitlab-ee [sudo] leazhi 的密码:NAME DESCRIPTION STARS OFFICIAL AUTOMATEDgitlab/gitlab ...
django-small 系列018-商品分页及排序
改写 rest_framework 自带的分页器1.在包目录 utils 下新建 pagination.py 文件,改写分页器:
12345678# utils/pagination.pyfrom rest_framework.pagination import PageNumberPaginationclass StandarPageNumberPagination(PageNumberPagination): page_size = 10 max_page_size = 20 page_size_query_param = 'page_size'
2.编辑项目配置文件 dev.py ,在 REST_FREAMWORK = { .. } 列表中添加分页器:
12345678910111213141516171819# settings./dev.py...REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( ' ...
django-small 系列017-商品列表页
创建生成商品列表的计划任务创建计划任务1.在计划任务包目录 celery_tasks 目录下新建一个名为 html 的包目录;
2.在新建的 html 包目录下新建一个 tasks.py 文件,内容为:
1234567891011121314151617181920212223242526272829303132import os# from haoke.apps.goods.utils import get_categoriesfrom goods.utils import get_categoriesfrom celery_tasks.main import appfrom django.conf import settingsfrom django.template import [email protected](name="generate_static_list_search_html")def generate_static_list_search_html(): """ 生成静态的商品列表页 "& ...
kali 2023.03 安装后必做的十件事
换源1.先备份下默认源文件:
1sudo cp /etc/apt/sources.list{,.bak}
2.编辑源文件,将默认的 URL 修改成国内的阿里云源或者清华源:
123456789101112131415# 阿里云源:┌──(leazhi㉿leazhi-kali)-[~/Downloads]└─$ sudo cat /etc/apt/sources.list# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/#deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmwaredeb https://mirrors.aliyun.com/kali kali-rolling main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/kali kali-rollin ...
vscode 解决终端字体间距偏大,显示不正常
系统环境
os: kali linux 2023.05
Kernal: 6.4.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1kali1 (2023-08-21) x86_64 GNU/Linux
vscode: 1.82.2
问题描述最近不知道作了什么配置,导致 vscode 终端字体显示不正常,如下图:
解决方案1.打开系统终端命令行,查找系统字体安装所在目录:
123┌──(leazhi㉿kali-desktop)-[~]└─$ whereis fontsfonts: /etc/fonts /usr/share/fonts
2.进入字体安装目录:
12┌──(leazhi㉿kali-desktop)-[~]└─$ cd /usr/share/fonts
3.克隆 Menlo for Powerline 字体到当前目录下:
12┌──(leazhi㉿kali-desktop)-[/usr/share/fonts]└─$ sudo git clone https://github.com/abertsch/Me ...
vscode 报错-Could not register service worker
系统环境
os: kali linux 2023.05
Kernal: 6.4.0-kali3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1kali1 (2023-08-21) x86_64 GNU/Linux
vscode: 1.82.2
问题描述在vscode 中打开 markdown 文档,发现右侧不能预览了,同时,右下角给出弹窗:
1Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
解决方案直接删除当前用户目录下 vscode 的缓存目录:
1rm -rf ~/.config/Code/Cache
然后重新打开即可!
参考:VS Code 加载 Web 视图时出错的解决方案