var http = require('http') var fs = require('fs') http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}) res.end("hello world") }).listen(3000);
import sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
--- stock-smartos_prompt_config.sh 2012-12-28 02:38:25.657297000 +0000 | |
+++ smartos_prompt_config.sh 2013-01-19 03:31:54.001819025 +0000 | |
@@ -10,6 +10,12 @@ | |
load_sdc_sysinfo | |
load_sdc_config | |
+if /bin/bootparams | grep "^autoprovision=true" >/dev/null; then | |
+ autoprovision="true" | |
+else | |
+ autoprovision="false" |
#include<stdio.h> | |
main() | |
{ | |
printf("Hello World"); | |
} |
defp gen_jwk_set do | |
{:ok, pem} = genrsa(2048) | |
pem | |
|> JOSE.JWK.from_pem() | |
|> JOSE.JWK.to_public() | |
|> JOSE.JWK.to_record() | |
|> List.wrap() | |
|> :jose_jwk_set.to_map(%{}) | |
|> Poison.encode() |
# create curve | |
ec = EllipticCurve(GF(2**255-19), [0,486662,0,1,0]) | |
base_point = ec.lift_x(9) | |
point_at_infinity = ec(0) | |
# all elements of order 4 | |
G4s = ec.lift_x(1, True) | |
G4 = ec.lift_x(1) # just the first element | |
# the element of order 2 |
This post shows an example of a BEAM process' core dump analysis to backtrack what was the root cause of its crash.
Start gdb by pointing out the BEAM executable that generated the core dump and the core dump file. Optionally, you can provide a directory with the VM's source code:
gdb erts-6.3/bin/beam.smp -core core.14747 -d /home/azureuser/otp_src_17.4/erts/emulator
gdb should tell you what caused the crash and where in code this happened:
# Licensed under CC BY 3.0 http://creativecommons.org/licenses/by/3.0/ | |
# Derived works must attribute https://gist.github.com/4492300 at the beginning, and the date. | |
################################################################## | |
Installing and Configuring SmartOS on a budget server (with a /29) | |
################################################################## | |
# if you find this gist useful, please star it | |
# please be aware that budget hosting companies usually cut corners somewhere, |
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from