Fork me on GitHub
frostbelt's home

想学更多有意思的东西,想做自己的网站,想学画画


  • 首页

  • 归档

  • 标签

linux 乱码问题

发表于 2018-10-18 | 热度 ℃
| 字数统计 224 | 阅读时长 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$ git st
# ???? master
??????,??????

$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: ?????????
LANG=zh_CN.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=

# 临时解决
$ export LC_ALL="zh_CN.UTF-8"

$ locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=zh_CN.UTF-8

$ git st
# 位于分支 master
无文件要提交,干净的工作区

# 永久解决
在 ~/.bashrc 中添加
export LC_ALL="zh_CN.UTF-8"
并执行
source ~/.bashrc

解决 FastCGI sent in stderr: "Primary script unknown" while reading response head...

发表于 2018-10-18 | 热度 ℃
| 字数统计 45 | 阅读时长 1

尝试了网上众多方法后,发现是项目目录权限问题

本次解决方式

1
开放项目目录权限(及以上每一层次权限)

linux 用户操作

发表于 2018-10-17 | 热度 ℃
| 字数统计 73 | 阅读时长 1

切换到 root 用户

1
su root

添加用户

1
useradd xxx
阅读全文 »

linux 命令 grep

发表于 2018-10-15 | 热度 ℃
| 字数统计 585 | 阅读时长 2

grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。

匹配字符串

grep xxx file_name
grep "xxx" file_name

阅读全文 »

git merge “解决”冲突

发表于 2018-10-12 | 热度 ℃
| 字数统计 217 | 阅读时长 1

有时候 merge 时很明确的知道应该用哪个分支的,就直接用那个分支的

方法1. 冲突后选择用某个分支的

1
2
git checkout --ours xxx # 用当前分支
git checkout --theirs xxx # 用合并过来的分支
阅读全文 »

linux 搭建 git 服务器

发表于 2018-10-12 | 热度 ℃
| 字数统计 225 | 阅读时长 1

引自在阿里云上搭建自己的git服务器

新建一个用户,专门用来搭建 git 服务器

1
adduser git

不允许该用户 ssh 到服务器

1
2
3
4
5
6
vi /etc/passwd

将
git:x:1001:1001:,,,:/home/git:/bin/bash
修改为
git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell
阅读全文 »

linux 安装 mysql

发表于 2018-10-12 | 热度 ℃
| 字数统计 317 | 阅读时长 1

需要 root 权限

查看有没有安装过 mysql

1
2
yum list installed mysql*
rpm -qa | grep mysql*

查看有没有安装包

1
yum list mysql*
阅读全文 »

linux 安装 redis

发表于 2018-10-12 | 热度 ℃
| 字数统计 190 | 阅读时长 1

安装 redis

1
yum install redis

启动 redis

1
service redis start
阅读全文 »

linux 卸载重装 php

发表于 2018-10-12 | 热度 ℃
| 字数统计 195 | 阅读时长 1

卸载 php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 查看已安装的 php 相关包
rpm -qa|grep php
php-pecl-igbinary-1.2.1-1.el7.x86_64
php-xml-5.4.16-43.el7_4.x86_64
php-pecl-redis-2.2.8-1.el7.x86_64
php-common-5.4.16-43.el7_4.x86_64
php-process-5.4.16-43.el7_4.x86_64
php-cli-5.4.16-43.el7_4.x86_64
php-fpm-5.4.16-43.el7_4.x86_64
php-pear-1.9.4-21.el7.noarch

# 依次卸载
rpm -e xxx

如果某个包被依赖不能卸载,如:
➜ src rpm -e php-cli-5.4.16-43.el7_4.x86_64
错误:依赖检测失败:
php-cli 被 (已安裝) php-pear-1:1.9.4-21.el7.noarch 需要
先卸载 php-pear-1.9.4-21.el7.noarch

如果还有不能卸载的,可以加 参数强制卸载,如:
rpm -e php-4.3.9-3.15 --nodeps
阅读全文 »

js zlib 压缩

发表于 2018-10-12 | 热度 ℃
| 字数统计 284 | 阅读时长 1

使用 zlib.js 实现 js zlib 解压/压缩

阅读全文 »
1…13141516
frostbelt

frostbelt

想学更多有意思的东西,想做自己的网站,想学画画

159 日志
161 标签
© 2021 frostbelt Flag Counter
博客全站共31.7k字