ssh-keygen -t rsaOnce you have entered the Gen Key command, you will get a few more questions:
| # Install K3s | |
| curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable=traefik" sh -s - | |
| # Setup K3s for Akash | |
| mkdir ~/.kube | |
| sudo cat /etc/rancher/k3s/k3s.yaml | tee ~/.kube/config >/dev/null | |
| kubectl get nodes | 
| {"swagger": "2.0", "basePath": "/api/v2", "paths": {"/bandwidth/device/{deviceId}": {"parameters": [{"required": true, "in": "path", "description": "ID of Device to View", "name": "deviceId", "type": "integer"}, {"default": "day", "required": true, "type": "string", "enum": ["day", "week", "month", "custom"], "in": "query", "description": "Preconfigured Time Periods for Graph Data", "name": "period"}, {"default": "eth0", "required": true, "type": "string", "enum": ["eth0", "eth1", "public", "private", "all"], "in": "query", "description": "Network Interface to use for Graph Data", "name": "interface"}, {"type": "boolean", "default": false, "in": "query", "description": "Include Historical Interface Data for Device for Resellers", "name": "historical"}, {"default": 300, "type": "integer", "required": true, "in": "query", "description": "Interval of Graph in Seconds", "name": "step"}, {"type": "integer", "default": 0, "in": "query", "description": "Start Time of Custom Time Period. (Unix Epoch Time)", "name": " | 
| #cloud-config | |
| users: | |
| - name: demo | |
| groups: sudo | |
| shell: /bin/bash | |
| sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
| ssh-authorized-keys: | |
| - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2u2uq+KrYHZz5xI2WPpBnYus477nGEWVfRPSVMoV0ESR3hDWg8ighZ/60Gm8aZ4t44ItfYICb7tGj8jgoodIHt+bSzgrIsWyH1mEBUnVJgQrOX5CuAmOvS6zIfXxPGsEBokvUvZ+8NYU5HTmID1GuPEPIYTNqufzrZpwVLIZ9Ad66y2/LI2GErT50T8DMZzKT2GuWAnsmx8CjkiXxHnX8Q12kMGynAQNih8vWzhAngXItLzPppHugZT7dOLhbSEFCoSbNlEF78Am30pHF08Xjb57FHkWrJ96K1/VDK6bkNfj06sWiKQ9eKtYc282cKeUFVvSnkdW0I5kjuCGjQIEAw== [email protected] | |
| runcmd: | |
| - touch /test.txt | 
| /* parser generated by jison 0.4.13 */ | |
| const Parser = { | |
| trace: function trace() { | |
| }, | |
| yy: {}, | |
| symbols_: { | |
| "error": 2, | |
| "expressions": 3, | |
| "e": 4, | |
| "EOF": 5, | 
| /* parser generated by jison 0.4.13 */ | |
| const Parser = { | |
| trace: function trace() { | |
| }, | |
| yy: {}, | |
| symbols_: { | |
| "error": 2, | |
| "expressions": 3, | |
| "e": 4, | |
| "EOF": 5, | 
| import json | |
| f = open("response_1583775904103.json", "r") | |
| file_data = f.read() | |
| f.close() | |
| bw_data = json.loads(file_data) | |
| out_total = 0 | |
| in_total = 0 | 
| # This is the code in core that adjusts option pricing for discounts | |
| @return_decimal | |
| def get_discount(self, option_price, discount_id): | |
| from core.api.store.carts.models import CartDiscount | |
| discount = CartDiscount.query.get(discount_id) | |
| return discount.calculate(option_price) if discount else 0 | |
| # This would be new code that adjust the price for the order. | |
| @return_decimal | 
| # Current logic for reserving a device by location: | |
| device = hapi.devices.get(server.device_id).json() | |
| device_location = device.get('location') | |
| if location == device_location: | |
| target = server | |
| # The new logic for reserving by option tags, then defaulting to location. | |
| if has_sps_location_tag: | |
| device = hapi.devices.get(server.device_id).json() | |
| tag = device.option.tag | 
| # init MYSQL | |
| mysql = MySQL() | |
| # Config MySQL | |
| app.config['MYSQL_HOST'] = 'localhost' | |
| app.config['MYSQL_USER'] = 'root' | |
| app.config['MYSQL_PASSWORD'] = '1234' | |
| app.config['MYSQL_DB'] = 'myflaskapp' | |
| app.config['MYSQL_CURSORCLASS'] = 'DictCursor' | |
| mysql.init_app(app) |