Skip to content

Instantly share code, notes, and snippets.

View andermoran's full-sized avatar

Ander Moran andermoran

  • Microsoft
View GitHub Profile
@andermoran
andermoran / Omni.cpp
Last active October 25, 2019 14:51
All knowing artificial intelligence ;)
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
const char BACKSPACE_KEY = 127;
const char RETURN_KEY = 10;
@andermoran
andermoran / asm.sh
Last active February 12, 2020 21:08
Application Service Manager: a script that allows you to change an application's access to services (such as microphone, camera, etc)
#!/bin/bash
usage="usage: ./$(basename "$0") -s service [-d] [-m] [-c] app_name
where:
app_name: the name of the app
-s service: the service to change
-d disables the service (only put this option if you want to disable access)
-m sets the microphone as the service
-c sets the camera as the service
extra help:
@andermoran
andermoran / changeMacBrightness.m
Last active August 30, 2023 05:23
Programmatically read and change the brightness on macOS
#import <Foundation/Foundation.h>
#import <IOKit/IOKitLib.h>
#import <IOKit/graphics/IOGraphicsLib.h>
// this helped me out a lot <3: https://stackoverflow.com/questions/3239749/programmatically-change-mac-display-brightness
int main(int argc, char *argv[]) {
io_iterator_t iterator;
kern_return_t result = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IODisplayConnect"), &iterator);
@andermoran
andermoran / entra_admin_assistant_main.py
Last active March 14, 2024 02:29
entra_admin_assistant_main
import sys
import json
import subprocess
import secrets
import re
import requests
import base64
import os
from pyperclip import copy
# Helpers