As configured in my dotfiles.
start new:
tmux
start new with session name:
| /* | |
| Exemplo de servidor de eco asíncrono | |
| */ | |
| use tokio::io::{AsyncReadExt, AsyncWriteExt}; | |
| use tokio::net::{TcpListener, TcpStream}; | |
| use std::{env, io}; | |
| #[tokio::main] | |
| async fn main() -> io::Result<()> { |
| <?php | |
| $end_point = 'https://accounts.google.com/o/oauth2/v2/auth'; | |
| $client_id = 'YOUR_ID'; | |
| $client_secret = 'YOUR_SECRET'; | |
| $redirect_uri = 'http://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]'; // http://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] or urn:ietf:wg:oauth:2.0:oob | |
| $scope = 'https://www.googleapis.com/auth/drive.metadata.readonly'; | |
| $authUrl = $end_point.'?'.http_build_query([ |
| # 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") |