Skip to content

Instantly share code, notes, and snippets.

View able8's full-sized avatar

Able Lv able8

View GitHub Profile
1, 插入空行
新发现一个命令, 使用点(.)重复上一个命令,如果是编辑代码或其他文本,需要插入很多空行,
可以这样子:先用o打开一个空行,然后ESC,接着就可以用.来操作了。每一次点.会在当前行的下面打开一个空行,并且不会进入编辑模式。
2,
ddp 交换光标所在行和其下紧邻的一行。
3,
d$ 删除当前字符之后的所有字符(本行)
@dropmeaword
dropmeaword / browser_history.md
Last active June 17, 2025 01:38
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@AntoineAugusti
AntoineAugusti / limitConcurrentGoroutines.go
Last active July 30, 2024 17:58
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active August 1, 2025 07:18 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

import json
from requests_oauthlib import OAuth2
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from oauthlib.oauth2 import TokenExpiredError
import pandas as pd
class AWhereCall(object):
"""Use this joint to get you some weather data"""
@jgermade
jgermade / alias.sh
Last active July 11, 2022 01:36
sh
alias ll='ls -alF'
alias l='ls -alF'
alias c='clear'
alias .='echo $PWD'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
@m4ce
m4ce / iptables
Created April 7, 2016 09:28
Transparent proxy with Squid and IPTables
# Rules for transparent proxying
iptables -N NO_PROXY -t nat
iptables -A NO_PROXY -t nat -d 0.0.0.0/8 -j ACCEPT
iptables -A NO_PROXY -t nat -d 10.0.0.0/8 -j ACCEPT
iptables -A NO_PROXY -t nat -d 127.0.0.0/8 -j ACCEPT
iptables -A NO_PROXY -t nat -d 169.254.0.0/16 -j ACCEPT
iptables -A NO_PROXY -t nat -d 172.16.0.0/12 -j ACCEPT
iptables -A NO_PROXY -t nat -d 192.168.0.0/16 -j ACCEPT
iptables -A NO_PROXY -t nat -d 224.0.0.0/4 -j ACCEPT
iptables -A NO_PROXY -t nat -d 240.0.0.0/4 -j ACCEPT
@hollodotme
hollodotme / Install-nginx-with-http2-support.md
Created April 9, 2016 17:07
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common
@nitrocode
nitrocode / upload-file-rest-endpoint-requests.py
Last active December 5, 2017 03:58
Uploads file with a rest end point using python's request module
#!/usr/bin/env python
import requests
import os
def upload_file(url, file_loc, cookies=None, headers=None,
file_type='application/vnd.ms-excel'):
"""Upload a file using an end point using requests posting of
a multipart encoded file
@gardner
gardner / monitor.sh
Created July 5, 2016 01:48
monitor url with curl
#!/bin/bash
# This creates a CSV file that can be uploaded to Google Docs where you can insert a chart to graph the values
LOG_FILE=/var/log/url_monitor.log
if [ ! -f $LOG_FILE ]; then # add CSV column headers
echo Date,Total Time,Redirect Time,DNS Lookup,Connect,App Connect,Pretransfer,starttransfer,Status Code > $LOG_FILE
fi