Skip to content

Instantly share code, notes, and snippets.

View noelruault's full-sized avatar
💭
Let's Go into details.

Noël Ruault noelruault

💭
Let's Go into details.
View GitHub Profile
$excludedUsers = @("Admin", "Administrator")
Function Remove-LocalUser {
<#
.Synopsis
This function deletes a local user
.Description
This function deletes a local user
.Example
Remove-LocalUser -userName "ed"
## Remove Windows users script
# Initial excluded users list
$excludedUsers = @("Admin", "admin", "Administrator", "administrator", "Administrador", "administrador", "Invitado", "DefaultAccount", "WDAGUtilityAccount", "USER", "User", "user", "gaia", "Professorat", "Profesorado", "profesorado", "professor", "profesor", "professorat")
# Get existing local users
$localUsers = Get-WmiObject -Class Win32_UserAccount -Filter "LocalAccount='True'" | Select-Object -ExpandProperty Name
# Filter excluded users that are in the local users list
$defaultChoices = $excludedUsers | Where-Object { $localUsers -contains $_ }
@noelruault
noelruault / form.html
Created March 13, 2024 09:11
HTML Form debug setup
<!DOCTYPE html>
<html>
<body>
<form id="myForm" action="output.html" method="get">
<label for="method">Choose a method:</label>
<select id="method" name="method">
<option value="GET">GET</option>
<option value="POST">POST</option>
@noelruault
noelruault / font-encoder.sh
Last active February 2, 2024 20:23
Converting and rendering web fonts to CSS (base64)
#!/bin/bash
# Converting and rendering web fonts to its base64 @font-face variant
# Also posted on StackOverflow! https://stackoverflow.com/a/77929643/4349318
# Initialize a variable to hold all @font-face codes
all_font_face_codes=""
FONT_DIR="."
OUTPUT_DIR="./css"
@noelruault
noelruault / resize-images.sh
Last active October 5, 2023 08:20
Script that resizes jpg images to a desired pixel ratio
#!/bin/bash
supported_resolutions=("144" "240" "360" "480" "720" "1024") # Supported resolutions
supported_extensions=("png" "jpg" "jpeg") # Supported image file extensions
selected_output_directory=""
# default_output_directory="img"
selected_resolution=""
while [[ $# -gt 0 ]]; do
@noelruault
noelruault / wipedisk.sh
Last active August 24, 2023 08:26
Script that helps to erase a disk content using `hdparm` and then copies a designated source disk (or `/dev/null`) into a specified target disk.
#!/bin/bash
#================================================================
# HEADER
#================================================================
#% SYNOPSIS
#+ ${SCRIPT_NAME} [-hv] args ...
#%
#% DESCRIPTION
#% This is a script that erases a disk and then copies a designated source disk into an specified target disk.
#% You can run it in one line when connected to the internet like this:
@noelruault
noelruault / macos-developer-verification.md
Created September 29, 2022 09:03
Resolve MacOS "cannot be opened because the developer cannot be verified" error
  1. Run the binary. You should see Killed: 9 as output in the terminal.
  2. Once the error happens, open the "Security & Privacy" control panel from System Preferences.
  3. The Security & Privacy panel, General tab is updated with the info that the binary was prevented from running. Click Allow Anyway.
  4. Run the binary again. This time a different prompt is shown. Click Open - the binary should run as you expect.
package main
import (
"log"
"net/http"
"os"
)
const webSiteURL = "http://www.example.com/index.html"
@noelruault
noelruault / resume.md
Last active July 24, 2023 11:04
Noël Ruault's résumé.

noel-ruault-resume