As configured in my dotfiles.
start new:
tmux
start new with session name:
# https://docs.gitlab.com/ee/api/projects.html | |
# https://docs.gitlab.com/ee/api/issues.html | |
# https://docs.gitlab.com/ee/api/notes.html | |
# Project List | |
$r = Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'='xxxxx' } -Uri http://xxxxx/api/v4/projects/ | |
$r | Sort-Object -Property id | Format-Table -Property id, name | |
# Issues List | |
$r = Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'='xxxxx' } -Uri http://xxxxx/api/v4/projects/<xx>/issues |
#!/usr/bin/perl | |
use strict; | |
use IO::Socket; | |
################################################################ | |
# Prueba perl de botIRC # | |
# Objetivo del proyecto aprender manejo de perl con algunas # | |
# de sus funciones y sobre todo sockets xD... # | |
# # |
# -*- coding: utf-8 -*- | |
import socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
HOST = '' #irc server | |
PORT = 6665 #port | |
NICK = 'pony_bot' | |
USERNAME = 'megadeath' | |
REALNAME = 'little pony' |
/* | |
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: