-
Reset to factory defaults
reset config bootstrap reset configThe username is
adminand the password isaerohive,Aerohive1, oradmin123.
The set lines
- These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
- With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
set -euxo pipefailis short for:
set -e
set -u
| # An example to get the remaining rate limit using the Github GraphQL API. | |
| import requests | |
| headers = {"Authorization": "Bearer YOUR API KEY"} | |
| def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section. | |
| request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers) | |
| if request.status_code == 200: |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
| func makeGetCall() { | |
| // Set up the URL request | |
| let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1" | |
| guard let url = URL(string: todoEndpoint) else { | |
| print("Error: cannot create URL") | |
| return | |
| } | |
| let urlRequest = URLRequest(url: url) | |
| // set up the session |
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # DUAL LICENSED: You are free to choose either or both of below licenses: | |
| # | |
| # 1. | |
| # | |
| # Published by zhuyifei1999 (https://wikitech.wikimedia.org/wiki/User:Zhuyifei1999) | |
| # under the terms of Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) | |
| # https://creativecommons.org/licenses/by-sa/3.0/ |
| ## content of: /etc/fail2ban/jail.local | |
| [mail-smtp] | |
| enabled = true | |
| logpath = /var/log/mail.log | |
| filter = mail-smtp | |
| maxretry = 1 | |
| action = iptables-multiport[name=mail-smtp, port="25,587", protocol=tcp] |
| # Add these lines | |
| batch | |
| passphrase-file <Full path to the key.txt file (without tilda)> |
| # In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
| # variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
| # in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
| # gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
| # Add the following to your shell init to set up gpg-agent automatically for every shell | |
| if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
| source ~/.gnupg/.gpg-agent-info | |
| export GPG_AGENT_INFO | |
| else |
This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI.
This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.
Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.
To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th