操作系统 - Linux命令整理 - Ubuntu
镜像
http://mirrors.163.com/ubuntu-releases/
系统相关
Ubuntu14.04相关
安装 - VMware
Install Ubuntu
Continue
Install Now
Continue
Shanghai
Continue
用户名/登录账号设置 - Continue
Restart now
内核相关
查看内核版本
uname -r
网络相关
sysctl -w net.ipv4.ip_forward= #临时开启路由转发
service network restart #重启网络配置
永久开启路由转发
修改/etc/sysctl.conf文件
将 net.ipv4.ip_forward=0改为net.ipv4.ip_forward=
快捷键
Ctrl + Alt + t - 打开终端
源相关
更新源:sudo apt-get update
修改源:/etc/apt/sources.list
源整理:
源1(系统默认)
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main
源2:
deb http://old-releases.ubuntu.com/ubuntu/ raring main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-security main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-security main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-updates main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-updates main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-proposed main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-proposed main restricted universe multiverse
源3(东北大学):
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse
源4(清华大学):
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
源5(阿里云):
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
域名-IP转换
/etc/resolv.conf
8.8.8.8 Google DNS
工具 - 中间件 - Apache
安装:sudo apt install apache2
重启:/etc/init.d/apache2 restart
默认配置文件路径:/etc/apache2/apache2.conf
查看版本:apachectl -v
查看/修改端口 /etc/apache2/ports.conf
默认页面路径 /var/www/html
工具 - 编程语言 - Python
安装 sudo apt-get install python-pip
检测 pip -V
工具 - 常用
VMware Tools
安装
虚拟机安装Vmware Tools
解压
cd 到 目录
sudo su 切换 root权限
./vmware-install.pl
回车 all the time
重启
Docker相关
安装 sudo apt install docker.io
查看版本 - docker -v
启动docker后台服务 - sudo service docker start
启动 systemctl start docker
守护进程重启 sudo systemctl daemon-reload
重启docker服务 systemctl restart docker
重启docker服务 sudo service docker restart
关闭docker service docker stop
关闭docker systemctl stop docker
工具 - Web框架 - ElasticSearch
安装
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.zip
unzip elasticsearch-5.5..zip
mv elasticsearch-5.5. /data/home/es/lcoal
cd elasticsearch-5.5./bin
./elasticsearch 添加账号
groupadd testes
useradd testes -g elasticsearch
chown -R testes:elasticsearch elasticsearch-5.5.
增删改查
、数据写入:
HTTP method:POST
URL:http://127.0.0.1:9200/index-docs-name/data-type-name -d "{jsonstr}"
返回:{"_index":"index-name","_type":"typename","_id":"idstr","_version":"","created":"true"} 、数据获取:
HTTP method :GET
URL:http://127.0.0.1:9200/index-docs-name/data-type-name/id
返回:数据的json结构 、数据删除:
HTTP method :DELETE
URL:http://127.0.0.1:9200/index-docs-name/data-type-name/id
或者:http://127.0.0.1:9200/index-docs-name(可以使用通配符)删除多个文档 、数据更新:
()全量再次写入
HTTP method:POST
URL:http://127.0.0.1:9200/index-docs-name/data-type-name/id -d "{jsonstr}"
返回:{"_index":"index-name","_type":"typename","_id":"idstr","_version":"","created":"true"}
()局部更新:
HTTP method:POST
URL:http://127.0.0.1:9200/index-docs-name/data-type-name/id/_update -d "{jsonstr}" 、数据查询
()全文搜索
HTTP method : GET
URL : http://127.0.0.1:9200[/index-docs-name/data-type-name]/_search[?q=xxx] -d "{json}"
()聚合请求:
在查询的search输入的结构体中写聚合语句即可。 新建模板 请求方式--PUT
请求地址a.b.c.d:/_template/your_temp_name
模板:
{
"template":"whoisinfo",#模板名,索引名字一样自动适配。
"order":"",#模板号
"state":"open",
"settings": {
"index": {
"creation_date": "",
"number_of_shards": "",#自己控制
"number_of_replicas": "",#自己控制
"uuid": "0GCKTzVTRAaw-z47TfCaZQ",
"version": {
"created": ""
}
}
}
"mapping":{
"domain":{#这里是这个模板下第n类数据的样子
"properties":{
"colunm_name":{
"index":"not_analyzed"
"type":"date/string……"
"format":"strict_date_optional_time||epoch_millis"#这里是时间格式
}
}
}
}
} 索引与映射 (一)、映射
、创建
Method : PUT
URL : http://127.0.0.1:9200/index-docs-name/_mappind -d "{jsonstr}"
、新增字段
Method : PUT
URL : http://127.0.0.1:9200/index-docs-name/_mappind/mapping-name -d "{jsonstr}"
、删除映射会删除数据
Method : DELETE
URL : http://127.0.0.1:9200/index-docs-name/_mappind/mapping-name
、获取映射
Method : GET
URL : http://127.0.0.1:9200/index-docs-name/_mappind/mapping-name (二)常见的字段定义
type 数据类型
index 是否分词(not_analyzed)
format 格式
多重索引
"name":{
"type":"xxxxx"
"fields"::{"xxx":"xxxx"}
} 分页查询 创建Elasticsearch对象
es = Elasticsearch([{'host':'192.168.1.103','port':}]) 创建分页机制
resp = es.search(index, body=query, scroll="24h",size=)
24h 是scrollid 有效时间
scroll_id = resp['_scroll_id'] id就是标识
total = resp["hits"]["total"] 总量 获取数据
resp = es.scroll(scroll_id=scroll_id, scroll="24h")
rdoc = resp["hits"]["hits"]
scroll_id = resp['_scroll_id']
rdoc是每个数据项字典结构体的list LogStash 安装
#step-one:依赖于java jdk 所以预先安装JDK
、下载jdk 首选1.
、tar xzvf jdk-7u55-linux-x86.tar.gz
、mkdir /usr/lib/jvm
、mv jdk1..0_55 /usr/lib/jvm/
、gedit ~/.bashrc
在末尾输入一下内容并保存退出
export JAVA_HOME=/usr/lib/jvm/jdk1..0_55
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
、source ~/.bashrc(多个账户下)
#step-two:安装logstash
、方法1--源代码安装
wget https://download.elastic.co/logstash/logstash/logstash-1.5.1.tar.gz
tar zxvf logstash-1.5..tar.gz
mv logstash-1.5. logstash
cd ./logstash/
测试语句:bin/logstash -e 'input { stdin { } } output { stdout {} }'
配置测试语句:
bin/logstash -e 'input { stdin { } } output { stdout { codec => rubydebug } }'
、方法2--elasticsearch官方仓库安装
wget -O http://packages.elasicsearch.org/GPG-KEY-elasticsearch | apt-key add -cat >> /etc/apt/sources.list
deb http//packages.elasticsearch.org/logstash/1.5/debian stable main
apt-get update
apt-get install logstash 按照logstash配置文件运行logstash
bin/logstash -f logstash.conf 配置文件logstash.conf示例
input {
stdin{ }
}
output{
stdout{ codec => rubydebug }
elasticsearch { embedded => true }
} 配置语法:
、第一个概念:区段,也就是上文中的input 或者output都是一个区段
#区段之内定义键值对#
、数据类型
()布尔型 true 和 false
()字符串 "hostname"
()数值
()数组 [] 类似python中的队列
()哈希 match => { key1 => "value1" , key2 => "value2" } 、语法规则
()字段读取支持倒序下标 例如a[-]
()条件判断if / else if / else
()判断操作符 != , == , < ,> ,<= ,>= ,=~ ,!~ ,in ,not in , and ,or ,nand ,xor, !{} 、命令行参数
-e 执行
-f 配置文件
-l 错误日志的输出文件
-P 加载插件\
--verbose 输出一定到调试日志
--debug 输出更多调试信息 logstash的处理过程
|filtername |xxx
<inputname <logA
>outputname >elasticsearch logstash处理的是事件,事件的流转过程;
输入 -》 过滤 -》 输出 plugin命令:
查看本机有多少插件可用 plugin list
安装插件 plugin install xxxx
升级插件 plugin update xxx logstash运行
、服务模式
services logstash start
、nohup模式
nohup logstash -f ./logstash.conf &
、screen模式(避免用户退出命令行到哦之程序退出
screen -dmS elksc1
screen -r elksc1
screen list 标准输出入
input {
stdin{
add_field => {"key" => "value"}
codec => plain
tags => {"add"}标签
type => "std"类型
}
}
文件输入
input {
file {
path => ["fiel1","file2",...]
type => "systen"
start_position => "beginning"duqushujuweizhi
#discover_interval 每隔多久去检查下path选的下新文件 默认15s
#execlude 排出文件 list
#sincedb/sincedb_write_interval
#start_interval 每隔多久监听下新文件
}
}
TCP 输入:
input {
tcp {
port =>
mode => server
ssl_enable => false
}
}
网络导入旧数据时候常用 与nc配合
nc 127.0.0.1 < olddata syslog输入:
input {
syslog {
port => ""
}
} collectd输入:
input {
collectd {
port =>
type => colletced
}
}
Codec
、json
codec => "json"
注意对于nginx日志 可以把-替换成0
、多行事件编码
codec => multiline {
pattern => "^\["
negate => true
waht => "previous"
}
、网络流编码:
codec => netflow {
definitions => "/opt/logstash-1.4.2/lib/logstash/codec/netflow/netflow.yaml"
version => []
} 时间处理:
filter {
gork {
match => ["message","%{HTTPDATE:logdate}"]
}
date {
match => ["logdate","dd/MMM/yyyy:HH:mm:ss Z"]
}
}
gork 正则捕获
语法
gork {
match => {
"message"=> "%{WORD} {NUMBER:request_time:float} %{WORD}"
}
} match => {"message"=>"%{SYSLOGBASE} %{DATA:message}"}
计划任务
crontab -l
ls -alh /var/spool/cron
ls -al /etc/ | grep cron
ls -al /etc/cron*
cat /etc/cron*
cat /etc/at.allow
cat /etc/at.deny
cat /etc/cron.allow
cat /etc/cron.deny
cat /etc/crontab
cat /etc/anacrontab
cat /var/spool/cron/crontabs/root
不安全的文件/文件夹权限配置
cat ~/.bash_history
cat ~/.nano_history
cat ~/.atftp_history
cat ~/.mysql_history
cat ~/.php_history
明文用户名/密码搜索
系统初始密码需要自己修改
sudo passwd root #删除用户 userdel 用户名
#根据uid反查用户名 getent passwd 0
grep -i user [filename]
grep -i pass [filename]
grep -C "password" [filename]
find . -name "*.php" -print0 | xargs - grep -i -n "var $password"
日志相关
/bin/systemctl restart rsyslog.service -- NewStart Carrier Grade Server Linux release /centos7 #重启日志服务
Q - A:
Linux下出现Read-only file system
mount -o remount rw /
Q - A:
userdel: cannot open /etc/passwd -》
chattr -i /etc/passwd /etc/shadow /etc/group /etc/gshadow
Q:
This computer currently has no detected operating systems” when installing [duplicate]
A:
Choosing "something else" takes me to the partitions. However, it only detects a single unpartitioned space (my entire HDD) even though I actually have partitions taking up plenty of space. By no means can I detect my two partitions using any method. Is it possible the bit installation might be more successful? (I doubt it but I had to ask) Edit:
250gb. I have two partitions for windows (one main and another for storage) as well as an empty third partition with 20gb that I intend to use for Ubuntu. None are detected, however. FINAL EDIT:
I finally fixed the problem. when I ran sudo fdisk -l
it gave me several partitions in the list, so I tried running fixparts on individual partitions, which ended up being inconclusive (and confusing) Then I decided to try to run fixparts over the entire unpartitioned space sudo fixparts /dev/sda
AS OPPOSED TO sudo fixparts /dev/sda1 sudo fixparts /dev/sda2
(individual partitions) and so on. After simply running the command on the entire hdd, it quickly finished and alas it was fixed! Going back to the installation, it detected my Windows installation, and also detected all existing partitions in the custom install mode. Furthermore, my data on my other partitions was left completely unscathed. It fixed my problem at no cost.
工具安装
Mysql
环境 Ubuntu 64 14.04-Desktop
检查是否安装MySQL
dpkg -l | grep mysql 安装
sudo apt-get install mysql-server 检查是否安装成功
netstat -tap | grep mysql 卸载
sudo rm /var/lib/mysql/ -R
sudo rm /etc/mysql/ -R
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor 问题
/usr/bin/dpkg returned an error code (1)
解决方案:
(1)sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bk
(2)sudo mkdir /var/lib/dpkg/info
(3)sudo apt-get update
(4)sudo apt-get install -f
(5)sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info.bk
(6)sudo rm -rf /var/lib/dpkg/info
(7)sudo mv /var/lib/dpkg/info.bk /var/lib/dpkg/info
程序名/端口/进程
通过进程id查看占用的端口:netstat -nap | grep 2708
通过PID查看进程:ps -aux |grep -v grep|grep 28990
关闭端口
sudo iptables -A INPUT -p tcp --dport $PORT -j DROP"
sudo iptables -A OUTPUT -p tcp --dport $PORT -j DROP"
或者 lsof -i :8080|grep -v "PID"|awk '{print "kill -9",$2}'|sh
防火墙
禁止所有的ip访问本机的固定端口 iptables -I INPUT -p tcp --dport -j DROP
启用所有的ip访问本机的固定端口 iptables -I INPUT -p tcp --dport -j ACCEPT
允许指定IP访问本机固定端口(需要先禁止所有的ip访问固定端口) iptables -I INPUT -s 192.168.1.123 -p tcp --dport -j ACCEPT
禁止某个IP地址的PING iptables –A Filter –p icmp –s 192.168.0.1 –j DROP
只允许PING 202.96.134.133 其它公网IP都不许PING "iptables -A Filter -p icmp -s 192.168.100.200 -d 202.96.134.133 -j ACCEPT
iptables -A Filter -p icmp -j DROP"
备份iptables cp /etc/sysconfig/iptables /var/tmp
保存iptables service iptables save
重启防火墙 service iptables restart
服务器只开启收发邮件功能 "iptables -I Filter -m mac --mac-source 00:0F:EA:25:51:37 -j DROP
iptables -I Filter -m mac --mac-source :0F:EA::: -p udp --dport -j ACCEPT
iptables -I Filter -m mac --mac-source :0F:EA::: -p tcp --dport -j ACCEPT
iptables -I Filter -m mac --mac-source :0F:EA::: -p tcp --dport -j ACCEPT"
只允许访问指定网址 "iptables -A Filter -p udp --dport 53 -j ACCEPT
iptables -A Filter -p tcp --dport -j ACCEPT
iptables -A Filter -d www..org -j ACCEPT
iptables -A Filter -d img.cn99.com -j ACCEPT
iptables -A Filter -j DROP"
指定时间上网 "iptables -A Filter -s 10.10.10.253 -m time --timestart 6:00 --timestop 11:00 --days Mon,Tue,Wed,Thu,Fri,Sat,Sun -j DROP
iptables -A Filter -m time --timestart : --timestop : --days Mon,Tue,Wed,Thu,Fri,Sat,Sun -j ACCEPT
iptables -A Filter -m time --timestart : --timestop : --days Mon,Tue,Wed,Thu,Fri,Sat,Sun -j ACCEPT"
基于MAC,只能收发邮件,其它都拒绝 "iptables -I Filter -m mac --mac-source 00:0A:EB:97:79:A1 -j DROP
iptables -I Filter -m mac --mac-source :0A:EB:::A1 -p tcp --dport -j ACCEPT
iptables -I Filter -m mac --mac-source :0A:EB:::A1 -p tcp --dport -j ACCEPT"
禁用QQ防火墙配置 "iptables -A Filter -p udp --dport ! 53 -j DROP
iptables -A Filter -d 218.17.209.0/ -j DROP
iptables -A Filter -d 218.18.95.0/ -j DROP
iptables -A Filter -d 219.133.40.177 -j DROP"
禁用MSN配置 "iptables -A Filter -p udp --dport 9 -j DROP
iptables -A Filter -p tcp --dport -j DROP
iptables -A Filter -p tcp --dport -d 207.68.178.238 -j DROP
iptables -A Filter -p tcp --dport -d 207.46.110.0/ -j DROP"
操作系统 - Linux命令整理 - Ubuntu的更多相关文章
- Linux命令整理,用户管理,用户组管理,系统管理,目录管理常用命令
知识点梳理 Linux课堂笔记 学习目标 能够知道什么是Linux系统以及它的应用场景 能够独立完成安装VMware虚拟机和网络配置 能够独立完成安装CentOS以及远程终端SecureCRT 能够熟 ...
- carson常用linux命令整理
注:通过日常所用到的一些命令进行整理添加!! 完整的命令可参考:Linux命令大全 1.cp命令 cp命令用来将一个或多个源文件或者目录复制到指定的目的文件或目录. 2.mount(挂载)命令 在li ...
- day02.2-常用Linux命令整理
Linux命令语法格式: 命令 [选项] [参数] 1). 命令:告诉Linux操作系统执行什么: 2). 选项:说明命令的运行方式.选项部分是以字符‘-’开始的: 3). 参数:说明 ...
- 操作系统-Linux命令
一.目录结构 #因为根目录与开机有关,开机过程中仅有根目录会被挂载, 因此根目录下与开机过程有关的目录(以下5个),不能与根目录放到不同的分区去. /etc:配置文件 /dev:所需要的装置文件 /l ...
- Linux 命令整理-tailf
1.tailf 跟踪日志文件 常用参数格式: tailf -n logfile 动态跟踪日志文件logfile,最初的时候打印文件的最后10行内容. 实例 查看从倒数多少行的日志信息 2.tail 跟 ...
- 50条LINUX命令整理
1. find 基本语法参数如下: find [PATH] [option] [action] # 与时间有关的参数: -mtime n : n为数字,意思为在n天之前的“一天内”被更改过的文件: - ...
- 常用快捷键以及linux命令整理
关于快捷键的使用,网上有很多.自己在使用过程中不断整理用到的知识点.一个项目完成了就把涉及用到的快捷键和命令介绍给大家,都是一些比较基础的,常用的命令.希望大家有好的知识点,命令可以及时交流整理. 一 ...
- Linux命令整理(2018/9/9-2018/9/15)
根据本周的Linux学习进度,整理了部分Linux知识及常用命令,待完善…… 1.显示默认启动方式(默认启动目标): systemctl get-default 2.设置默认启动方式(默认启动目标): ...
- linux命令整理版(拷贝)
一.文件和目录操作命令 1.pwd 显示当前所在位置 -L 显示逻辑路径,忽略软链接文件 -P 显示物理路径时如果当前目录路径时软链接文件,则会显示软链接对应的源文件 2.cd 切换目录 cd - 回 ...
随机推荐
- csrf的中间件
csrf的中间件 源码简略分析: def process_request(self, request): # 从cookies中获取csrf_token csrf_token = self._get_ ...
- Java解析XML介绍
开发十年,就只剩下这套架构体系了! >>> XML解析器提供了访问或修改用来表示数据的xml文件的能力.Java中提供了多种方式来解析xml文件. 主要分为两类,包括解析XML文 ...
- SpringBoot中设置自定义拦截器
SpringBoot中设置自动以拦截器需要写一个类继承HandlerInterceptorAdapter并重写preHandle方法 例子 public class AuthorityIntercep ...
- Solr的学习使用之(八)facet实战
以下为统计media的数量功能,通过solrj,采用了facet方法,类似于sql的分组group by查询:这边的代码只是获取总媒体数量,其实他还有其他功能,去循环solrList的话,可以获取各个 ...
- web开发中SESSION的本质
有一点我们必须承认,大多数web应用程序都离不开session的使用.这篇文章将会结合php以及http协议来分析如何建立一个安全的会话管理机制.我们先简单的了解一些http的知识,从而理解该协议的无 ...
- python使用etcd
import sys import etcd client = etcd.Client( host='127.0.0.1', port=2379, allow_reconnect=True) clie ...
- window 批处理脚本获取上级目录
1 SET CurrDir=%CD% CD.. SET InstPath=%CD% CD %CurrDir% 2 pushd.. set parent=%cd% popd 参考: https://ms ...
- 5.xml约束技术--------schema
1.schema约束 (1)dtd语法:<!ELEMENT 元素名称 约束> (2)schema符合xml的语法,xml语句 (3)一个xml文件中只能有一个dtd,但是可以有多个sche ...
- 数据库(一):事务的特性与事务(在同一个 JVM 中)的传递
参考文章 https://blog.csdn.net/shuaihj/article/details/14163713 https://blog.csdn.net/shfqbluestone/arti ...
- 一个能极大提高生产率的Chrome新建标签页扩展
我是一个对开发生产率有着BT需求的程序员,总是追求将自己的单位时间生产率最大化. 通过分析,我发现自己一天会反反复复使用Chrome的新建标签,然后访问常用的网站.因此,我期望新建一个默认的Chrom ...