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

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 / 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 / pproc.py
Created July 23, 2020 23:38 — forked from bbengfort/pproc.py
Runs multiple subprocesses in parallel, serializing stdout.
#!/usr/bin/env python3
# pproc
# Runs multiple subprocesses in parallel, serializing stdout.
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Wed Jun 14 15:20:05 2017 -0400
#
# Copyright (C) 2017 Bengfort.com
# For license information, see LICENSE.txt
#
@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/'