Skip to content

Instantly share code, notes, and snippets.

View noslin005's full-sized avatar

Nilson Lopes noslin005

  • Source Code Corp.
  • United States of America
View GitHub Profile
@noslin005
noslin005 / sample_script.sh
Last active November 26, 2024 16:59
Sample bash script
#!/usr/bin/env bash
################################################################################
## File: script.sh
## Desc: Sample bash argument processing
## Author: Nilson Lopes <[email protected]>
################################################################################
set -o nounset
@noslin005
noslin005 / ansible_check_system.yml
Created December 23, 2023 03:12
Ansible playbook to check system components firmwares
---
- name: System Hardware and Configuration Check
hosts: grml
gather_facts: true # Enable this
vars:
cpu:
model: AMD EPYC 9554 64-Core Processor
threads: 128
memory:
total_mb: 386442
@noslin005
noslin005 / bootstrap.ipxe
Created September 20, 2023 14:57
iPXE bootstrap script based on client platform (efi, pcbios) and architecture (arm64, x86_64, i386).
#!ipxe
# Global variables used by other iPXE scripts
chain --autofree vars.ipxe ||
# First try to load a specifix boot script based on the client MAC address
# Boot <boot-url>/<boot-path>/mac-010203040506.ipxe if script is present
chain --replace --autofree ${ipxe_boot_path}mac-${mac:hexraw}.ipxe ||
# Loads ipxe boot script based client platform and architecture
@noslin005
noslin005 / gigabyte_gsmcli_multi.py
Last active September 19, 2024 01:54
Perform the BIOS/BMC update on multiple Gigabyte nodes using GbUtility.
#!/usr/bin/env python3
import argparse
import multiprocessing
import os
import shutil
import subprocess
__author__ = 'Nilson Lopes <[email protected]>'
@noslin005
noslin005 / example-cli-argparse.py
Created March 16, 2023 20:21 — forked from tomschr/example-cli-argparse.py
Template for an example CLI program with argparse, docopts and logging
#!/usr/bin/env python3
import argparse
import logging
from logging.config import dictConfig
import sys
__version__ = "0.2.0"
__author__ = "Tux Penguin <[email protected]>"
@noslin005
noslin005 / ipxe.sh
Created January 13, 2023 19:52 — forked from robinsmidsrod/ipxe.sh
Bash functions for building iPXE in different ways
#!/bin/bash
make_ipxe() {
pushd "$HOME/src/forked/ipxe/src" >/dev/null &&
make CONFIG=chain bin/undionly.kpxe bin/ipxe.lkrn bin/ipxe.pxe bin/ipxe.usb &&
sudo install -v -m 0644 -g root -o root bin/undionly.kpxe /srv/salt/tftpd/files/undionly.kpxe &&
sudo install -v -m 0644 -g root -o root bin/ipxe.lkrn /srv/salt/tftpd/files/ipxe.lkrn &&
sudo install -v -m 0644 -g root -o root bin/ipxe.pxe /srv/salt/tftpd/files/ipxe.pxe &&
sudo salt-call -l quiet state.single file.recurse name=/srv/tftp source=salt://tftpd/files dir_mode=755 file_mode=644 &&
popd >/dev/null
@noslin005
noslin005 / install_latest_grml-live_debian_11.md
Created October 12, 2022 13:25
Download, Pack and Install latest grml-live on Debian 11

1. Install packages needed to build grml-live .deb

user@localhost$  apt-get --no-install-recommends install \
  build-essential \
  devscripts \
  fakeroot \
  asciidoc \
  docbook-xsl \
  xsltproc \
@noslin005
noslin005 / ipxe_build.md
Created April 3, 2022 22:00 — forked from rikka0w0/ipxe_build.md
Build IPXE

1. Install tools and config IPXE

# Install compiler and dependencies
sudo apt-get install -y git gcc make liblzma-dev

# Grab the source code
git clone https://github.com/ipxe/ipxe.git
cd ipxe/src

# Enable NFS support

Linuxでfioを使用して簡易ディスクベンチマーク!

LinuxでもCrystalDiskMarkぽいディスクベンチマークしたい】に触発されてCrystalDiskMarkの各バージョンのデフォルト値でのベンチマークパラメータをfioで再現してみました。 是非お使いください。

使い方

コマンド一例:

@noslin005
noslin005 / bash.py
Created October 20, 2021 03:00 — forked from kirpit/bash.py
Enables to run subprocess commands in a different thread with TIMEOUT option!
#! /usr/bin/env python
import threading
import subprocess
import traceback
import shlex
class Command(object):
"""
Enables to run subprocess commands in a different thread with TIMEOUT option.