文本处理技巧1

shell把字符串中的字母去掉,只保留数字
[root@hz-kvm cephdisk3]# cat 1.txt
120Tib

1 过滤字母到其他文件
[root@hz-kvm cephdisk3]# cat 1.txt | tr -d "a-zA-Z" > 2.txt
[root@hz-kvm cephdisk3]# cat 2.txt
120

2 过滤数字到其他文件
[root@hz-kvm cephdisk3]# cat 1.txt | tr -d [:digit:] > 3.txt
[root@hz-kvm cephdisk3]# cat 3.txt
Tib

linux 下获取公网IP地址的方法

1、curl ifconfig.me

[root@newzdaw01 ~]# curl ifconfig.me
182.150.63.44[root@newzdaw01 ~]#

2、curl http://members.3322.org/dyndns/getip

[root@newzdaw01 ~]# curl http://members.3322.org/dyndns/getip
182.150.63.44
3、curl cip.cc

[root@newzdaw01 ~]# curl cip.cc
IP    : 182.150.63.44
地址    : 中国  四川  成都
运营商    : 电信

数据二    : 四川省成都市 | 电信

数据三    :

URL    : http://www.cip.cc/182.150.63.44

4、curl  -s  icanhazip.com

[root@newzdaw01 ~]# curl  -s  icanhazip.com
182.150.63.44

#!/bin/bash
#
printf "The complete list is %s " "$$"
printf "The complete list is %s " "$!"
printf "The complete list is %s " "$?"
printf "The complete list is %s " "$*"
printf "The complete list is %s " "$@"
printf "The complete list is %s " "$#"
printf "The complete list is %s " "$0"
printf "The complete list is %s " "$1"
printf "The complete list is %s " "$2"

mysql中修改表的默认编码和表中字段的编码

ALTER TABLE `table` DEFAULT CHARACTER SET utf8;

解决国内android studio gradle缓慢

在操作系统当前用户的 HOME 目录,找到 .gradle 文件夹,在这个文件夹下面创建一个文本文件 init.gradle。完整的文件路径可能如下:C:Users<name>.gradleinit.gradle。
在此文件中加入如下代码片段:

allprojects{
    repositories {
        def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
        def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
        all { ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
                    remove repo
                }
                if (url.startsWith('https://jcenter.bintray.com/')) {
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL."
                    remove repo
                }
            }
        }
        maven {
            url ALIYUN_REPOSITORY_URL
            url ALIYUN_JCENTER_URL
        }
    }
}
 
yum install libwebp-tools -y
 
centos7 安装  ImageMagick
 
yum install ImageMagick ImageMagick-devel -y
 

 转换PDF为图片

convert -density 600 -trim  LJJCH02.pdf -quality 95 aaa600.png

convert -density 300 -trim  LJJCH02.pdf -quality 95 aaa600.png

原文地址:https://www.cnblogs.com/fyc119/p/12973282.html