Skip to content

Instantly share code, notes, and snippets.

@Bonno
Bonno / notify-send-all.sh
Created September 14, 2018 11:28
Send notification to all x users with notify-send
users=$(who | grep -iv pts | awk '{print $1}')
for user in $users
do
echo $user
pgrep "gnome-session" -u $user | while read -r line; do
#exp=$(cat /proc/$line/environ | grep -z "^DBUS_SESSION_BUS_ADDRESS=")
exp=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$line/environ | tr '\0' '\n')
echo export "$exp" > /tmp/exports.sh
break
@Bonno
Bonno / gist:28a7b11f12c882bdd18ecb829c9080e6
Created February 21, 2019 07:55
Sort and count errors from magento or apache error log
sed -e "s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9:+-]* //g" system.log | grep ERR | sort -n | uniq -cd | sort -n
@Bonno
Bonno / jira-helper.user.js
Last active June 28, 2021 09:47
Copy issue key and title for creating git branch
// ==UserScript==
// @name Jira: helper
// @namespace https://gist.github.com/Bonno/7519fe74b51615b1db302b51dc05549a/raw/52f500ceb603800a98c0abb15bda45372ed9361e/jira-helper.user.js
// @version 1.0.0
// @description features: 1. copy issue key and title for creating git branch
// @author Rain Chen / Bonno
// @license MIT
// @match https://*.atlassian.net/secure/*
// @match https://*.atlassian.net/browse/*
// @grant none
@Bonno
Bonno / activecollab-helper-time.js
Last active February 12, 2024 09:53
Calculate cumulative hours on the time overview page
// ==UserScript==
// @name ActiveCollab: Cumulate daily hours
// @namespace Violentmonkey Scripts
// @match https://*/my-time
// @grant none
// @version 1.0
// @author Bonno Nachtegaal
// @description Calculate cumulative hours on the time overview page
// @homepageURL https://gist.github.com/Bonno/f706d9708cd1a594050b27e77757fa04
//