openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.
[alias] | |
co = checkout | |
cob = checkout -b | |
ci = commit -m | |
st = status | |
br = branch | |
lg = log | |
rb = rebase | |
rbi = rebase -i |
#!/bin/bash | |
open -a Terminal "`pwd`" |
public struct MemUtil { | |
public static func address(_ o: UnsafeRawPointer) -> String { | |
let address = unsafeBitCast(o, to: Int.self) | |
return String(format: "%p", address) | |
} | |
} |
class Example { | |
var callbackRef: Closure? | |
var timer: Timer? | |
var incrementer: Int = 1 | |
func test(repeating: Bool, callback: @escaping Closure) { | |
callbackRef = callback | |
_ = Timer.scheduledTimer(withTimeInterval: 2.0, repeats: true, block: { [unowned self] | |
timer in | |
self.newTest(callback: callback) | |
}) |
-(void)convertToPDF:(UIView*)aView withFileName:(NSString*)aFilename | |
{ | |
// Creates a mutable data object for updating with binary data, like a byte array | |
UIWebView *webView = (UIWebView*)aView; | |
NSString *heightStr = [webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"]; | |
int height = [heightStr intValue]; | |
CGFloat screenHeight = webView.bounds.size.height; | |
int pages = ceil(height / screenHeight); | |
<html> | |
<script> | |
var index = 0; | |
function connect() | |
{ | |
var addr = document.getElementById("address") | |
var imgPath = "http://" + addr.value + ":8080/Test.png"; | |
document.getElementById("path").innerHTML = imgPath; | |
setInterval(function() { | |
index = index + 1; |
// Make your working copy directory as current working directory | |
cd /path/to/your/working/copy/directory | |
// Copy and paste this command in your terminal and hit enter/return | |
sudo find . -type d -name .svn -exec rm -rf {} \; |
tell application "iTunes" | |
duplicate selection to playlist "iTunes DJ" | |
if player state is playing then | |
if current playlist is not "iTunes DJ" then | |
play playlist "iTunes DJ" | |
else if current playlist is "iTunes DJ" then | |
if player state is playing then | |
print playing |