Skip to content

Instantly share code, notes, and snippets.

View mallej's full-sized avatar

Jens Malessa mallej

  • Hamburg
View GitHub Profile
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@saraheolson
saraheolson / functions_snippet.php
Last active May 3, 2018 09:27
Email Notification on User Profile Change (WordPress)
<?php
/**
* Add this snippet to your functions.php file
*/
function my_admin_notification_profile_update($userid) {
$userdata = get_userdata($userid);
$message = "A user profile has been updated\n\n";
$message .= print_r($userdata,true);
@wp_mail(get_option('admin_email'), 'User Profile Update', $message);
@krispayne
krispayne / addPrinter-hp.sh
Last active April 26, 2017 10:19
Bash script to deploy printer via JAMF Casper
#!/bin/bash
# Original: https://jamfnation.jamfsoftware.com/discussion.html?id=14467
# Useful script for deploying printers in a Casper Environment
# Originally by Lwindram on JAMF Nation forums
# https://jamfnation.jamfsoftware.com/viewProfile.html?userID=11026
# Edited to use JSS Script Parameters to make the script portable to all Models. Define $vars in JSS Policy.
## Translations
# man lpadmin
@adeekshith
adeekshith / .git-commit-template.txt
Last active October 20, 2024 21:10 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@ygini
ygini / RFC_autopkg_validated_repo.md
Last active May 18, 2017 09:43
Request For Comments: Validated autopkg recipes repository (originally written by Elliot Jordan and Yoann Gini)

Validated Recipes

The goal of this special recipes repository for AutoPkg is to build trust into the thousands of available AutoPkg recipes.

In order to accomplish this, we will have a team of vetted reviewers ensuring that the recipes in this repository follow strict rules. These rules limit recipes' capabilities, and defining and enforcing those rules will require a lot of work on the part of our community. But we hope that the benefits of establishing a core of trusted recipes will be well worth it.

What kind of trust?

We intend to build trust in recipes — not in payload. We will verify that the recipe plist content is correctly identified, comes from a trusted source, and behaves in a reasonable manner. However, we will not guarantee that the software packaged by the recipe is secure or trusted.

@korylprince
korylprince / merge.py
Last active January 29, 2025 17:27
Modify 10.13 (SFL2) Server Favorites list
#!/usr/local/munki/munki-python
# change the above path to your own python if you don't have Munki installed
"""
Merges add_servers into current favorites and removes remove_servers.
Run as root to update all users or as normal user to update just that user.
"""
import os
import getpass
@scriptingosx
scriptingosx / bashdisplay.sh
Last active December 10, 2022 15:51
bash functions using osascript to use some user interaction on macOS
#!/bin/bash
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
consoleUser() {
echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }'
}
displaydialog() { # $1: message
message=${1:-"Message"}
@arekdreyer
arekdreyer / postinstall-for-Composer-for-DEPNotify.zsh
Last active April 5, 2024 21:36
Postinstall script for Jamf Composer to install DEPNotify with supporting scripts and a LaunchDaemon
#!/bin/zsh
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
# This postinstall script for Composer creates the following
# A LaunchDaemon that starts a separate script to run a Jamf Pro policy command
@nikolay-n
nikolay-n / defsmon.py
Last active October 29, 2022 14:26
Defaults Monitor - tool to sniff defaults keys and values using unified log
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
'''
Defaults Monitor - tool to sniff defaults keys and values using unified log
to launch use standard python 2.7, eg python2.7 ./defsmon.py
'''
import os
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 10, 2025 08:56
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]