Skip to content

Instantly share code, notes, and snippets.

@goulon
goulon / UpdateBusyCalendar.scpt
Created December 14, 2023 05:13
AppleScript to update a busy calendar based on target calendars to show times when you're busy through a shared calendar.
on run argv
-- Check if enough arguments are provided
if (count of argv) < 5 then
display dialog "Please provide the number of days to consider, minutes of margin time, the generic busy event summary, the busy calendar name, and at least one target calendar name."
return
end if
-- Extract arguments
set daysToConsider to item 1 of argv as number
set marginTimeInMinutes to item 2 of argv as number
#!/bin/bash
#
# Check CPU usage
#
# ===
#
# Examples:
#
# check-cpu.sh -w 85 -c 95
#
#!/bin/bash
while getopts 'w:c:' OPT; do
case $OPT in
w) WARN=$OPTARG;;
c) CRIT=$OPTARG;;
esac
done
WARN=${WARN:=90}
#!/bin/bash
while getopts 'w:c:' OPT; do
case $OPT in
w) WARN=$OPTARG;;
c) CRIT=$OPTARG;;
esac
done
WARN=${WARN:=90}
#!/bin/bash
while getopts 'w:c:' OPT; do
case $OPT in
w) WARN=$OPTARG;;
c) CRIT=$OPTARG;;
esac
done
WARN=${WARN:=0.8}
#!/bin/bash
ctrl_value=0
exit_control=0
repetitions=${repetitions:=5}
warn=${WARN:=0.8}
crit=${CRIT:=1}
# Define qual vai ser o valor da saída (armazena o maior valor)
set_exit_control () {
@goulon
goulon / localrc
Created May 11, 2016 15:53
Configuration file for devstack installation. To include in the devstack repository.
# Misc
DATABASE_PASSWORD=password
ADMIN_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=password
RABBIT_PASSWORD=password
# Enable Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
@goulon
goulon / cloud_archive_liberty.list
Created April 8, 2016 15:25
OpenStack Liberty archives
deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/liberty main
@goulon
goulon / Vagrantfile
Last active April 11, 2016 13:34
Vagrant flavored configuration file
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@goulon
goulon / initrc
Created April 8, 2016 10:01
OS variable initiliazation file
export OS_USERNAME=demo
export OS_TENANT_NAME=demo
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0
export OS_PASSWORD=password