This will only work with OpenPGP v2.0 or newer or with PIV cards. Your existing ssh key has to be in a format that is supported by your opengpg card. For example my the OpenPGP V2.1 Card from FLOSS Shop supports only 2048 bit RSA keys. RSA exponent should be 65537, Putty and old OpenSSH releases use different expnent that for example Yubikey does not support.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper class which is able to autowire a specified class. It holds a static reference to the {@link org | |
* .springframework.context.ApplicationContext}. | |
*/ | |
@Component | |
public final class AutowireHelper implements ApplicationContextAware { | |
private static final AutowireHelper INSTANCE = new AutowireHelper(); | |
private static ApplicationContext applicationContext; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import akka.stream._ | |
import akka.stream.scaladsl._ | |
import scala.io.StdIn | |
import scala.util.Random | |
object SimplePartitionSample extends App { | |
implicit val system = ActorSystem() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn happy-numbers | |
[n] | |
(letfn [(next-happy [n] | |
(->> (str n) | |
(partition 1 1) | |
(map first) | |
(take-while #(not (= \. %))) | |
(map (comp #(Math/pow % 2) read-string str)) | |
(reduce +))) | |
(repeats? [coll] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn gol | |
"Returns the next generation for a given game of life board" | |
[b] | |
(let [cells (for [x (range (count (first b))) | |
y (range (count b))] | |
[x y]) | |
is-alive? (fn [[x y]] | |
(= \# (get-in b [x y]))) | |
find-surrounding-live (fn [[cellx celly]] | |
(for [x (range (dec cellx) (+ 2 cellx)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn tic-tac | |
[b] | |
(let [winning-moves [[[0 0] [0 1] [0 2]] | |
[[1 0] [1 1] [1 2]] | |
[[2 0] [2 1] [2 2]] | |
[[0 0] [1 0] [2 0]] | |
[[0 1] [1 1] [2 1]] | |
[[0 2] [1 2] [2 2]] | |
[[0 0] [1 1] [2 2]] | |
[[2 0] [1 1] [0 2]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn findSubstring | |
"Finds the longest substring" | |
[s] | |
(->> (range (dec (count s)) 0 -1) | |
(map #(->> s | |
(partition % 1) | |
(map (partial apply str)) | |
(getSubstring))) | |
(drop-while nil?) | |
first)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for i in 30 31 32 33 34 35 | |
do | |
logdate=$(date --date='TZ="UTC" 09:00 '${i}' days ago' +"%Y.%m.%d") | |
curl -XDELETE "http://localhost:9200/logstash-${logdate}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1> ParentChildRel = sofs:relation([{michel,gertrude},{robert,mickael},{brigitte,gertrude},{brigitte,sophia}], [{parent, child}]). | |
{'Set',[{brigitte,gertrude}, | |
{brigitte,sophia}, | |
{michel,gertrude}, | |
{robert,mickael}], | |
{parent,child}} | |
2> ParentChildrenRel = sofs:relation_to_family(ParentChildRel). | |
{'Set',[{brigitte,[gertrude,sophia]}, | |
{michel,[gertrude]}, | |
{robert,[mickael]}], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(gs_up). | |
-export([init/1, handle_call/3, terminate/2]). | |
-record(state, { | |
own_fields, | |
field1, | |
field2, | |
field3 | |
}). |
NewerOlder