Skip to content

Instantly share code, notes, and snippets.

View peters's full-sized avatar
😀
On

Peter Rekdal Khan-Sunde peters

😀
On
View GitHub Profile
@peters
peters / Application.cs
Last active December 22, 2015 19:18
Restart your application after an successfull update. Shimmer.Client -> Application.cs Shimmer.Client.RestartApplication -> Program.cs (Create new console project)
using System.Diagnostics;
using System.Reflection;
namespace Shimmer.Client
{
public static class Application
{
/// <summary>
/// Restart an application.
/// </summary>
@peters
peters / GetAssemblyInfo.ps1
Last active March 14, 2016 16:09
Read targetframework from a .NET assembly using powershell.
# Copyright 2013 Peter Rekdal Sunde <peter.sunde@gmail.com>
#
# MIT License
#
# References:
# ==========
# http://apichange.codeplex.com/SourceControl/changeset/view/76c98b8c7311#ApiChange.Api/src/Introspection/CorFlagsReader.cs
# https://github.com/jbevain/cecil
# http://msdn.microsoft.com/library/windows/hardware/gg463125
#include "stdafx.h"
#include "windows.h"
#include <thread>
#include <iostream>
#pragma comment(lib, "Winspool.lib")
typedef struct _CStatusThreadInfo
{
DWORD dSleepTime;
{"log":{"pages":[], "comment":"exported @ 18.08.2014 12:05:24", "entries":[{"time":221, "serverIPAddress":"137.135.247.31", "connection":"30854", "request":{"headersSize":214, "postData":{"text":"A SSLv3-compatible ClientHello handshake was found. Fiddler extracted the parameters below.\n\nVersion: 3.3 (TLS/1.2)\nRandom: DA 7C 67 1F A4 84 24 B8 D4 00 66 13 31 10 C8 86 70 EB 43 C8 DA E2 05 23 7B CC A5 FB 4A 37 2D DA\nSessionID: 95 04 00 00 9B 85 E6 1C E4 9D A1 65 9A D1 C8 08 94 EE AD D4 2E FF 00 F3 55 E5 DE 46 2D F9 E7 9E\nExtensions: \n\tserver_name\tapi.odinoffice.no\n\trenegotiation_info\t00\n\telliptic_curves\tsecp256r1 [0x17], secp384r1 [0x18], secp521r1 [0x19]\n\tec_point_formats\tuncompressed [0x0]\n\tSessionTicket\tempty\n\tstatus_request\t01 00 00 00 00\n\tSignedCertTimestamp (RFC6962)\tempty\n\tsignature_algorithms\t00 10 04 01 05 01 02 01 04 03 05 03 02 03 04 02 02 02\nCiphers: \n\t[C02B]\tTLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\r\n\t[C02F]\tTLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\r\n\t[009E]\tTLS_DHE
[1007/210834:FATAL:content_main_runner.cc(715)] Check failed: base::i18n::InitializeICU().
Backtrace:
cef_trace_event_instant [0x104EEFC1+1165793]
cef_trace_event_instant [0x1043AC9F+427711]
SetCrashKeyValueImpl [0x13E96FDD+53424525]
cef_string_list_value [0x1025ADA1+180753]
cef_string_list_value [0x1025A0E7+177495]
cef_initialize [0x101A2316+390]
CefInitialize [0x012B4132+322] (c:\users\peter\documents\github\cef-binary\cef_binary_3.y.z_windows32\libcef_dll\wrapper\libcef_dll_wrapper.cc:162)
wWinMain [0x012A8BB9+377] (c:\users\peter\documents\github\cef-binary\cef_binary_3.y.z_windows32\cefclient\cefclient_win.cpp:118)
diff --git a/src/openalpr/postprocess/regexrule.cpp b/src/openalpr/postprocess/regexrule.cpp
index c4bf857..be2871f 100644
--- a/src/openalpr/postprocess/regexrule.cpp
+++ b/src/openalpr/postprocess/regexrule.cpp
@@ -75,11 +75,11 @@ namespace alpr
}
else if (utf_character == "@")
{
- this->regex = this->regex + "\\p{Alpha}";
+ this->regex = this->regex + "\p{Alpha}";
diff --git a/src/openalpr/support/timing.cpp b/src/openalpr/support/timing.cpp
index 82c8374..d0a8055 100644
--- a/src/openalpr/support/timing.cpp
+++ b/src/openalpr/support/timing.cpp
@@ -67,7 +67,7 @@ namespace alpr
microseconds = (double)t.QuadPart / frequencyToMicroseconds;
t.QuadPart = microseconds;
tv->tv_sec = t.QuadPart / 1000000;
- tv->tv_usec = t.QuadPart % 1000000;
+ tv->tv_nsec = t.QuadPart % 1000000;
@peters
peters / jquery-bootstrap-browserify.js
Created September 3, 2016 13:21 — forked from MiguelCastillo/jquery-bootstrap-browserify.js
Adding require jquery to bootstrap via a browserify transform
var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var through = require('through');
var libs = ['jquery', 'bootstrap'];
gulp.task('app-bundle', function() {
var appBundler = browserify(['./app.js']);
libs.forEach(function(lib) {
@peters
peters / gist:4911498c57826d7052a32d874a62e6e2
Created October 31, 2016 19:03
1N5fwe9QCuxJM7y1ThagJiBz11KvKysvZv
1N5fwe9QCuxJM7y1ThagJiBz11KvKysvZv
@peters
peters / mongodb_ssl_with_letsencrypt.md
Created February 1, 2017 07:46 — forked from leommoore/mongodb_ssl_with_letsencrypt.md
MongoDB 3.2.x SSL with Letsencrypt

#MongoDB 3.2.x SSL with Letsencrypt Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

##Set the hostname We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname mongo0.example.com

Then update the hostname file to set the server name permanently.