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 / mdraid_fix.sh
Created February 4, 2020 01:44
Fix mdadm RAID after OS Reinstall
# reassemble the raid
sudo mdadm --assemble --scan
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf
# Rebuild kernel to include the raid configuration
sudo dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
# Remake the file system
sudo sfdik --delete /dev/md0
@noslin005
noslin005 / rhel7.ks
Last active January 31, 2020 23:47
RedHat 7 KS
#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sde
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
@noslin005
noslin005 / raid.cfg
Created January 7, 2020 03:36
Debian RAID 1 Legacy Boot
# The method should be set to "raid".
d-i partman-auto/method string raid
# Specify the disks to be partitioned. They will all get the same layout,
# so this will only work if the disks are the same size.
d-i partman-auto/disk string /dev/sda /dev/sdb
# Next you need to specify the physical partitions that will be used.
d-i partman-auto/expert_recipe string \
@noslin005
noslin005 / selinux.md
Last active January 27, 2022 14:43
SELinux

SELinux

Controll the folder access by applications

Commands

  • getenforce
  • sestatus

Generate the Log Messages /var/log/audit/audit.log

  1. Set SELinux to permissive
@noslin005
noslin005 / esxi.md
Last active January 6, 2022 13:08
Update ESXi
esxcli network firewall ruleset set -e true -r httpClient
vim-cmd /hostsvc/maintenance_mode_enter
# esxi 6
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.7.0-20200604001-standard

# esxi 7.u2
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-7.0U2a-17867351-standard

vim-cmd /hostsvc/maintenance_mode_exit
@noslin005
noslin005 / grub.cfg
Created January 3, 2020 17:54
Grub Multiboot ISO
insmod tga
insmod png
insmod gfxterm
insmod lspci
insmod vbe
insmod ntfs
insmod chain
insmod biosdisk
insmod font
#GRUB_HIDDEN_TIMEOUT=10 #0 par defaut
#!/usr/bin/env python3
import json
import warnings
from collections import namedtuple
import requests
import os
warnings.filterwarnings("ignore")
URL = {
@noslin005
noslin005 / sysinfo.sh
Created November 22, 2019 05:49
system information inxi
sudo apt install freeipmi-tools \
ipmitool \
smartmontools \
lm-sensors \
tree \
hddtemp \
wmctrl \
lsscsi
sudo inxi --memory \
@noslin005
noslin005 / Debian.cfg
Created October 18, 2019 05:51
Debian Preseed Configuration
#_preseed_V1
## <owner> <question name> <question type> <value>
## Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
## Clock and Timezone
d-i clock-setup/utc boolean true
@noslin005
noslin005 / gist:d6627e0563034a06599b87a95f66e189
Created August 22, 2019 20:19 — forked from phillipsm/gist:0ed98b2585f0ada5a769
Example of parsing a table using BeautifulSoup and requests in Python
import requests
from bs4 import BeautifulSoup
# We've now imported the two packages that will do the heavy lifting
# for us, reqeusts and BeautifulSoup
# Let's put the URL of the page we want to scrape in a variable
# so that our code down below can be a little cleaner
url_to_scrape = 'http://apps2.polkcountyiowa.gov/inmatesontheweb/'