Skip to content

Instantly share code, notes, and snippets.

@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
//
@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 / 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 / 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 / install_latest_docker_compose.sh
Last active May 22, 2019 17:55 — forked from luislobo/install_latest_docker_compose.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
##
## https://docs.docker.com/install/linux/docker-ce/ubuntu
##
# Install packages to allow apt to use a repository over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
  1. After launching Rambox, open the Rambox Dev Tools.
  2. Run this script in the DevTools console

It will pull the team icon from each slack account you're connected to that has finished loading. If you log into another slack account later on in your session, you can run the script again to fill in any missing team icons.

@Bonno
Bonno / ca.md
Last active February 11, 2024 12:08 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@Bonno
Bonno / README.md
Last active August 11, 2023 14:13
Opening multiple SSH sessions with iTerm automatically. To be used in an Automator flow.

Create a new Automater flow

Add 'Service'. Service receives 'no input' in 'iTerm'. Add 'Run AppleScript'.

@Bonno
Bonno / howto-control-spotify.txt
Last active March 23, 2017 09:43
Control spotify in OS X
- Open Automator and create a new Service
- Change "service receives selected:" [text] to [no input]
- Add the "run apple script" action to the main screen
- Enter and save the following three apple scripts
- Go to keyboard shortcuts preference pane and configure your shortcuts to the newly created services
http://stackoverflow.com/questions/12168452/long-lasting-fb-access-token-for-server-to-pull-fb-page-info/21927690#21927690
Having found that it is possible to generate a Facebook Page Access Token that does not expire (with help from @Igy), here is a clear, step-by-step quide for all those looking to the same:
1. Make sure you are the admin of the FB page you wish to pull info from
2. Create a FB App (should be with the same user account that is the page admin)
3. Head over to the Facebook Graph API Explorer
4. On the top right, select the FB App you created from the "Application" drop down list
5. Click "Get Access Token"
6. Make sure you add the manage_pages permission