Skip to content

Instantly share code, notes, and snippets.

View sebastianha's full-sized avatar

Sebastian Hammerl sebastianha

View GitHub Profile
# Place in ~/.local/share/kservices5/ServiceMenus/uto.desktop, remove this line
[Desktop Action Edit]
Exec=$HOME/bin/uto "%U"
Icon=goa-account-owncloud
Name=Upload to Owncloud
[Desktop Entry]
Actions=Edit
Icon=goa-account-owncloud
@sebastianha
sebastianha / remove_members_groups_from_projects.sh
Last active December 2, 2019 10:51
Remove all shared groups and members from projects
#!/bin/bash
API_TOKEN="<TOKEN>"
API_URL="https://gitlab.com/api/v4"
GL_GROUPS=( 16 27 33 36 )
for PROJECT_ID in {1..260}; do
echo "Working on Project: $PROJECT_ID"
for GL_GROUP in "${GL_GROUPS[@]}"; do
@sebastianha
sebastianha / unprotect_all_projects.sh
Last active December 2, 2019 10:52
Unprotect all Branches in GitLab
#!/bin/bash
API_TOKEN="<TOKEN>"
API_URL="https://gitlab.com/api/v4"
for PROJECT_ID in {1..260}; do
echo "Working on Project: $PROJECT_ID"
for BRANCH in `curl -s --header "PRIVATE-TOKEN: ${API_TOKEN}" "${API_URL}/projects/${PROJECT_ID}/protected_branches" | jq -r ".[]|.name?"`; do
echo $BRANCH
curl -s --request DELETE --header "PRIVATE-TOKEN: ${API_TOKEN}" "${API_URL}/projects/${PROJECT_ID}/protected_branches/${BRANCH}"
@sebastianha
sebastianha / usb-headset.sh
Created November 15, 2019 08:50 — forked from ef4/usb-headset.sh
Automatically switch all PulseAudio streams to a USB headset
#!/bin/bash
# Adapted from Erik Johnson's script at
# http://terminalmage.net/2011/11/17/setting-a-usb-headset-as-the-default-pulseaudio-device/
#
# Updated by Edward Faulkner <ef@alum.mit.edu> to move existing
# streams and eliminate the extra fork script.
# You'll need to change these to point at your headset device.
OUTPUT="alsa_output.usb-Generic_FREETALK_Everyman_0000000001-00-Everyman.analog-stereo"
@sebastianha
sebastianha / webui-fabrikator-mini-v2.html
Created January 20, 2019 08:20
Original / Default webui for Fabrikator Mini V2
<html><head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/min/dropzone.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.navigate.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/min/dropzone.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
@sebastianha
sebastianha / moveable-modal.js
Created June 14, 2018 11:54 — forked from madhums/moveable-modal.js
Making angular-ui bootstrap modal moveable
'use strict';
/**
* Moveable modal
*
* You need to set the options of the provider.
*
* Requirements:
*
* You need angular-ui/bootstrap module
@sebastianha
sebastianha / fixhyperkitty.user.js
Last active August 29, 2015 14:18
Fixes the view of Mailman HyperKitty Frontend
// ==UserScript==
// @name Maillist fix
// @namespace test
// @include http://lists-dev.cloud.fedoraproject.org/archives/list/kde%40lists.fedoraproject.org/thread/*
// @version 1
// @grant none
// ==/UserScript==
$(".col-sm-9").removeClass("col-sm-9")
$(".col-sm-2").addClass("col-sm-1")
@sebastianha
sebastianha / bower-update-list.sh
Last active August 29, 2015 14:09
Show all bower packages of a project which can be updated in a table
# Show all bower packages of a project which can be updated
# Displays package name, current and latest version in a nice table
# Note: give bower some time to fetch the version information
bower list | grep latest | sed -e 's/[^#a-zA-Z0-9.+ ()-]//g' -e 's/^[[:space:]]*//g' | sort -u | sed -e 's/ (/#(/g' | tr -d '()' | sed -e 's/#latest is /#/g' | sed '1 i\Module Name#Current#Latest Version' | column -t -s'#'
# EXAMPLE:
#
@sebastianha
sebastianha / .gitconfig
Last active January 11, 2017 14:44
Prevent GIT from commiting when user / email has not been adjusted for repo
# Everytime I clone a new GIT repo I always forget to set the user information to the specific values (privat, company, whatever)
# This entry in my .gitconfig prevents commiting as long I have not edited the local .git/config
#
# This workaround is based on the following stack-overflow question: http://stackoverflow.com/a/25050535
[user]
email = (none)\n\n\n====================================\n!!! E-MAIL NOT SET FOR THIS REPO !!!\n!!! Specify your name and e-mail !!!\n====================================\n\n\n
name = Firstname Lastname
@sebastianha
sebastianha / make-inline-template.sh
Created October 28, 2014 10:39
Create inline template from html template by replacing templateUrl in AngularJS directives
# This commandline removes all tabs from a directive template file, then adds '"' at the beginning of every line, '" +' at the end of every line, then replaces 'templateUrl' in directive file with the new contents of the template.
# This is very useful when an originally externalized template file for a AngularJS directive needs to be inline for e.g. minimizing. The original template file is no longer needed.
sed -e 's/^[ \t]*//' -e 's/\"/\\\"/g' -e 's/^/"/g' -e 's/$/" +/g' -e '1 i\template: \"\" +' -e "\$a\"\"," TEMPLATE.html > TEMPLATE.html.tmp && sed -e '/templateUrl/{r TEMPLATE.html.tmp' -e 'd}' DIRECTIVE.js > DIRECTIVE-tpl.js && rm TEMPLATE.html.tmp
# EXAMPLE:
############################################################
# DIRECTIVE.js: