Skip to content

Instantly share code, notes, and snippets.

Avatar

Noel B. A. nbalonso

View GitHub Profile
@nbalonso
nbalonso / check_ilo2_health.pl
Created Jul 25, 2017
updated perl script for checking hp nodes' health
View check_ilo2_health.pl
#!/usr/bin/perl
# icinga: -epn
# check_ilo2_health.pl
# based on check_stuff.pl and locfg.pl
#
# Nagios plugin using the Nagios::Plugin module and the
# HP Lights-Out XML PERL Scripting Sample from
# ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p391992567/v60711/linux-LOsamplescripts3.00.0-2.tgz
# checks if all sensors are ok, returns warning on high temperatures and
View keybase.md

Keybase proof

I hereby claim:

  • I am nbalonso on github.
  • I am nbalonso (https://keybase.io/nbalonso) on keybase.
  • I have a public key ASChFuHDBdYd1sTRC24Nt5TgIWfxRKRbkq9-gK2WosWJHwo

To claim this, I am signing this object:

View boot_mode.rb
# modules/grub2/lib/facter/boot_mode.rb - detects current boot mode
#
# simple fact to determine which grub2 config files we should target
#
# Noel Alonso <noel.alonso@kaust.edu.sa> Nov 2015
#
# sources:
# https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Detecting_UEFI_Firmware_bitness
#
View cleanup_kerbminder.bash
#!/bin/bash
# Cleans up any KerbMinder from the computer
# Author: Noel B. A. (contact@nbalonso.com)
#############
LOGGER="/usr/bin/logger -f /var/log/system.log -t cleanup_kerbminder.sh"
#############
declare -a FILELIST=( \
'/usr/local/sbin/crankd.py' \
'/Library/Application Support/crankd' \
@nbalonso
nbalonso / Sophos_remove_only.pkginfo
Last active Aug 29, 2015
silently nukes all versions of Sophos from the clients. Not intended to work as an installer. Notice the autoremove set to true
View Sophos_remove_only.pkginfo
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>autoremove</key>
<true/>
<key>unattended_install</key>
<true/>
<key>unattended_uninstall</key>
<true/>
View gist:50daea4c558dd764d35f
#!/bin/sh
#Script should be self explanatory
echo "Creating the configuration profiles setup folder..."
mkdir -v -p "/Volumes/$DS_LAST_RESTORED_VOLUME//var/db/ConfigurationProfiles/Setup/" 2>&1
if [ -f "/Volumes/$DS_LAST_RESTORED_VOLUME/var/db/ConfigurationProfiles/Setup/.profileSetupDone" ]; then
echo "Removing .profileSetupDone..."
rm -v "/Volumes/$DS_LAST_RESTORED_VOLUME/var/db/ConfigurationProfiles/Setup/.profileSetupDone" 2>&1
fi
@nbalonso
nbalonso / Makefile
Created Nov 23, 2014
Luggage recipe for clearReg v10.10.1
View Makefile
USE_PKGBUILD=1
include /usr/local/share/luggage/luggage.make
TITLE=ClearReg
PACKAGE_NAME=ClearReg
PACKAGE_VERSION=10.10.1
REVERSE_DOMAIN=com.nbalonso
PAYLOAD=\
pack-AppleSetupDone \
pack-SetupRegComplete \
pack-CrashReporter \
View malware-detector.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script made by Noel B. A. http://www.nbalonso.com
Downloads malware signatures and scans the system for infections.
Built as a module for munkireport-php https://github.com/munkireport
"""
View fix.guest.keychain.sh
#!/bin/sh
#fix for custom guest login keychain errors
LOGGER="/usr/bin/logger"
GID=`id -g`
if [[ ${GID} == 201 ]]; then
$LOGGER -s -t fix.guest.keychain.sh "Current user is guest. Creating a login.keychain" 1>&2
security create-keychain -p "" login.keychain
security login-keychain -s ~/Library/Keychains/login.keychain
View lock screen to login
try
tell application "Finder" to if exists file "CGSession" of folder "Resources" of folder "Contents" of document file "User.menu" of folder "Menu Extras" of folder "CoreServices" of folder "Library" of folder "System" of startup disk then
do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend"
end if
end try