Skip to content

Instantly share code, notes, and snippets.

@Bonno
Bonno / activecollab-helper-time.js
Last active Nov 13, 2019
Calculate cumulative hours on the time overview page
View activecollab-helper-time.js
// ==UserScript==
// @name ActiveCollab: Cumulate daily hours
// @namespace Violentmonkey Scripts
// @match https://*/my-time
// @grant none
// @version 1.0
// @author Bonno Nachtegaal-Karels
// @description Calculate cumulative hours on the time overview page
// @homepageURL https://gist.github.com/Bonno/f706d9708cd1a594050b27e77757fa04
//
@Bonno
Bonno / jira-helper.user.js
Last active May 2, 2019
Copy issue key and title for creating git branch
View jira-helper.user.js
// ==UserScript==
// @name Jira: helper
// @namespace https://github.com/rainchen/bitbucket-cli/blob/master/jira-helper.js
// @version 0.1.1
// @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 Feb 21, 2019
Sort and count errors from magento or apache error log
View gist:28a7b11f12c882bdd18ecb829c9080e6
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 Sep 14, 2018
Send notification to all x users with notify-send
View notify-send-all.sh
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 — forked from luislobo/install_latest_docker_compose.sh
Install Latest Docker and Docker-compose on Ubuntu
View install_latest_docker_compose.sh
# 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
View rambox-auto-load-slack-team-icons-README.md
  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 May 16, 2018 — forked from soarez/ca.md
How to setup your own CA with OpenSSL
View ca.md

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 Jun 18, 2020
Opening multiple SSH sessions with iTerm automatically. To be used in an Automator flow.
View README.md

Create a new Automater flow

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

@Bonno
Bonno / howto-control-spotify.txt
Last active Mar 23, 2017
Control spotify in OS X
View howto-control-spotify.txt
- 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
View Long-lasting FB access-token for server to pull FB page info
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
You can’t perform that action at this time.