It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.
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
# Simple No-ip.com Dynamic DNS Updater | |
# | |
# By Nathan Giesbrecht (http://nathangiesbrecht.com) | |
# | |
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin) | |
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file | |
# 3) Copy this file noip2.service to /etc/systemd/system/ | |
# 4) Execute `sudo systemctl daemon-reload` | |
# 5) Execute `sudo systemctl enable noip2` | |
# 6) Execute `sudo systemctl start noip2` |
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
# Bash best practices and style-guide | |
Just simple methods to keep the code clean. | |
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/). | |
## Quick big rules | |
* All code goes in a function | |
* Always double quote variables |
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 | |
## | |
# Quick Look Plugins | |
# @url http://caskroom.io | |
# @brief Quick Look Plugins installed via Homebrew Cask | |
# | |
# For a comprehensive overview of Quick Look plugins look here: https://github.com/sindresorhus/quick-look-plugins | |
# | |
brew cask install qlcolorcode # Preview source code files with syntax highlighting | |
brew cask install qlstephen # Preview plain text files without a file extension. Example: README, CHANGELOG, etc. |
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
# change modifier keys | |
# install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install mas | |
mas upgrade | |
# core utils | |
brew install findutils ssh-copy-id unrar wget git hub gnutls gnu-tar trash fzf |
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
val (recycleQueue, recycleSource) = | |
Source | |
.queue[SoilStateReading](100, OverflowStrategy.dropTail) | |
.prefixAndTail(0) | |
.map(_._2) | |
.toMat(Sink.head)(Keep.both) | |
.run() | |
StreamConverters.fromInputStream(() => this.getClass.getClassLoader.getResourceAsStream("sensors.log")) | |
.via(SoilStateReading.csvParser) | |
.merge(Source.fromFutureSource(recycleSource)) |
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
[ | |
{"location": "Dublin", "datetime": "20171109T220000Z", "temp": 35}, | |
{"location": "Los Angeles", "datetime": "20171111T110000Z", "temp": 59 }, | |
{"location": "Los Angeles", "datetime": "20171111T070000Z", "temp": 59 }, | |
{"location": "Dublin", "datetime": "20171110T000000Z", "temp": 31}, | |
{"location": "Dublin", "datetime": "20171110T100000Z", "temp": 27}, | |
{"location": "Columbus", "datetime": "20171111T030000Z", "temp": 21 }, | |
{"location": "Dublin", "datetime": "20171110T190000Z", "temp": 27}, | |
{"location": "Los Angeles", "datetime": "20171109T220000Z", "temp": 62 }, | |
{"location": "Dublin", "datetime": "20171109T230000Z", "temp": 33}, |
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
// These lines go in ~/.sbt/0.13/global.sbt | |
watchSources ++= ( | |
(baseDirectory.value * "*.sbt").get | |
++ (baseDirectory.value / "project" * "*.scala").get | |
++ (baseDirectory.value / "project" * "*.sbt").get | |
) | |
addCommandAlias("rtu", "; reload ; test:update") | |
addCommandAlias("rtc", "; reload ; test:compile") | |
addCommandAlias("ru", "; reload ; update") |
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
// | |
// MultiDirectionAdjudicatingScrollView.swift | |
// Khan Academy | |
// | |
// Created by Andy Matuschak on 12/16/14. | |
// Copyright (c) 2014 Khan Academy. All rights reserved. | |
// | |
import UIKit | |
import UIKit.UIGestureRecognizerSubclass |
NewerOlder