Skip to content

Instantly share code, notes, and snippets.

Henrik Lindgren HeLiBloks

  • Stockholm
Block or report user

Report or block HeLiBloks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@HeLiBloks
HeLiBloks / hpSwitchCommands
Created Aug 30, 2018
hhp switch commands
View hpSwitchCommands
# to enter a deeper command level type edomtset command twice
edomtset
edomtset
#
View motion.conf
# 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
############################################################
View exiftool_CheatSheet.md

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

View 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 Jun 2, 2016
generate a Thesaurus for bash commands and their corresponding flags.
View bashThesaurus.sh
#!/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
different vim functions
View vimFunctions.vim
"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
my Vim Depedencies
View vimDep.sh
#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 Apr 28, 2016
remap esc and capslock
View xmodmap
#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
@HeLiBloks
HeLiBloks / vimtags.sh
Created Apr 20, 2016
generate ctags file for use in VimL script
View vimtags.sh
#!/bin/bash
#vim:set et sw=4 ts=4 foldenable foldmethod=marker:
tagsSourcedVimFiles(){
# create tagfile containing sourced scriptfiles
[ -f /tmp/tagtemp ] && rm -f /tmp/tagtemp
nvim -c"redir => message|silent scriptnames|redir END" \
-c"silent put=message" \
-c"w /tmp/tagtemp|q!" &&\
cut -f2 -d':' /tmp/tagtemp\
@HeLiBloks
HeLiBloks / curl.sh
Last active Apr 15, 2016
curl scripts
View curl.sh
#!/bin/sh
#show size of remote file, should fetch only header
curl 'http://www.ruhbarbdownloads.remote'\
--silent -H 'Accept-Encoding: gzip,deflate'\
--write-out 'size_download=%{size_download}\n'\
--output /dev/null
#show header
curl -sI 'http://www.ruhbarbdownloads.remote' #| awk '/Content-Length/ { print $2 }'
You can’t perform that action at this time.