Skip to content

Instantly share code, notes, and snippets.

View jb-alvarado's full-sized avatar
💭
I may be slow to respond.

jb-alvarado

💭
I may be slow to respond.
View GitHub Profile

Install CentOS 8.2 on IBM x3650 M3

  1. prepare 2 USB sticks
  • first with Centos 8.2 minimal
  • second with correct version of dd-megaraid_sas driver from elrepo.org
  • the USB stick for the megaraid driver should have the lable OEMDRV, other while the drive is not recognize
  1. plug both USB sticks on server and boot
  2. go with F12 in boot menu and select USB device
  3. go truth the steps from CentOS install process
@jb-alvarado
jb-alvarado / urlify.js
Created June 30, 2021 13:15
Find URLs in text and create links out of it.
function urlify(text) {
const hyperlink = /<a [^>]+>([\w\d./=:"-]+)<\/a>/g
const urlRegex = /(https?:\/\/|www\.)([\w\d./-]+)/g
return text.replace(/(?:\r\n|\r|\n)/g, '<br>')
.replace(hyperlink, '$1')
.replace(urlRegex, (url, protoOrSub, domain) => {
domain = domain.replace(/\/$/, '')
if (protoOrSub.match(/https?/)) {
@jb-alvarado
jb-alvarado / edge.conf
Created September 29, 2020 10:10
HLS - Origin / Edge Cache
proxy_cache_path /mnt/ramdisk/cache_temp use_temp_path=off keys_zone=cache_temp:10m max_size=1536m inactive=1h;
server {
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/edge.example.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/edge.example.org/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
server_name edge.example.org;
#!/bin/bash
# nano syntax highlighting
cat <<EOT > /usr/share/nano/config.nanorc
# config file highlighting
syntax "conf" "(\.(bashrc|zshrc|conf|config|cfg|cnf|cf|rc|lst|list|defs|ini|desktop|mime|types|preset|cache|seat|service|htaccess)$|(^|/)(\w*crontab|mirrorlist|group|hosts|passwd|rpc|netconfig|shadow|fstab|inittab|inputrc|protocols|sudoers)$|conf.d/|.config/)"
# default text
color magenta "^.*$"
@jb-alvarado
jb-alvarado / build.sh
Created January 7, 2019 15:33
build gst-plugin-bad example playout.c
#/bin/bash
rm -rf *.o playout
rm -rf "./deps/*"
mkdir -p ".deps"
system=$( uname -s )
if [[ "$system" == "Darwin" ]]; then
_libtool="glibtool"
@jb-alvarado
jb-alvarado / disable-plugins-in-development.php
Last active June 14, 2018 12:03
Disable specified WordPress plugins in your development environment. Useful for plugins that either make network calls you don't want when working (eg, auto-posting to Facebook), or for plugins that rely on services only available in production (eg, Varnish).
<?php
/**
* Disable specified plugins in your development environment.
*
* This is a "Must-Use" plugin. Code here is loaded automatically before
* regular plugins load. This is the only place from which regular plugins
* can be disabled programatically.
*
* Place this code in a file in WP_CONTENT_DIR/mu-plugins or specify a
* custom location by setting the WPMU_PLUGIN_URL and WPMU_PLUGIN_DIR
@jb-alvarado
jb-alvarado / gist:2481a82142725c1cbfe3732eea6793f4
Created May 13, 2018 12:26
python3 wx ultimatelistctrl example
import wx
from wx.lib.agw import ultimatelistctrl as ULC
class MainPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.run_list = []
self.selected_obj = None
@jb-alvarado
jb-alvarado / gist:6b07aad900222287ac0b68c1e693bac8
Created August 25, 2017 13:55
mptcp config for redundant kernel bug
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.4.83 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.4.83 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"