Saki's 研究记录

Saki's 研究记录

MckeeのClub & SAKI’sブログ

(MAC Big Sur 12.1) ImportError: dlopen libpq
问题在python脚本中连接postgres时遇到以下问题: 12345678Traceback (most recent call last): File "/Users/shenshijie/Documents/app/postgres/connect.py", line 2, in <module> import psycopg2 File "/opt/homebrew/lib/python3.9/site-packages/psycopg2/__init__.py", line 51, in <module>...
docker-compose部署postgres并解决connection refused错误
One of the biggest benefits of using docker for me has been the fact that it makes developing code with databases much simpler. 每当我想构建一个项目的时,倾向于使用postgres作为数据库。在Docker还没出现前,需要手动安装postgres到我本地机器,拉起服务,创建数据库表,创建指定的用户和对应的权限,最后在本地拉起项目来测试和开发。整个流程下来几个小时就过去了。 Docker出现后,事情变得异常简单。特别是在配合docker-compose使用后,...
[解决] error/0308010C/digital envelope routines//unsupported
坏境 OS 版本: Mac OS Monterey 12.1nodejs 版本:v17.3.1npm 版本:8.1.0nvm 版本:0.39.1 问题Hello Guys, How are you all? Hope You all Are Fine.今天心血来潮把node更新到了最新版本,当我用vue create demo-vue 命令创建了个新工程,运行npm run serve时出现报错: 1opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error'...
Mac OSX下执行crosstool-ng问题记录
环境系统:MacOS Big Sur 11.6.1 ct-ng:GNU Make 4.3 / Built for x86_64-apple-darwin20.1.0 前言在Mac下面使用HomeBrew安装了crosstool-ng来编译aarch64上的代码,结果在执行的时候报告如下错误: 12345ct-ng source[INFO ] Performing some trivial sanity checks[WARN ] Number of open files 256 may not be sufficient to build the toolchain; increa...
golang embed 使用
简介特性//go:embed,它的作用就是可以在Go语言应用程序中包含任何文件、目录的内容,也就是说我们可以把文件以及目录中的内容都打包到生成的Go语言应用程序中了,部署的时候,直接扔一个二进制文件就可以了,不用再包含一些静态文件了,因为它们已经被打包到生成的应用程序中了。 样例目录结构创建目录: 1mkdir -p embed_example/{static,templates} 目录结构: 123456789101112cd embed_example; tree.├── go.mod├── go.sum├── hello.txt├── main.go├── st...
docker-compose 部署 Redis 的异常解决
背景使用docker-compose部署Redis后,拉起服务后通过docker log查看有异常报错。。。 内核参数 overcommit_memory1WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl ...
[转载] Always Multiply Your Estimates by π
转载自(Original): web.archive.orgProject estimation is a black art, nowhere more so than in game development. I once heard of a mysterious cabal of numerologists that multiplied their time estimates by π . The practice allegedly gave them sufficient buffer for new requirements, testing, iteration, a...
[转载] Hire for slope, not Y-Intercept
转载自(Original): Matt RickardForget about the y-intercept; slope is the only thing that matters in the long run. Imagine your life as a line. On the x-axis, time. On the y-axis, think of a goal you’re trying to achieve: whether a personal one like getting in shape or a professional one like getting...
golang parse df -h output hard way
背景最近有个场景,需要解析远程调用命令df -h,输出的格式类似CentOS下的输出: 123456789# df -hFilesystem Size Used Avail Use% Mounted on/dev/vda1 99G 5.5G 89G 6% /devtmpfs 3.8G 0 3.8G 0% /devtmpfs 3.8G 24K 3.8G 1% /dev/shmtmpfs 3.8G 274M 3.6G 8% /runtmpfs 3.8G...
golang: alpine image 编译 sqlite3
背景最近在看一个Golang的开源项目,项目中使用到了GORM但只支持了MySQL和PostgreSQL,为了练手尝试添加对SQlite的支持。 1234import ( "gorm.io/driver/sqlite" "gorm.io/gorm") 编写完代码后在本地go run运行很正常,但当使用alpine构建docker镜像时遇到了问题… 问题编译会卡在sqlite3,报错信息为: 1212 73.08 # github.com/mattn/go-sqlite312 73.08 cgo: C compiler "gcc"...