1. Linux中的配置文件
1.1 .bashrc 或 .bash_profile: bash
1
2
3
4
5
| PS1="\n\[\033[01;36m\][\u@\h\[\033[01;32m\] \w\[\033[01;36m\]]\[\033[01;36m\] $(git_branch)\[\033[00m\]\n\\$\[\033[00m\] "
export HOMEBREW_PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple #ckbrew
export HOMEBREW_API_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api #ckbrew
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles #ckbrew
eval $(/opt/homebrew/bin/brew shellenv) #ckbrew
|
1.2 .vimrc: vim
1
2
3
4
5
| set showtabline=0 " 隐藏顶部标签栏"
set guioptions-=r " 隐藏右侧滚动条"
set guioptions-=L " 隐藏左侧滚动条"
set guioptions-=b " 隐藏底部滚动条"
set cursorline " 突出显示当前行"
|
1.3 各类 .conf 常用 ini 语言类型: ini
1
2
3
4
5
6
7
8
| [mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
secure-file-priv= NULL
#skip-grant-tables
max_connections = 10000
|
2.代码类
2.1 C语言: c
1
2
3
4
5
6
| #include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
|
2.2 C++语言: cpp
1
2
3
4
5
6
| #include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
|
2.3 Python语言: python
2.4 Ruby语言: ruby
2.5 JavaScript (Node.js)语言: javascript
1
| console.log("Hello, World!");
|
2.6 Java语言: java
1
2
3
4
5
| public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
|
2.7 C#语言: csharp
1
2
3
4
5
6
7
| using System;
class HelloWorld {
static void Main() {
Console.WriteLine("Hello, World!");
}
}
|
2.8 Go语言: go
1
2
3
4
5
6
7
| package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
|
2.9 Rust语言: rust
1
2
3
| fn main() {
println!("Hello, World!");
}
|
2.10 Swift语言: swift
2.11 Kotlin语言: kotlin
1
2
3
| fun main() {
println("Hello, World!")
}
|
2.12 PHP语言: php
1
2
3
| <?php
echo "Hello, World!";
?>
|
2.13 Bash语言: bash
2.14 Jenkins Pipline语言: groovy
1
2
3
4
5
6
7
8
9
10
11
| pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
}
}
|
2.15 .jvm.options配置文件: properties 或 bash
1
2
3
4
5
6
| # 没有专门的语法高亮可以用 properties 或 bash
-Xms512m
-Xmx1024m
-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
|
2.16 PromSQL语句: promql
aws_rds_database_connections_average{name=~"^arn:aws.*",dimension_CacheNodeId=""}
/
on(tag_DBInstanceClass)
group_left()
(
aws_rds_instance_memory_bytes / 12582880
) *100 > 85