This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For this script you'll need gcc, gzip make, qemu, tar, wget | |
# Learn more on my blog: https://labs.davlgd.fr/posts/2024-05-whats-a-minimal-linux/ | |
# Get and compile the kernel | |
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.8.8.tar.xz | |
tar xf linux-6.8.8.tar.xz | |
cd linux-6.8.8/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<unattend xmlns="urn:schemas-microsoft-com:unattend"> | |
<settings pass="windowsPE"> | |
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<SetupUILanguage> | |
<UILanguage>fr-FR</UILanguage> | |
</SetupUILanguage> | |
<SystemLocale>fr-FR</SystemLocale> | |
<UILanguage>fr-FR</UILanguage> | |
<UILanguageFallback>fr-FR</UILanguageFallback> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a quick Node.js 21.7.0 new features demo | |
// Update Node.js to 21.7.0 to run this code | |
// You can use nvm or Volta to sideload it | |
// Run this file with: node index.js | |
const { styleText } = require('node:util'); | |
const { parseEnv } = require('node:util'); | |
const { loadEnvFile } = require('node:process'); | |
const crypto = require('node:crypto'); | |
const fs = require('node:fs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! command -v ioping &> /dev/null; then | |
echo "Error: ioping is not installed." | |
exit 1 | |
fi | |
root_disk=$(df / | grep '/' | awk '{print $1}' | sed 's/[0-9]*//g') | |
disks=$(ls /dev/sd* | grep -E "/dev/sd[a-z]$" | grep -v "$root_disk") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module main | |
struct Directory { | |
name string | |
subs []Directory | |
files []string | |
} | |
// Prints the directory structure recursively | |
fn print_directory(dir Directory, level int) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# Script to install multiple applications in one command line through WinGet | |
You can modify bootstrapArray value and use "--bootstrap" argument to bootstrap a new machine | |
Don't forget to change ExecutionPolicy to execute this script | |
Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope CurrentUser #> | |
$bootstrapArray = @("vlc", "7zip", "cpu-z", "coretemp") | |
if ((New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) | |
{ | |
if ($args[0] -ne "--bootstrap") { $bootstrapArray = $args } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
spinner() { | |
local pid=$1 | |
local delay=0.1 | |
local spinstr="⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏" | |
local i=0 | |
local len=${#spinstr} | |
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do | |
i=$(( (i+1) % len )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
display_help() { | |
echo "Usage: $0 [option]" | |
echo | |
echo "This script retrieves and displays information about the system's CPU, motherboard, and memory through DMI Decode." | |
echo | |
echo "Options:" | |
echo " --help Display this help message and exit." | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import csv | |
import time | |
delay = 2 | |
csv_file = "pi_soc_results.csv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo .DS_Store >> ~/.gitignore_global | |
git config --global core.excludesfile ~/.gitignore_global |
NewerOlder