Skip to content

Instantly share code, notes, and snippets.

View iguoli's full-sized avatar
🤣
laugh cry

Guo Li iguoli

🤣
laugh cry
View GitHub Profile
@iguoli
iguoli / cpu.md
Created August 1, 2018 05:14
Linux下查看CPU数量及使用率
$ lscpu

$ top
按1会显示所有cpu信息

$ htop
@iguoli
iguoli / .bashrc
Last active September 18, 2018 09:43
bashrc and aliases settings
# proxy
alias goproxy="export all_proxy=socks5://127.0.0.1:1080; export http_proxy=socks5://127.0.0.1:1080; export https_proxy=socks5://127.0.0.1:1080; export no_proxy=127.0.0.1"
alias noproxy="unset all_proxy http_proxy https_proxy no_proxy"
# git
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
@iguoli
iguoli / vagrant_ssh.md
Last active July 17, 2018 14:22
Vagrant虚拟机访问主机端口
$ vagrant ssh -- -R 1080:localhost:1080

This follows the ssh option syntax -R [bind_address:]port:host:hostport, where the first number is the port number to listen on inside the guest machine, and the last two are the service address as visible from the host machine

@iguoli
iguoli / ruby-installation.md
Last active July 17, 2018 06:44
Linux下安装Ruby

Linux下安装Ruby

# Clone rbenv into ~/.rbenv
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv

# Optionally, try to compile dynamic bash extension to speed up rbenv. Don't worry if it fails; rbenv will still work normally
$ cd ~/.rbenv && src/configure && make -C src

# Add ~/.rbenv/bin to your $PATH
@iguoli
iguoli / pac_server.md
Last active July 13, 2018 11:37
配置proxy auto-config服务器
$ vim /etc/nginx/mime.types
application/x-ns-proxy-autoconfig  pac;
application/x-ns-proxy-autoconfig  dat;
application/x-ns-proxy-autoconfig  da;

$ cd /usr/share/nginx/html
$ ln -s autoproxy.pac wpad.dat
$ ln -s autoproxy.pac wpad.da
@iguoli
iguoli / learn_chef.md
Last active July 30, 2018 06:21
Learn Chef

Manage a node with chef server

I. Setup your workstation

1-1. Create a working directory

$ mkdir ~/chef-repo

II. Get up with hosted Chef

  • Chef server acts as a central repository for your cookbooks as well as for information about every node it manages.
  • You author Chef cookbooks and administer the Chef server from your workstation.
  • The knife command enables you to communicate with the Chef server from your workstation.
@iguoli
iguoli / Vagrantfile
Last active September 12, 2018 14:14
vagrant setting, Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "private_network", ip: "192.168.1.10"
config.vm.network "private_network", type: "dhcp", name: "VirtualBox Host-Only Ethernet Adapter"
@iguoli
iguoli / os_release.md
Last active September 3, 2018 03:53
OS Release

Ubuntu

lsb_release
hostnamectl

Redhat or Centos

hostnamectl
cat /etc/issue
@iguoli
iguoli / vim_win_x64.md
Last active July 5, 2018 08:15
Windows下安装Vim x64

Windows下安装Vim x64

  1. 从下面两个地址选一个下载vim x64的zip包
  1. 创建文件夹C:\Program Files\Vim\vimxx(xx为vim版本,如8.1版本就是vim81),将解压的文件复制到该文件夹

  2. 使用管理员运行cmd命令,进入该目录,执行install.exe命令。

  3. 如果鼠标右键没有"Edit with Vim"菜单,检查C:\Program Files\Vim\vimxx目录下是否有GvimExt文件夹,将其重命名为GvimExt64,然后重新执行第3步操作。

@iguoli
iguoli / new-linux.md
Last active July 5, 2018 09:32
Linux新装系统环境配置

新装系统环境配置

安装系统常用开发工具

  • Ubuntu:
$ sudo apt install -y build-essential
  • Redhat:
$ sudo yum groupinstall "Development Tools"