Skip to content

Instantly share code, notes, and snippets.

Running On My Way

Larry Liu g10guang

Running On My Way
Block or report user

Report or block g10guang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

show diff between edit file and disk file

:w !diff % -
g10guang / Frequency linux
Last active Feb 14, 2019
Frequency linux command
View Frequency linux

find command with exclude

find -name "*.js" -not -path "./directory/*" -not -path "*thrift_gen/*"

remove duplicate column:

awk '!seen[$0]++' filename
g10guang /
Last active Jan 6, 2019
Python unix time and strftime convert
import time
from datetime import datetime
import pytz

In [14]: t = datetime.fromtimestamp(1546751128, pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S')
In [15]: t
Out[15]: '2019-01-06 13:05:28'
g10guang /
Last active Aug 20, 2018
Python3 HTTP/1.1 multithread server
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
class Handler(BaseHTTPRequestHandler):
protocol_version = 'HTTP/1.1'
def do_GET(self):
rsp = b'GET'
self.send_header('Content-Length', len(rsp))
g10guang / curl_check_ssl_version.cpp
Created Aug 14, 2018
Check ssl version libcurl use.
View curl_check_ssl_version.cpp
#include <iostream>
#include "curl/curl.h"
int main() {
curl_version_info_data* ver = curl_version_info(CURLVERSION_NOW);
std::cout << ver->ssl_version << std::endl;
return 0;
g10guang /
Created Apr 27, 2018
My Filco keyboard shell script to remap the key.
setxkbmap -option caps:none
xmodmap -e "keycode 66 = End NoSymbol End NoSymbol End"
xmodmap -e "keycode 112 = BackSpace BackSpace BackSpace BackSpace"
You can’t perform that action at this time.