Skip to content

Instantly share code, notes, and snippets.

@windsting
windsting / installtmux.sh
Last active August 29, 2015 14:25
Install tmux 1.8 on a fresh CentOS 6.4 machine
#!/bin/bash
wget http://downloads.sourceforge.net/tmux/tmux-1.8.tar.gz
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf tmux-1.8.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
yum install gcc kernel-devel make ncurses-devel -y
@windsting
windsting / lidaProjectDataSchema.md
Last active May 15, 2017 15:00
lida Project Data Schema

lida Project Data Schema

account(账户)

字段 类型 用途
id integer id
account_id string 用户名
nick_name string 昵称
dev_group integer 开发组
@windsting
windsting / NginxRedirectPort.md
Last active August 29, 2017 14:18
Nginx 端口转发配置

存一下,免得下次再花时间找了

  server {
    listen 80;  # 一般都是想转发到标准的80端口吧,不是的话,改一下
    server_name DOMAIN.NAME;  # 指向这个主机的域名
    location / {
      proxy_pass http://localhost:PORT; # PORT 是在本地监听的实际端口
      proxy_redirect default;
 }
@windsting
windsting / Mind_this_in_Vue.md
Last active June 3, 2017 10:09
Mind 'this' in Vue or anywhere

Here is the index.html

<!DOCTYPE html>
<html>
<head>
	<title>Laravel vue2-step-by-step 18</title>
	<!-- <link rel="stylesheet" href="./stylesheets/bulma.min.css" /> -->
	<style>
 body{ 
@windsting
windsting / undo_add_files_in_git.md
Last active July 15, 2017 06:25
Undo Add Files in Git
$ git commit -m "Something terribly misguided"              #(1)
$ git reset HEAD~                                           #(2)
#< edit files as necessary >>                               #(3)
$ git add ...                                               #(4)
$ git commit -c ORIG_HEAD                                   #(5)
  1. This is what you want to undo
@windsting
windsting / dotnet_run_with_custom_address_and_port_binding.md
Created July 5, 2017 07:12
dotnet run with custom address and port binding
# use address "*" and port "5000"
ASPNETCORE_ENVIRONMENT=Development ASPNETCORE_URLS="http://*:5000" dotnet run
@windsting
windsting / AddSudoUser.md
Last active July 23, 2017 04:46
Create Users and Manage Their Sudo Privileges on Ubuntu and CentOS

Create Users and Manage Their Sudo Privileges

To demonstrate, I use the newuser as user name

on Ubuntu

Add a new user with adduser

# adduser newuser
Adding user `newuser' ...
@windsting
windsting / KeyboardShortcutsForBash.md
Last active February 7, 2021 21:23
Keyboard Shortcuts for Bash

Bash is the default command-line shell on most Linux distributions, from Ubuntu and Debian to Red Hat and Fedora. Bash is also the default shell included with macOS, and you can install a Linux-based bash environment on Windows 10.

The bash shell features a wide variety of keyboard shortcuts you can use. These will work in bash on any operating system. Some of them may not work if you’re accessing bash remotely through an SSH or telnet session, depending on how you have your keys mapped.

Working With Processes

Use the following shortcuts to manage running processes.

@windsting
windsting / UsefulViKeyBindings.md
Last active August 15, 2017 07:36
Useful Vi Key Bindings

For beginners, may need to read getting started with vi first.

Navigate in :help

First, how to QUIT the "help page": :q<CR>, <CR> is the 'Enter' or 'Return' on the keyboard
To enter help page of vim, just input :help[ topic]<CR>, and [ topic] means something you wanna know about, wrap in [] means this portion can be omit, e.g. :help<CR> to enter start help page. Look out for the "space" before the "topic", means "if you wanna a topic, don't forget the 'space' before it", e.g. help about "tabe", should be :help tabe<CR>,

  • Ctrl-] follow the link under the cursor.
@windsting
windsting / mkcd
Created August 3, 2017 05:10 — forked from briansorahan/mkcd
bash alias for a 'mkcd' command which creates a dir and cd's into it
mkcd() { mkdir -p "$@" && cd "$@"; }