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
slack-vm1:
default_gateway: 192.168.1.1
interfaces:
- name: eth0
addresses:
- 192.168.1.21/24
vlan: 100 # VLAN tag for an access port
- name: eth2
addresses:
- 10.12.0.10/16

Adjust Resolution

export DISPLAY=:1 
xrandr -q
xrandr --newmode "1920x1080"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual-1 1920x1080
xrandr --output Virtual-1 --mode 1920x1080
@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 <nlopes@sourcecode.com>
################################################################################
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 <noslin005@gmail.com>'
@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 <tux@example.net>"
@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 \