This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from getpass import getpass | |
| try: | |
| import keyring | |
| def get_passwd(address, username): | |
| passwd = keyring.get_password(address, username) | |
| if passwd is None: | |
| passwd = getpass('Password for %s: ' % address) | |
| keyring.set_password(address, username, passwd) | |
| return passwd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # bash color prompt | |
| bash_prompt_command() { | |
| # How many characters of the $PWD should be kept | |
| local pwdmaxlen=25 | |
| # Indicate that there has been dir truncation | |
| local trunc_symbol=".." | |
| local dir=${PWD##*/} | |
| pwdmaxlen=$(( ( pwdmaxlen < ${#dir} ) ? ${#dir} : pwdmaxlen )) | |
| NEW_PWD=${PWD/#$HOME/\~} | |
| local pwdoffset=$(( ${#NEW_PWD} - pwdmaxlen )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #dates | |
| chalange3 = /^(1\d{3}|20(0\d|1[02]))\/(0[1-9]|1[0-2])\/(0[1-9]|[1-2]\d|30)\s([0-1]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/ |
NewerOlder