• 2024-10-12安全:列出linux中可登录shell/ssh/sudo的用户
    一,列出可登录shell的用户root@lhdpc:~#grepbash/etc/passwdroot:x:0:0:root:/root:/bin/bashliuhongdi:x:1000:1000:liuhongdi,,,:/home/liuhongdi:/bin/bash只显示用户名:root@lhdpc:~#grepbash/etc/passwd|cut-d:-f1rootliuhongdi也可以把常见的3个不允许登录
  • 2024-08-19ubuntu(linux): 编译安装使用python3.12.5
    一,python官网:https://www.python.org/下载页面:https://www.python.org/downloads/source/如图:二,安装1,下载:wget从命令行下载:liuhongdi@lhdpc:/usr/local/source/python$wgethttps://www.python.org/ftp/python/3.12.5/Python-3.12.5.tgz2,解压:liuhongdi@lhdpc:/
  • 2024-07-24es:常用命令
    一,查看es的相关信息:1,查看集群的健康状态liuhongdi@lhdpc:/usr/local/soft$curl-XGEThttp://127.0.0.1:9200/_cat/health172181039608:39:56elasticsearchgreen11110000-100.0%2,查看状态:liuhongdi@lhdpc:/usr/local/soft$curl-XGET"http://127.0.0.1:92
  • 2024-02-19python实战:用SQLAlchemy作orm
    一,安装SQLAlchemy1,用pip安装(venv)[liuhongdi@imgnews]$pip3installsqlalchemy2,安装完成后查看已安装的版本:(venv)[liuhongdi@imgnews]$pip3showsqlalchemyName:SQLAlchemyVersion:2.0.27Summary:DatabaseAbstractionLibraryHome-page:https://www
  • 2023-11-08laravel:自动加载自定义类(10.27.0)
    一,配置1,在laravel项目的根目录下添加extend目录,如图:2,编辑composer.json,在autoload增加一行:"":"extend/",如图:生成自动加载文件:liuhongdi@lhdpc:/data/laravel/dignews$composerdump-autoload-oGeneratingoptimizedautoloadfiles...命令的解释:将PSR-
  • 2023-11-07laravel:软链接/符号链接(10.27.0)
    一,相关文档:https://learnku.com/docs/laravel/10.x/structure/14837#c2b9f4Storage目录storage目录包含日志、编译后的Blade模板、基于文件的会话、文件缓存和框架生成的其他文件。该目录分为app、framework和logs目录。app目录可用于存储应用程序生成的任何文
  • 2023-10-24laravel:打印sql(10.27.0)
    一,php代码:1234567891011121314151617181920212223publicfunctionhome(Request$request){    //默认连接    DB::enableQueryLog();     $modelNews=newNews();    $rowsNews=$modelNews->getPage(0,1); 
  • 2023-10-22laravel:使用tinker(10.27.0)
    一,启动与退出:liuhongdi@lhdpc:/data/laravel/dignews$phpartisantinkerPsyShellv0.11.22(PHP8.1.1—cli)byJustinHileman>exit   INFO  Goodbye.二,查询数据liuhongdi@lhdpc:/data/laravel/dignews$phpartisantinkerPsyShellv0.11.22(PHP8.1.
  • 2023-10-21laravel:开启/关闭调试模式(10.27.0)
    一,文档地址:https://learnku.com/docs/laravel/10.x/configuration/14836#701998二,设置1,.env中关于调试的默认值:APP_DEBUG=true2,关闭调试APP_DEBUG=false说明:刘宏缔的架构森林—专注it技术的博客,网站:https://blog.imgtouch.com原文: https://blog.imgtouch.com/ind
  • 2023-10-21laravel:访问redis(10.27.0)
    一,相关文档:https://learnku.com/docs/laravel/10.x/redis/14887二,php代码1,配置.env使用默认的设置:REDIS_HOST=127.0.0.1REDIS_PASSWORD=nullREDIS_PORT=63792,controller中引用:12345678910111213141516171819202122232425<?ph
  • 2023-10-21laravel:关闭默认首页(10.27.0)
    一,php代码修改routes/web.php原代码:Route::get('/',function(){    returnview('welcome');});修改后Route::get('/',function(){    $appName=env('APP_NAME');    return['code'=>0,'msg'=>&#
  • 2023-10-04webman:worker exit with status 139(Webman-framework v1.5.7/PHP 8.1.1)
    一,报错信息:worker[webman:225916]exitwithstatus139进程会退出二,解决:禁用opcache模块:在php.ini中注释掉opcache,使它不生效,如下:[opcache];opcache.enable=1;opcache.enable_cli=1;opcache.jit_buffer_size=128M;opcache.jit=tracing;zend_extension=opcache
  • 2023-09-19vue:run时报错:EACCES: permission denied([email protected])
    一,报错信息:[eslint]EACCES:permissiondenied,open'/data/vue/responsive/node_modules/.cache/eslint/43541cdc.json’如图:二,解决切换拒绝访问的文件的ownerliuhongdi@lhdpc:/data/vue/responsive$sudochownliuhongdi.liuhongdi-R/data/vue/responsive/node
  • 2023-08-19webman:安装/创建项目(v1.5.7)
    一,官方文档:1,官方站:https://www.workerman.net/webman2,安装文档:https://www.workerman.net/doc/webman/install.html二,准备安装环境:1,需求环境需求PHP>=7.2Composer >=2.02,查看本地环境:php:liuhongdi@lhdpc:~$/usr/local/soft/php8/bin/php--version
  • 2023-08-19webman:修改默认页面(v1.5.7)
    一,默认页面的内容:说明:代码位于app/IndexController.php参考这个文档:https://www.workerman.net/doc/webman/route.html原始代码:显示了README.md这个文件的内容12345678910classIndexController{    publicfunctionindex(Request$reques
  • 2023-08-19webman:管理命令(v1.5.7)
     一,启动和停止1,启动#-d:以daemon方式启动,用于生产环境liuhongdi@lhdpc:/data/webman/imageadmin$phpstart.phpstart-dWorkerman[start.php]startinDAEMONmode-------------------------------------------WORKERMAN--------------------------------------
  • 2023-06-20nginx:报错upstream sent too big header(nginx 1.24)
    一,报错信息:访问网站时报错:如图: 查看nginx的错误日志:2023/06/1610:21:46[error]416087#0:*71148upstreamsenttoobigheaderwhilereadingresponseheaderfromupstream,client:223.72.69.14,server:blog.liuhongdi.com,request:"GET/index
  • 2023-06-20配置wordpress:统一修改文章内图片的src
    一,博客站的域名修改后,文章内图片不能正常显示原图不能正常显示:如下图:默认图片的域名是:https://liuhongdi.com/wp-content/uploads/2023/05/image-49.png我们修改为:/wp-content/uploads/2023/05/image-49.png二,用sql进行修改1,在wordpress的数据库执行:UPDATEwp_
  • 2023-04-28设置wordpress:隐藏 自豪地采用WordPress 链接(wordpress 6.2)
    一,未隐藏前的效果说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest     对应的源码可以访问这里获取: https://github.com/liuhongdi/     或: https://gitee.com/liuhongdi说明:作者:刘宏缔邮箱:[email protected]
  • 2023-04-14android:keytool生成应用签名证书(java 15)
    一,查看是否已安装keytoolkeytool命令的程序位于jdk的安装目录/bin下,1,查看是否有keytool命令已安装?[lhdop@blog~]$ls/usr/local/soft/jdk-17/bin/keytool/usr/local/soft/jdk-17/bin/keytool2,查看帮助:列出可用的命令[lhdop@blog~]$keytool--helpKeyandCert
  • 2023-04-01macos:用homebrew安装node/安装vue-cli( node v18.15.0/ Homebrew 4.0.10-119)
    一,用brew安装nodeliuhongdi@liuhongdideMacBook-ProHomebrew%brewinstallnode@18==>Downloadinghttps://formulae.brew.sh/api/formula.jws.json#=#=#==>Fetchingnode
  • 2023-04-01homebrew:常用命令(Homebrew 4.0.10-119)
    一,brew常用的命令1,查看brew下载文件的缓存目录liuhongdi@liuhongdideMacBook-ProHomebrew%brew--cache/Users/liuhongdi/Library/Caches/Homebrew2,查看brew的安装目录liuhongdi@liuhongdideMacBook-ProHomebrew%brew--prefix/usr/local也可以:liuhongd
  • 2023-04-01homebrew: 配置国内源(Homebrew 4.0.10-119)
    一,查看brew的安装目录:liuhongdi@liuhongdideMacBook-Propoem%cd"$(brew--repo)"liuhongdi@liuhongdideMacBook-ProHomebrew%pwd/usr/local/Homebrew说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest     对应的源
  • 2023-04-01macos:安装homebrew( Homebrew 4.0.10-119 / macos 12.4)
    一,通过命令行安装:1,原版安装命令:会无法安装liuhongdi@liuhongdideMacBook-Propoem%/bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"curl:(7)Failedtoconnecttoraw.githubusercontent.comport443after45ms:
  • 2023-02-28thinkphp6:使用session(thinkphp v6.0.10LTS)
    一,项目中启用session1,app/middleware.php添加如下一行//Session初始化\think\middleware\SessionInit::class2,注意给runtime目录加入写权限:例:liuhongd