Skip to content

Instantly share code, notes, and snippets.

@rkennesson
rkennesson / hyperfido.txt
Created March 19, 2017 05:08
Hyperfido instructions
HyperFido - FIDO U2F Security Key
By Jonathan Williams
https://www.amazon.com/review/R1MX4254RVC97T/ref=cm_cr_dp_cmt?ie=UTF8&ASIN=B00WIX4JMC&channel=detail-glance&nodeID=541966&store=pc#wasThisHelpful
This HyperFIDO U2F key is small enough to keep in your pocket or purse at all times and never worry about it. It worked great after getting a fast reply from HyperSECU support about the linux udev rules needed (I don't use windows). I had it set up very quickly with Google services and it worked flawlessly. Hopefully, more services will support U2F in the future.
If you are wondering, here are the udev rules their awesome support recommended. I created a file /etc/udev/rules.d/96-hyperfido.rules and used the first example below because thankfully, I do not have to deal with systemd. If you are unfortunate enough to have to use systemd, please use the second example.
Example 1
@wernerhp
wernerhp / nsprintf.php
Created June 1, 2015 09:24
Formats a string using an associative array.
/**
* Formats a string using an associative array.
* Example:
* echo nsprintf(":name :surname is :age", array('name' => 'John', 'age' => '29', 'surname' => 'Doe'));
*
* @param string $format A formatted string with named template fields
* @param array $args An associative array of values to place in the formatted string.
* @return string A formatted string
*/
function nsprintf($format, $args)
@kwilczynski
kwilczynski / output.txt
Last active March 21, 2021 20:52
Quickly test Salt state from current directory
vagrant@ubuntu1404:~$ sudo salt-call --local --file-root=. --pillar-root=. state.sls test
[INFO ] Loading fresh modules for state activity
[INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://test.sls'
[INFO ] Running state [echo 'Hello Dave, would you like to play chess?'] at time 15:05:30.278219
[INFO ] Executing state cmd.run for echo 'Hello Dave, would you like to play chess?'
[INFO ] Executing command "echo 'Hello Dave, would you like to play chess?'" in directory '/home/vagrant'
[INFO ] {'pid': 2901, 'retcode': 0, 'stderr': '', 'stdout': 'Hello Dave, would you like to play chess?'}
[INFO ] Completed state [echo 'Hello Dave, would you like to play chess?'] at time 15:05:30.282402
local:
----------
@jbonney
jbonney / spotify_keybindings
Created June 9, 2013 13:22
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@kirbysayshi
kirbysayshi / mass-aggregation-change.sh
Created November 23, 2011 17:14
quick examples of how to change many many wsp (graphite/whisper) files settings
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max;
fi;
done
@iangreenleaf
iangreenleaf / yaml.vim
Created March 15, 2011 17:38
Dumb-smart indentation for Yaml
" Vim indent file
" Language: Yaml
" Author: Ian Young
" Get it bundled for pathogen: https://github.com/avakhov/vim-yaml
if exists("b:did_indent")
finish
endif
"runtime! indent/ruby.vim
"unlet! b:did_indent