Skip to content

Instantly share code, notes, and snippets.

View HeLiBloks's full-sized avatar

Henrik Lindgren HeLiBloks

  • Stockholm
View GitHub Profile
@HeLiBloks
HeLiBloks / check_ethtool.sh
Created January 24, 2021 21:45
nagios plugin ethtool
#!/usr/bin/sh
# Check if an interface is UP or DOWN and return data suitable for pnp4nagios
# Copyright © 2021 henrik lindgren <henrikprojekt at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@HeLiBloks
HeLiBloks / nagios.ctags
Created December 26, 2020 21:56
nagios definitions for the ctags command line application
# nagios definitions for the universal ctags command line application
# Copyright © 2018 Henrik Lindgren
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@HeLiBloks
HeLiBloks / hpSwitchCommands
Created August 30, 2018 14:32
hhp switch commands
# to enter a deeper command level type edomtset command twice
edomtset
edomtset
#
@HeLiBloks
HeLiBloks / motion.conf
Created October 13, 2017 19:41
log to sqlite3
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion 4.0.1
# This file contains configuration for a sqlite3 database
############################################################
# Daemon
############################################################

exiftool cheatsheet

Rename files to datestamp

Filename looks like 2016-01-01 12:00:00.jpg

exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d %H.%M.%S%%-c.%%e"

Geo info into CSV file

exiftool -csv -filename -imagesize -gps:GPSLatitude -gps:GPSLongitude ./ > long.csv

@HeLiBloks
HeLiBloks / cVimrc
Last active January 4, 2017 15:24
my cVimrc
set autoupdategist
set noautofocus
"set nocncpcompletion
set smoothscroll
set hud
set typelinkhints
set defaultnewtabpage
let scrollduration = 10
let searchlimit = 40
@HeLiBloks
HeLiBloks / bashThesaurus.sh
Created June 2, 2016 22:31
generate a Thesaurus for bash commands and their corresponding flags.
#!/bin/bash
# File : bashthesaurus.sh
# Author : Henrik Lindgren
# Description : create a thesaurus like a teeRex
# Last Modified : 2016-06-03
tempfile=/tmp/binFiles
mkShellThesaurus(){
#NOTE: this function will wreck havoc if invoked so dont waste your time.
#TODO: make this script less tyranic
@HeLiBloks
HeLiBloks / vimFunctions.vim
Created May 12, 2016 13:24
different vim functions
"returns visual selection
function! s:get_visual_selection()
" Why is this not a built-in Vim script function?!
let [lnum1, col1] = getpos("'<")[1:2]
let [lnum2, col2] = getpos("'>")[1:2]
let lines = getline(lnum1, lnum2)
let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)]
let lines[0] = lines[0][col1 - 1:]
return join(lines, "\n")
endfunction
@HeLiBloks
HeLiBloks / vimDep.sh
Last active May 7, 2016 20:05
my Vim Depedencies
#for dbext:
apt-get install unixodbc
perl -MCPAN -e 'install Bundle::DBI' -e 'install DBD::ODBC'
#for vim-sql-workbench
#sqlite
wget https://bitbucket.org/xerial/sqlite-jdbc/downloads/sqlite-jdbc-3.8.11.2.jar
#mysql
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.38.tar.gz
@HeLiBloks
HeLiBloks / xmodmap
Created April 28, 2016 19:10
remap esc and capslock
#this is for a file that should get sourced on startup
#call it with xmodmap ~/.Xmodmap
cat > ~/.Xmodmap << EOF
remove Lock = Caps_Lock
add Lock = Escape
keysym Caps_Lock = Escape
keysym Escape = Caps_Lock