As configured in my dotfiles.
start new:
tmux
start new with session name:
| # Tutorial https://www.daimto.com/how-to-get-a-google-access-token-with-curl/ | |
| # YouTube video https://youtu.be/hBC_tVJIx5w | |
| # Client id from Google Developer console | |
| # Client Secret from Google Developer console | |
| # Scope this is a space seprated list of the scopes of access you are requesting. | |
| # Authorization link. Place this in a browser and copy the code that is returned after you accept the scopes. | |
| https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=[Scopes]&response_type=code | |
| # Exchange Authorization code for an access token and a refresh token. |
| SDCC = sdcc | |
| STM8FLASH = stm8flash | |
| STLINK=stlinkv2 | |
| CHIP = STM8S103 | |
| CHIP_TYPE = STM8S103F3 | |
| CHIP_TYPE_LCASE = $(shell echo $(CHIP_TYPE) | tr '[:upper:]' '[:lower:]') | |
| CFLAGS = -lstm8 -mstm8 -L./libsrc/build/ -l./libsrc/stm8s_stdlib.a -I./libsrc/inc -D$(CHIP) -DUSE_STDPERIPH_DRIVER |
| NAME := main | |
| HEX := $(NAME).hex | |
| OUT := $(NAME).out | |
| MAP := $(NAME).map | |
| SOURCES := $(wildcard *.c) | |
| HEADERS := $(wildcard *.h) | |
| OBJECTS := $(patsubst %.c,%.o,$(SOURCES)) | |
| MCU := atmega2560 | |
| MCU_AVRDUDE := m2560 |
| import gnupg | |
| gpg = gnupg.GPG() | |
| # cifrado simétrico | |
| vaca = gpg.encrypt("esto é unha proba", [], symmetric=True, passphrase='1234') | |
| print(vaca.data) | |
| # b'-----BEGIN PGP MESSAGE-----\n\njA0EBwMCPaDu/4KW8In40kYBvzWul1ccpl4+GP4YVZHv4ppEZ3JydNIKPQViMvhO\nIndNIr2/+3dKFqifBQdZQiAr4X3U3R0QKeWbi1XOcGecPoj5L90m\n=dHQ6\n-----END PGP MESSAGE-----\n' | |
| # descifrado | |
| boi = gpg.decrypt(vaca.data, passphrase='1234') |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| ###### | |
| ## Basic FreeBSD bridge for HP MicroServer and 4-port PCI-E NIC | |
| ## Details from dmesg: | |
| ## - <HP Ethernet 1Gb 2-port 332i Adapter, ASIC rev. 0x5720000> | |
| ## - <Intel(R) PRO/1000 Network Connection 7.6.1-k> | |
| set -e | |
| cat >> /boot/loader.conf <EOF | |
| ## Add network bridge support |
| import zmq | |
| from flask import Flask | |
| from threading import Thread | |
| HOST = '127.0.0.1' | |
| PORT = 9090 | |
| TASK_SOCKET = zmq.Context().socket(zmq.REQ) | |
| TASK_SOCKET.connect('tcp://{}:{}'.format(HOST, PORT)) | |
| app = Flask("app") |
You might want to read this to get an introduction to armel vs armhf.
If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.
First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux
| // DDRD (R/W) pin direction (0 = INPUT / 1 = OUTPUT) | |
| // PORTD (R/W) pin state (INPUT: 0 = LOW / 1 = HIGH | OUTPUT: 0 = PULL-UP DIACTIVATED / 1 = PULL-UP ACTIVATED) | |
| // PIND (R) pin state (INPUT ONLY: 0 = LOW / 1 = HIGH) | |
| // bit(n) // calculates value of n-th bit (returns: 0 / 1) | |
| // bitRead(byteName, n) // gets value of n-th bit of byte (returns: 0 / 1) | |
| // bitSet(byteName, n) // sets value of n-th bit of byte to 1 | |
| // bitClear(byteName, n) // sets value of n-th bit of byte to 0 | |
| // bitWrite(byteName, n, val) // sets value of n-th bit of byte to 0 or 1 |