编程技巧 - 文章列表

  • centos7 扩容已有分区

    [root@XX-Visual-Demo~]#fdisk/dev/sdaWelcometofdisk(util-linux2.23.2).Changeswillremaininmemoryonly,untilyoudecidetowritethem.Becarefulbeforeusingthewritecommand.Command(mforhelp):nPartitiontype:pprima

  • docker生成镜像docker build速度慢的解决方法

    dockerbuild速度慢,通常是外网访问慢,可以通过修改apt-get、pip、npm的源为国内镜像来提高下载速度1、修改apt-get源在dockerfile中增加:RUNmkdir-p/etc/aptRUNtouch/etc/apt/sources.listRUNsed-is/archive.ubuntu./mirrors.aliyun./g/etc/apt/sources.listRUN

  • PG数据库给指定用户授予访问指定表的权限

    --列出所有用户select*frompg_user--查询用户可以访问哪些表select*frominformation_schema.role_table_grantswheregrantee=xxx;--为用户授予访问表的权限grantselectonv_zc_racktoxxx

  • java -jar 读取中文配置报错,使用utf8执行jar

    java程序打包出来后,用java-jar运行,默认是gbk编码,可能会造成某些错误。如使用springboot开发的网站打包后,读取nacos的配置中如果有中文就会报错解决方式是加入-Dfile.encoding=utf-8这个参数,如下:java-Dfile.encoding=utf-8-jarxxx.jar

  • nodejs版本管理-nvm的安装和使用

    nvm是管理nodejs版本的工具,可以方便地安装nodejs及切换nodejs版本nvm安装及使用的方法如下1、nvm官网下载地址:https://github.com/coreybutler/nvm-windows/releases2、设置国内镜像找到nvm的安装目录,如C:\Users\Administrator\AppData\Roaming\nvm将下面两行加到settings.text

  • python利用pandas将csv转为excel

    这段代码展示了使用pandas将CSV文件转换为Excel文件的基本方法。

  • TNS-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务

    TNS-12514:TNS:监听程序当前无法识别连接描述符中请求的服务ORA-12514,TNS:listenerdoesnotcurrentlyknowofservicerequestedinconn可以尝试修改listener.ora此文件位于“D:\app\Administrator\virtual\product\12.2.0\dbhome_1\network\admin”增加下图中的红色

  • postgresql新建数据库及用户的方法

    #创建数据库testdbcreatedatabasetestdb;#创建用户testusercreateusertestuserwithpassword123456;#授权grantallondatabasetestdbtotestuser;#修改数据库owneralterdatabasetestdbownertotestuser;*切换用户登录#创建schema,命名为schema01creat

  • postgresql查询每张表占用硬盘空间的语句

    查询每张表占用磁盘空间SELECTtable_schema||.||table_nameAStable_full_name,pg_size_pretty(pg_total_relation_size(||table_schema||.||table_name||))ASsizeFROMinformation_schema.tablesORDERBYpg_total_relation_size(||

  • 使用pandas处理excel数据的方法

    首先引入pandasimportpandasaspd1.读取excel,指定sheet名为sheet2df=pd.read_excel(filename,sheet_name=Sheet2)2.筛选数据,如:筛选列更新时间大于2022-09-01的数据df=df[df[更新时间].apply(lambdax:x2022-09-01)]3.修改指定列的值df[客户ID]=df[客户ID].apply