Linux 是多用户操作系统,每个用户登陆后都有属于自己的环境,定义着自己专有的变量值。同时 Linux 是基于文件,和 Windows 的注册表很不相同。
本文是基于 Ubuntu 所写,其它 Linux 系统设置其本雷同。2018/12/18 升级内容到 18.04 版本。
举例来说,在终端下,你输入一个命令,会出现 Command not found , 但系统中已经安装过该程序,只是不在标准位置,此时你只能通过全路径的方式来执行 /usr/local/app/bin/run,但每次输入很是繁琐,这时就可以通过添加该目录到系统环境变量 PATH 中来实现执行文件的查找。
通过上面的参数来看,PPI 上 200,且价格能接受的,就只有 LG 5K 了,本想去 HK 背个回来的,那边的价格才 7xxx,心动。去 Apple Store 看了下,感觉好差,整个屏很不清晰,应该是垃圾桶带不动 5K 的缘故吧,做工也不是很精致,最主要的是丑,丑的对不起价格。边上的 iMac 5K 就超清晰,可惜不支持 TDM。
或者 U2718Q 吧,除了 4K,不支持 Type-C,其它都好 -^_^-。
iPhone - 217 电池
终于约到了 Apple 的电池更换服务,周未去换了下,整个机器的性能、待机时间有着明显的提升。感觉 6s Plus 又可以再战两年。
The general HTTP authentication framework is used by several authentication schemes. Schemes can differ in security strength and in their availability in client or server software.
The most common authentication scheme is the “Basic” authentication scheme which is introduced in more details below. IANA maintains a list of authentication schemes, but there are other schemes offered by host services, such as Amazon AWS. Common authentication schemes include:
Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.”
The bearer token is a cryptic string, usually generated by the server in response to a login request. The client must send this token in the Authorization header when making requests to protected resources:
1
Authorization: Bearer <token>
The Bearer authentication scheme was originally created as part of OAuth 2.0 in RFC 6750, but is sometimes also used on its own.
但有时也会单独使用。
Similarly to Basic authentication, Bearer authentication should only be used over HTTPS (SSL).
Basic authentication is a simple authentication scheme built into the HTTP protocol. The client sends HTTP requests with the Authorization header that contains the word Basic word followed by a space and a base64-encoded string username:password. For example, to authorize as demo / p@55w0rd the client would send:
A security token with the property that any party in possession of the token (a “bearer”) can use the token in any way that any other party in possession of it can. Using a bearer token does not require a bearer to prove possession of cryptographic key material (proof-of-possession).
The Bearer Token or Refresh token is created for you by the Authentication server. When a user authenticates your application (client) the authentication server then goes and generates for you a Bearer Token (refresh token) which you can then use to get an Access Token.
The Bearer Token is normally some kind of secret value created by the authentication server. It isn’t random; it is created based upon the user giving you access and the client your application getting access.
In order to access an API for example you need to use an Access Token. Access tokens are short lived (around an hour). You use the bearer token to get a new Access token. To get an access token you send the Authentication server this bearer token along with your client id. This way the server knows that the application using the bearer token is the same application that the bearer token was created for. Example: I can’t just take a bearer token created for your application and use it with my application it wont work because it wasn’t generated for me.
Google Refresh token looks something like this: 1/mZ1edKKACtPAb7zGlwSzvs72PvhAbGmB8K1ZrGxpcNM
copied from comment: I don’t think there are any restrictions on the bearer tokens you supply. Only thing I can think of is that its nice to allow more then one. For example a user can authenticate the application up to 30 times and the old bearer tokens will still work. oh and if one hasn’t been used for say 6 months I would remove it from your system. It’s your authentication server that will have to generate them and validate them so how it’s formatted is up to you.
POST /oauth2/token HTTP/1.1 Host: auth.atlassian.io Accept: application/json Content-Length:{length of the request body} Content-Type: application/x-www-form-urlencoded grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&scope=READ+WRITE&assertion={your-signed-jwt}
HTTP/1.1200 OK Status:200 OK Content-Type: application/json; charset=utf-8 ... { "access_token":"{your access token}", "expires_in":{15 minutes expressed as seconds}, "token_type":"Bearer" }
Using an access token in a request
Set the Authorization header to Bearer {your access token} and make your request:
The authorization server MAY support any suitable HTTP authentication scheme matching its security requirements. When using other authentication methods, the authorization server MUST define a mapping between the client identifier (registration record) and authentication scheme.
JSON Web Token (JWT) is a compact URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is digitally signed using JSON Web Signature (JWS).
if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi
删除 pyenv
卸载很简单,直接删除 ~/.pyenv 目录即可。也要去掉 .zshrc 加入的语句。
▎安装使用 Python
查看可安装的版本
1
$ pyenv install --list
安装 python3 当前最新版本 3.6.4:
1 2 3 4 5 6 7
$ pyenv install 3.7.3
python-build: use openssl from homebrew python-build: use readline from homebrew Installing Python-3.7.3... python-build: use readline from homebrew Installed Python-3.7.3to /Users/lanvige/.pyenv/versions/3.7.3