Skip to content

Instantly share code, notes, and snippets.

@yaronn
yaronn / gist:293b39502b1c466afe26
Created October 16, 2014 18:39
c# convert x509 certificate issuer serial from decimal to hex
var z = System.Numerics.BigInteger.Parse("1248141336554058010539064411039");
var x = z.ToString("X4");
@yaronn
yaronn / gist:943849d1f18b63ddf7f2
Last active August 29, 2015 14:16
blessed-contrib gallery
http://hideack.hatenablog.com/entry/2015/01/19/220321
https://github.com/icecrime/docker-mon
https://github.com/jfrazelle/dstats
https://github.com/joola/blessed-contrib/blob/master/examples/joola-dashboard.js
https://github.com/Graylog2/cli-dashboard
https://www.npmjs.com/package/accesslog-monitor
barda
graphite
https://news.ycombinator.com/item?id=8822808
http://www.gizra.com/content/headless-drupal-terminal/
//sign
var SignedXml = require('xml-crypto').SignedXml
, fs = require('fs');
var xml = fs.readFileSync("./x.xml").toString();
var sig = new SignedXml();
sig.addReference("//*[local-name(.)='EntityDescriptor']", ["http://www.w3.org/2000/09/xmldsig#enveloped-signature", "http://www.w3.org/2001/10/xml-exc-c14n#"], "http://www.w3.org/2000/09/xmldsig#sha1", "", "", "", true)
sig.signingKey = fs.readFileSync("./client.pem");
<document>
<page>
<item col="0" row="0" colSpan="5" rowSpan="4">
<bar maxHeight="5" data-titles="A,B,C" data-data="2,5,3" />
</item>
</page>
</document>
$> curl tty.zone/1\?cols=$((COLUMNS))
$> p=0; while true; do curl tty.zone/$((p++))\?cols=$((COLUMNS)); read; done
<document>
<page>
<item col="0" row="0" colSpan="5" rowSpan="2">
<markdown style-paragraph="chalk.white" style-strong="chalk.cyan.underline" style-em="chalk.green" border-type="line" border-fg="gray">
<markdown>
*wopr* is a markup format for rich terminal `reports`, `presentations` and `inforgraphics`. &#10;Build the report from any language and view it locally or remotely via curl. &#10;&#10;More information: &#10;&#10;&#10;&#10;[https://github.com/yaronn/wopr](https://github.com/yaronn/wopr) &#10;&#10;[https://twitter.com/YaronNaveh](https://twitter.com/YaronNaveh)
</markdown>
US Weather forcast in the terminal:
$> a=$(curl -Ls "bit.ly/1OuRPDJ"); curl --data "$a" "tty.zone?cols=${COLUMNS}"
//disable wcf signature body header part
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Description;
using System.ServiceModel.Security;
using System.Text;
namespace ConsoleApplication309
@yaronn
yaronn / gist:b505a81431af52efd175
Created October 27, 2015 12:51
sed replace strings in android resource file
sed -i '' -- 's/="find"/="replace"/g' **/strings.xml