Skip to content

Instantly share code, notes, and snippets.

View shui's full-sized avatar

Shui Dujiang shui

View GitHub Profile
@shui
shui / install.md
Created January 29, 2018 06:17
Debian Jessie安装最新版Nginx

添加nginx的官方安装源:

# vim /etc/apt/sources.list

然后:

deb https://nginx.org/packages/debian/ jessie nginx
deb-src https://nginx.org/packages/debian/ jessie nginx

然后:

@shui
shui / after-install.md
Last active November 19, 2023 09:45
阿里云ECS安装后……

删除阿里云ECS登录欢迎信息

阿里云镜像修改了欢迎信息:

Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-105-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
@shui
shui / 1.md
Created March 5, 2018 03:24
Linux查找大文件和大目录

挂载/home的磁盘目录扩容了好几次但很快又没可用空间了,很烦。 之后发现是Gitlab自动备份文件堆积成山……

  • 查找大文件
# 查找超过800M大小文件
find . -type f -size +800M
# 查找超过800M大小文件,并显示文件信息
find . -type f -size +800M -print0 | xargs -0 ls -l
# 查找超过800M大小文件,并显示查找出来文件的具体大小
@shui
shui / 1.md
Created March 21, 2018 01:28
Shell改变当前目录

方法一

脚本cdDes.sh

#!/bin/bash
cd /des

因为直接执行脚本是在当前shell进程的子进程中执行,所以并不能改变目录。执行的时候使用source在当前进程执行:

source cdDes.sh
@shui
shui / 1.md
Last active August 16, 2018 18:50
Ubuntu 16安装XMind 8

安装XMind 8

下载安装包,解压。

删掉setup.sh中安装default-jre的操作(因为配置有JDK)。

XMind8不支持Java 9。

执行setup.sh安装依赖和字体。

@shui
shui / 1.md
Last active April 2, 2018 08:27
openssh-client使登录方式

密码

ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@host

openssh-client登陆服务器时,默认会依次尝试:

  • GSSAPI-based认证
  • host-based认证
  • public key认证
@shui
shui / 1.md
Last active April 2, 2018 04:55
缺氧地图种子

My:

Seed Description
575221208 右双水泉,左上天然气
1407967392 右近气左下贴脸水
826721296 左脸水泉下近气,家多植,13虫
646438903 五泉,左上脸两气一水,,右上一水,正下一气。
339090353
1075380404 左边是氯气和水泉 在左下 右边是两个天然气 都很近(除了水泉)
@shui
shui / 1.md
Created April 2, 2018 03:03
(Ubuntu 16) CapsLock -> Ctrl
@shui
shui / 1.md
Created April 2, 2018 08:12
Ubuntu:降低updatedb的频率

半夜硬盘狂转,多半是updatedb.mlocate引起的。

  • /etc/cron.d/mlocate移动到/etc/cron.monthly
  • 或者chmod -x /etc/cron.d/mlocate一劳永逸,需要的时候手动操作
@shui
shui / 1.md
Created May 10, 2018 02:20
Go生成随机合法IP
package main

import (
	"fmt"
	"math/rand"
	"time"
	"os"
)