Skip to content

Instantly share code, notes, and snippets.

Avatar
🤣
laugh cry

Guo Li iguoli

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

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

$ htop
@iguoli
iguoli / .bashrc
Last active Sep 18, 2018
bashrc and aliases settings
View .bashrc
# 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 Jul 17, 2018
Vagrant虚拟机访问主机端口
View vagrant_ssh.md
$ 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 Jul 17, 2018
Linux下安装Ruby
View ruby-installation.md

Linux下安装Ruby

Install rbenv

# 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 Jul 13, 2018
配置proxy auto-config服务器
View pac_server.md
$ 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
View learn_chef.md

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 Sep 12, 2018
vagrant setting, Vagrantfile
View 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"
View os_release.md

Ubuntu

lsb_release
hostnamectl

Redhat or Centos

hostnamectl
cat /etc/issue
@iguoli
iguoli / vim_win_x64.md
Last active Jul 5, 2018
Windows下安装Vim x64
View vim_win_x64.md

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 Jul 5, 2018
Linux新装系统环境配置
View new-linux.md

新装系统环境配置

安装系统常用开发工具

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