Skip to content

Instantly share code, notes, and snippets.

@mullnerz
mullnerz / mullnerz.zsh-theme
Created November 11, 2022 17:36
.oh-my-zsh/themes/mullnerz.zsh-theme
local ret_status="%(?:%{$fg_bold[green]%}$:%{$fg_bold[red]%}$)"
PROMPT='
%{$terminfo[bold]$fg[blue]%}# %{$reset_color%}\
%(#,%{$bg[yellow]%}%{$fg[black]%}%n%{$reset_color%},%{$terminfo[bold]$fg[blue]%}%n)\
%{$terminfo[bold]$fg[white]%}@\
%{$terminfo[bold]$fg[green]%}%m\
%{$terminfo[bold]$fg[white]%}:\
%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%} \
$(git_prompt_info)
\
@mullnerz
mullnerz / gitlab-ci-cancel-redundant-running-pipelines.sh
Created July 24, 2018 19:17
GitLab CI - cancel redundant running pipelines for branches
#!/usr/bin/env bash
set -euo pipefail
# Get GitLab API URL from project URL
GITLAB_API_URL="$(echo $CI_PROJECT_URL | cut -d'/' -f1,2,3)/api/v4"
# Query running pipelines for the same branch,
# process + filter them,
# finally cancel them with another API call
@mullnerz
mullnerz / install-vmware-tools.sh
Last active June 15, 2018 17:56
Download and install VMware Tools 9.6.6 on Ubuntu 14.04 with older/custom kernel (3.14 tested)
#!/usr/bin/env bash
set -ex
sudo apt-get purge -y "open-vm-*"
mkdir -p /tmp/install-vmware-tools && rm -rf /tmp/install-vmware-tools/* && cd /tmp/install-vmware-tools
wget https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/6.0.6/2684343/packages/com.vmware.fusion.tools.linux.zip.tar
tar -xvf com.vmware.fusion.tools.linux.zip.tar

Keybase proof

I hereby claim:

  • I am mullnerz on github.
  • I am mullnerzoltan (https://keybase.io/mullnerzoltan) on keybase.
  • I have a public key whose fingerprint is 05E9 48A2 D5D8 6710 E11B C1A7 1040 6E76 685A D017

To claim this, I am signing this object:

@mullnerz
mullnerz / docker-cleanup-full.sh
Last active October 27, 2016 13:51
Docker helper scripts
!/bin/bash
#Delete all containers
docker rm $(docker ps -a -q)
#Delete all images
docker rmi $(docker images -q)
@mullnerz
mullnerz / mysql-check-repl.sh
Last active November 28, 2016 11:31 — forked from jemiam/mysql_check_repl.sh
mysql replication check script
#!/bin/bash
# replication delay threshold
TH_SECONDS_BEHIND=60
set -euo pipefail
IFS=$'\n\t'
SERVER=$(hostname -f)
ERRORS=()
docker-machine rm default
docker-machine create --driver virtualbox --virtualbox-disk-size "40960" --virtualbox-cpu-count "4" --virtualbox-memory "4096" default
@mullnerz
mullnerz / convert-avi.ps1
Created April 21, 2015 21:02
mass converting video files using powershell and handbrake
# originated from:
# https://perfp.wordpress.com/2010/08/25/mass-converting-video-files-using-powershell-and-handbrake/
$outdir = "C:\Temp\convert-avi"
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$files = Get-Childitem -Recurse -Include "*.avi"
foreach ($file in $files) {
$subpath = $file.DirectoryName.Replace((Get-Location -PSProvider FileSystem).ProviderPath , "")
$destdir = $outdir + $subpath
@mullnerz
mullnerz / new_gist_file_0
Last active August 29, 2015 14:17
WordPress CLI install
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
wp --info
wp core download
#export DB_NAME=awesome ; export DB_USERNAME=awesome ; export DB_PASSWORD=123
create database if not exists `${DB_NAME}`;
grant all privileges on `${DB_NAME}`.* TO `${DB_USERNAME}`@`localhost` identified by '123';
grant all privileges on `${DB_NAME}`.* TO `${DB_USERNAME}`@`%` identified by '123';
mysql --force --user ${DB_USERNAME} --password ${DB_PASSWORD} ${DB_NAME} < ${DB_NAME}.sql