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 / 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.

Scripts to setup jumpserver in CentOS7.

Usage

After clone this repository, run the following command to deploy jumpserver:

bash setup.sh

Check log file if some errors happen when runing the command above:

@noslin005
noslin005 / sgdisk.md
Last active August 24, 2021 13:04
Create partition with sgdisk

Create Partition Legacy Boot

sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda
sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda
sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda
sgdisk -n 0:0:+50GiB -t 0:8300 -c 0:root /dev/sda
sgdisk -n 0:0:0 -t 0:8300 -c 0:home /dev/sda

Create EFI BOOT Partition Scheme

@noslin005
noslin005 / ofed-ubuntu.sh
Created June 23, 2021 12:31
Install Mellanox Ofed on Ubuntu Machines
#!/bin/bash
# ofed-ubuntu.sh
# Install Mellanox Ofed on Ubuntu Machines
#
# Author: Nilson Lopes (06/17/2021)
ubuntu_release=$(awk -F '"' '/VERSION_ID/ {print $2}' /etc/os-release)
mofed_package_version='latest'
mofed_repo_base_url="https://linux.mellanox.com/public/repo/mlnx_ofed"
@noslin005
noslin005 / build.sh
Created March 18, 2021 15:32 — forked from Forst/build.sh
Ubuntu ISO with preseed.cfg generation script
#!/bin/bash
## FORSTWOOF UBUNTU PRESEED :: BUILD SCRIPT
# Quit on first error
set -e
# Temporary directory for the build
TMP="/var/tmp/ubuntu-build"
@noslin005
noslin005 / mcx-connect6.diff
Created November 5, 2020 15:55
Patch to fix the issue with Mellanox ConnectX-6 on OpenBSD 6.8
--- if_mcx.c Thu Nov 5 09:48:26 2020
+++ /usr/src/sys/dev/pci/if_mcx.c Thu Nov 5 09:39:32 2020
@@ -839,6 +839,7 @@
#define MCX_CAP_DEVICE_PORT_MODULE_EVENT \
0x80
#define MCX_CAP_DEVICE_PORT_TYPE 0x03
+#define MCX_CAP_DEVICE_PORT_TYPE_ETH 0x01
uint8_t num_ports;
uint8_t snapshot_log_max_msg;
@noslin005
noslin005 / INACCESSIBLE_BOOT_DEVICE.md
Last active April 11, 2023 17:35
Windows Server 2019 VROC NVMe RAID 1 INACCESSIBLE_BOOT_DEVICE blue screen BSOD Supermicro

If the INACCESSIBLE_BOOT_DEVICE blue screen error is displayed due to other operations, perform the following procedure:

A - Prepare USB with Drivers

  1. You'll need a USB drive formatted as FAT32

  2. Create a folder in the USB, named drivers or any other name easy to remember.

  3. Download Intel VROC driver from Supermicro https://www.supermicro.com/wftp/driver/VROC/

@noslin005
noslin005 / HP V1910-16G.md
Created September 4, 2020 19:53
Initial configure HP V1910-16G

Password: 512900 or Jinhua1920unauthorized

<HP 1920G Switch>_cmdline-mode on

[HP 1920G Switch] ipsetup ip-address 192.168.1.2 24 default-gateway 192.168.1.1

[HP 1920G Switch] save

[HP 1920G Switch] reboot
@noslin005
noslin005 / ipmitool.py
Created August 24, 2020 15:20
subprocess ipmitool.py
def ____run(self, command):
procs = {}
for node in self.nodes:
ip = node['ip']
user = node['user']
password = node['password']
cmd = f'ipmitool -H {ip} -U {user} -P {password} {command}'
procs[ip] = subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE,
@noslin005
noslin005 / Redfish cheat sheet.md
Created August 21, 2020 03:29
Redfish cheat sheet

Redfish cheat sheet

This document is intended to provide a set of [Redfish][1] client commands for OpenBMC usage. (Using CURL commands)

Query Root

$ export bmc=xx.xx.xx.xx
$ curl -b cjar -k https://${bmc}/redfish/v1