Skip to content

Instantly share code, notes, and snippets.

View PedroH183's full-sized avatar
♟️
Studying

Pedro Freires PedroH183

♟️
Studying
View GitHub Profile
@PedroH183
PedroH183 / Get-MgUserLicenseLogonReport.ps1
Created May 26, 2026 13:12 — forked from debold/Get-MgUserLicenseLogonReport.ps1
Quick Office 365 user export with license details and last logon
# Warning: PowerShell ternary operator (a ? b : c) in use. Needs PowerShell 7+!
# Install Microsoft Graph API module if not already there
# Install-Module Microsoft.Graph
# Need to select beta profile in order to get logon statistics
Select-MgProfile -Name "beta"
# You'll need auditlog read access for logon statistics
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All", "AuditLog.Read.All"
# Load SKU list
@PedroH183
PedroH183 / installJdkTarGzUbuntu.sh
Created July 23, 2024 21:47 — forked from filipelenfers/installJdkTarGzUbuntu.sh
Install JDK from tar.gz Ubuntu
#Login as root
sudo su
#create jdk directory
mkdir /opt/jdk
#uncompress, change to your file name
tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
#check if files are there
@PedroH183
PedroH183 / sqlalchemy_conftest.py
Last active January 24, 2024 15:04 — forked from kissgyorgy/sqlalchemy_conftest.py
Python: py.test fixture for SQLAlchemy test in a transaction, create tables only once with minimal data!
import pytest
from os import path, getcwd
from INSERT_PATH import get_db
from sqlalchemy.orm import Session
from myapp.models import BaseModel
from sqlalchemy import create_engine, text
BASE_DIR = getcwd()
@PedroH183
PedroH183 / alacritty.toml
Last active December 29, 2023 18:08 — forked from ritog/alacritty.toml
Example configuration file for Alacritty
# $HOME/.config/alacritty/alacritty.toml
# by Rito Ghosh 2023-10-06
# revised by Pedro Freires 2023-12-29
# Alacritty now uses TOML formatting for its config files.
# This is a simple example.
# There are the specification here: https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd
# It is not obvious how it translates to TOML. But it is extremely straightforward.