There are several ways to clone a repository from github. Similar from other providers, such as bitbucket, gitlab, etc.
https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
Mostly, we use
- http
- ssh
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import json | |
import urllib.request | |
with open('webapp.json', encoding='utf-8') as f: | |
config = json.loads(f.read()) | |
URLS = [ | |
'http://localhost:%d/?ident=%d' % (config['port'], ident) | |
for ident in range(1, 1001) |
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
There are several ways to clone a repository from github. Similar from other providers, such as bitbucket, gitlab, etc.
https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
Mostly, we use
# coding: utf-8 | |
import select | |
import socket | |
import queue | |
def select_demo(): | |
server = socket.socket() | |
server.bind(('127.0.0.1', 9000)) | |
server.listen(5) |
Generally, the Git proxy configuration depends on the Git Server Protocol you use. And there're two common protocols: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080
. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.
When you do git clone ssh://[user@]server/project.git
or git clone [user@]server:project.git
, you're using the SSH protocol. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config
:
ProxyCommand nc -x localhost:1080 %h %p
// https://chromium.googlesource.com/chromium/blink/+/master/Source/core/css/html.css | |
/* | |
* The default style sheet used to render HTML. | |
* | |
* Copyright (C) 2000 Lars Knoll ([email protected]) | |
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Library General Public |
win-bash
I have one computer and two different github accounts. One is for work, the other is for my personal stuff. I can't use the same ssh key twice, so I have to use different ssh key for each of my accounts. How do I do that? How do I switch between these ssh keys?
var GB2260 = { | |
"110000": "北京市", | |
"110100": "北京市市辖区", | |
"110101": "北京市东城区", | |
"110102": "北京市西城区", | |
"110103": "北京市崇文区", | |
"110104": "北京市宣武区", | |
"110105": "北京市朝阳区", | |
"110106": "北京市丰台区", | |
"110107": "北京市石景山区", |
import android.support.annotation.Nullable; | |
import android.util.Base64; | |
import java.nio.ByteBuffer; | |
import java.security.SecureRandom; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; |
<?php | |
// refer: http://hustnaive.github.io/php/2015/08/21/php-detect-encoding.html | |
/** | |
* 检测字符串编码(注意:存在误判的可能性,降低误判的几率的唯一方式是给出尽可能多的样本$line) | |
* 检测原理:对给定的字符串的每一个字节进行判断,如果误差与gb18030在指定误差内,则判定为gb18030;与utf-8在指定误差范围内,则判定为utf-8;否则判定为utf-16 | |
* @param string $line | |
* @return string 中文字符集,返回gb18030(兼容gbk,gb2312,ascii);西文字符集,返回utf-8(兼容ascii);其他,返回utf-16(双字节unicode) | |
* @author fangl |