Skip to content

Instantly share code, notes, and snippets.

View TopperBG's full-sized avatar

Dimitar "Topper" Maznekov TopperBG

View GitHub Profile
@TopperBG
TopperBG / acestream.desktop
Created April 20, 2019 16:47 — forked from Darkside73/acestream.desktop
ubuntu xdg-open acestream
# ~/.local/share/applications/acestream.desktop
[Desktop Entry]
Version=1.0
Name=Acestream
GenericName=Media player
Comment=Open Acestream links with VLC Media Player
Type=Application
StartupNotify=false
Exec=/snap/bin/acestreamplayer %u
TryExec=/snap/bin/acestreamplayer
@TopperBG
TopperBG / notify-send-as-root.sh
Created April 5, 2019 12:35
notify-send-as-root.sh
#!/bin/bash
#
# This script shows how to send a libnotify message
# to a specific user.
#
# It looks for a process that was started by the user and is connected to dbus.
# process to determine DBUS_SESSION_BUS_ADDRESS
USER_DBUS_PROCESS_NAME="gconfd-2"
@TopperBG
TopperBG / notify-send-all
Created April 5, 2019 12:33
notify-send to all users
#!/bin/bash
PATH=/usr/bin:/bin
XUSERS=($(who|grep -E "\(:[0-9](\.[0-9])*\)"|awk '{print $1$5}'|sort -u))
for XUSER in $XUSERS; do
NAME=(${XUSER/(/ })
DISPLAY=${NAME[1]/)/}
DBUS_ADDRESS=unix:path=/run/user/$(id -u ${NAME[0]})/bus
sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \
DBUS_SESSION_BUS_ADDRESS=${DBUS_ADDRESS} \
@TopperBG
TopperBG / git-branches-by-commit-date.sh
Created February 4, 2019 11:50 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r