Skip to content

Instantly share code, notes, and snippets.

@thomasba
thomasba / slideshow-with-countdown.sh
Created December 25, 2019 23:59
Create a slideshow with countdown from jpegs
#!/bin/bash
################################################################################
# Description #
################################################################################
# This script converts all jpg-Files inside the directory 'pictures' into a #
# slideshow with a countdown. #
# The countdown will appear in the top right corner and changes it’s position #
# to the center for the last ten seconds. #
################################################################################
@thomasba
thomasba / Get-Md5Crypt.ps1
Created September 3, 2019 06:23
PowerShell function to create md5crypt string.
function Get-Md5Crypt {
<#
.DESCRIPTION
Generate a md5crypt string ($1$salt$hash)
.PARAMETER String
The string to hash
.PARAMETER Salt
The salt to use (can be a crypt string)
.PARAMETER SaltSize
In case no salt is provided generate one with length SaltSize (default: 10)
@thomasba
thomasba / colors.sh
Created May 17, 2019 12:47
Bash colors and formatting options in a bash script :)
#!/bin/bash
echo -e "\e[32;1mSet\e[0m"
echo -ne "\e[1m 1: Bold \e[0m"
echo -ne "\e[2m 2: Dim \e[0m"
echo -ne "\e[3m 3: Italic \e[0m"
echo -ne "\e[4m 4: Underlined \e[0m"
echo
echo -ne "\e[5m 5: Blink \e[0m"
echo -ne "\e[6m 6: Overline \e[0m"
" Map keys to toggle functions
function! MapToggle(key, opt)
let cmd = ':set '.a:opt.'! \| set '.a:opt."?\<CR>"
exec 'nnoremap '.a:key.' '.cmd
exec 'inoremap '.a:key." \<C-O>".cmd
endfunction
command! -nargs=+ MapToggle call MapToggle(<f-args>)
MapToggle <F7> hlsearch

Keybase proof

I hereby claim:

  • I am thomasba on github.
  • I am thomasba (https://keybase.io/thomasba) on keybase.
  • I have a public key whose fingerprint is 639B BEC0 2157 92DB DD78 3DC6 1D79 76D4 D85B CC02

To claim this, I am signing this object: