• 2024-11-15GoFurther - Chapter 5: Database Setup and Configuration
     zzh@ZZHPC:/zdata/Github/greenlight$dockerpullpostgreszzh@ZZHPC:/zdata/Github/greenlight$dockerrun--namepostgres17-p5432:5432-ePOSTGRES_USER=root-ePOSTGRES_PASSWORD=root-dpostgres:latest zzh@ZZHPC:~$dockerexec-itpostgres17psql
  • 2024-09-28Pytorch - Install
    https://pytorch.org/get-started/locally/  zzh@ZZHPC:~/zd/Github$python-mvenvzpytorchzzh@ZZHPC:~/zd/Github$cdzpytorch/zzh@ZZHPC:~/zd/Github/zpytorch$sourcebin/activate(zpytorch)zzh@ZZHPC:~/zd/Github/zpytorch$command-vpython/zdata/Git
  • 2024-06-09Go - flag
     packagemainimport("flag""fmt")funcmain(){var(nameFlag=flag.String("name","Sam","Nameofthepersontosayhelloto")quietFlag=flag.Bool("quiet"
  • 2024-03-17Linux - /dev/tcp/<HOSTNAME>/<PORT>
    Linux中存在一个特殊的设备文件/dev/tcp/<HOSTNAME>/<PORT>,该文件可以直接和目标建立TCP通信,利用这一特性可以进行端口检测。 zzh@ZZHPC:/dev$lh|greptcpzzh@ZZHPC:/dev$echo>/dev/tcp/192.168.1.16/21zzh@ZZHPC:/dev$echo>/dev/tcp/192.168.1.16/22bash:conne
  • 2024-02-23Go 100 mistakes - Expecting deterministic behavior using select and channels
      funcmain(){messageCh:=make(chanint,10)disconnectCh:=make(chanstruct{},1)fori:=0;i<10;i++{messageCh<-i}gofunc(){for{select{casev:=<-messageCh:
  • 2024-01-11Virtualbox - VM can't start after OS update
      Executing'modprobevboxdrv'didn'twork:zzh@ZZHPC:~$sudomodprobevboxdrvmodprobe:FATAL:Modulevboxdrvnotfoundindirectory/lib/modules/6.5.0-14-generic HadtoremoveVirtualbox6.1andinstallVirtualbox7.0:zzh@ZZHPC:~
  • 2023-12-26ZIMP - Install migrate CLI
     zzh@ZZHPC:~/Downloads$curl-Lhttps://packagecloud.io/golang-migrate/migrate/gpgkey|sudoapt-keyadd-%Total%Received%XferdAverageSpeedTimeTimeTimeCurrentDloadUploadTotalSpent
  • 2023-12-23ZIMP - dbml
     zzh@ZZHPC:/zdata/Github/zimplebank$npminstall-g@dbml/cli zzh@ZZHPC:/zdata/Github/zimplebank$dbml2sql--helpUsage:dbml2sql[options]<files...>Options:-V,--versionoutputtheversionnumber--mysql
  • 2023-12-23ZIMP - dbdocs
     zzh@ZZHPC:~$dbdocslogin?Choosealoginmethod:Email?Youremail:[email protected]✔Requestemailauthentication?PleaseinputOTPcodesenttotheemail:914566✔Logintoyouraccount✔Validatetoken✔SavecredentialDone.zzh@ZZHPC
  • 2023-11-27PostgreSQL - Execute sql file using psql
    zzh@ZZHPC:~$sudoaptinstallpostgresql-client zzh@ZZHPC:~$psql--versionpsql(PostgreSQL)14.9(Ubuntu14.9-0ubuntu0.22.04.1) zzh@ZZHPC:~$psqlpostgresql://root:aaa@localhost:5432/zimple_bankpsql(14.9(Ubuntu14.9-0ubuntu0.22.04.1),server
  • 2023-11-19Docker - Run PostgreSQL database
    zzh@ZZHPC:~$dockerpullpostgres:alpinezzh@ZZHPC:~$dockerimagesREPOSITORYTAGIMAGEIDCREATEDSIZEpostgresalpine642d75c6be0c9daysago245MB zzh@ZZHPC:~$dockerrun--namepostgres16-p5432:5432-ePOSTGRES_
  • 2023-09-05Go - benchmark cpuprofile
    zzh@ZZHPC:/zdata/MyPrograms/Go/aaa$gotest-runNONE-bench.goos:linuxgoarch:amd64pkg:zzh/aaacpu:Intel(R)Core(TM)[email protected]/opPASSokzzh/aaa1.392szzh@ZZHPC:/zdata/MyPrograms/Go
  • 2023-08-06Shell - sleep
    zzh@ZZHPC:~$sleep120^Z[1]+Stoppedsleep120zzh@ZZHPC:~$bg%1[1]+sleep120&zzh@ZZHPC:~$[1]+Donesleep12010:01开始sleep,执行完后立刻执行Ctrl+Z中止。10:02执行bg%1(bgsleep也可以)来resumesleep进程。10:0
  • 2023-08-05Git - git tag
    zzh@ZZHPC:/zdata/Github/zzhrepo1$gitadd-Azzh@ZZHPC:/zdata/Github/zzhrepo1$gitcommit-m"updatefunctionCubeVolume()"[main13f27a8]updatefunctionCubeVolume()1filechanged,9insertions(+),2deletions(-)zzh@ZZHPC:/zdata/Github/zzhr