Other articles


  1. Linux Command : grep & sed

    Published: Wed 25 March 2020
    Updated: Wed 25 March 2020
    By Grape

    In Misc.

    tags: Linux

    如何利用grep和sed实现搜索和替换

    grep -Erl "M\\('local" .|xargs sed -Ei "" "s/M\\('local/M\\('remote/g"
    
    grep -Erl "http://loca" .|xargs sed -Ei "" "s/http:\/\/local/http:\/\/remote/g"
    

    grep

    • -E 将样式为延伸的普通表示法来使用
    • -r 此 …
    read more
  2. Linux Command : rsync

    Published: Tue 24 March 2020
    Updated: Tue 24 March 2020
    By Grape

    In Misc.

    tags: Linux

    Linux 下合并两个目录,软连接也一起同步。

    rsync -K -a 源目录  被覆盖目录
    

    比如:

    rsync -K -a dir1/ dir2/
    

    参考连接:https://linux.die.net/man/1/rsync

    read more
  3. Linux Process

    Published: Thu 27 June 2019
    Updated: Thu 27 June 2019
    By Grape

    In Misc.

    tags: Linux

    概念

    程序是一系列指令的集合,通常存为可执行文件。进程是程序的执行过程。

    进程属性

    使用ps可以查看系统正在运行的进程。 ps --help显示该命令的用法。

    ps -e -o USER,PID,PPID,GID,NAME
    USER …
    read more
  4. docker 基础

    Published: Thu 23 May 2019
    Updated: Thu 23 May 2019
    By Grape

    In Misc.

    tags: Docker

    自定义镜像

    如何自定义一个镜像,并上传到Docker Hub 。

    假设需要为php-fpm-alpine增加mysqli扩展并增加 usermod 命令。

    编写Dockerfile

    FROM php:7.4.3-fpm-alpine
    
    LABEL maintainer="liujun<liujun@forkliu.com>"
    
    RUN docker-php-ext-install mysqli
    RUN echo http://dl-2 …
    read more
  5. Github Usage

    创建ssh-key 并且重命名

    cd ~/.ssh
    ssh-keygen -t rsa -C "example@example.com"
    ssh-keygen -t ed25519 -C "your_email@example.com"
    

    on Windows:

    eval `ssh-agent -s`
    

    将ssh-key添加到ssh agent

    ssh-add example
    

    配置,将不同账号与ssh-key关联

    vim config
    Host example
        Hostname github.com …
    read more
  6. 7z 解压文件名乱码

    问题描述

    在Windows 7中文版系统上使用7z压缩一些文件后,然后在Windows 10 Pro英文版系统上解压,发现凡是文件名中包含中文,最后都是乱码。

    原因

    使用7z压缩文件时,对文件名的编码是采用Windows 系统默 …

    read more

links

social