Skip to content

Instantly share code, notes, and snippets.

View Paxxi's full-sized avatar

Pär Björklund Paxxi

View GitHub Profile
@Paxxi
Paxxi / psobjectdemo
Created October 18, 2014 10:27
Create PSObject from hashtable
$IA = New-Object PSObject -Property @{
"ClassCode" = ""
"Semester" = ""
"DataStore" = "FASTDATASTORENAME"
"Cluster" = "IA Program"
"VIServer" = "VSPHERE-SERVER"
"IPBlock" = "10.0.1.0"
"SubnetMask" = "255.255.0.0"
"Connected" = $false
"ResourcePool" = ""
@Paxxi
Paxxi / dhcpdemo
Created October 18, 2014 10:31
Working with pfsense dhcpd.xml in Powershell
#Load our template xml to have something to work with
[xml]$out =[xml]@"
<?xml version="1.0"?>
<dhcpd>
<lan>
<enable/>
<range>
<from>192.168.1.100</from>
<to>192.168.1.199</to>
</range>
@Paxxi
Paxxi / gist:2be7d0cd38c1505a9d76
Created January 6, 2015 14:48
ICU makefile ubunto 12.04
PKG_CHECK_MODULES([ICU_UC], [icu-uc],
[INCLUDES="$INCLUDES -DU_DISABLE_RENAMING=1 $ICU_UC_CFLAGS"; LIBS="$LIBS $ICU_UC_LIBS"],
AC_CHECK_LIB([icuuc],[ucnv_open_48],
[LIBS="$LIBS -licuuc"],
AC_MSG_ERROR($missing_library)))
@Paxxi
Paxxi / crts_caller
Created February 19, 2015 12:37
simpler version without boost
#pragma once
/*
* Copyright (C) 2015 Team Kodi
* http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
@Paxxi
Paxxi / c++init
Created March 10, 2015 15:17
c++ initializer
class
{
private:
int a{10};
string b{"nice"};
}
@Paxxi
Paxxi / capitalize
Created March 15, 2015 12:40
capitalize
refstr = " JuST Another\t\tTEst:\nWoRKs(Test 1 First) ";
varstr = " juST another\t\ttEst:\nwoRKs(test 1 first) ";
StringUtils::ToCapitalize(varstr);
EXPECT_STREQ(refstr.c_str(), varstr.c_str());
refstr = " JuST Another\t\tTEst:\nWoRKs\"Test 1 First\" ";
varstr = " juST another\t\ttEst:\nwoRKs\"test 1 first\" ";
StringUtils::ToCapitalize(varstr);
EXPECT_STREQ(refstr.c_str(), varstr.c_str());
@Paxxi
Paxxi / actlog
Created March 19, 2015 12:02
activitylog
class CActivityLogManager
{
public:
static CActivityLog& GetInstance()
{
static CActivityLogManager s_instance;
return s_instance.GetActivityLog();
}
private:
CActivityLog& GetActivityLog()
char CURL::GetDirectorySeparator() const
{
#ifndef TARGET_POSIX
if ( m_strProtocol.empty() )
return '\\';
else
#endif
return '/';
}
Not Flagged 3360 0 Main Thread Main Thread Kodi.exe!XbmcThreads::ConditionVariable::wait Normal
ntdll.dll!_NtWaitForAlertByThreadId@8()
ntdll.dll!_RtlSleepConditionVariableCS@12()
KernelBase.dll!_SleepConditionVariableCS@12()
Kodi.exe!XbmcThreads::ConditionVariable::wait(CCriticalSection & lock, unsigned long milliseconds) Line 64
Kodi.exe!XbmcThreads::TightConditionVariable<bool volatile &>::wait<CCriticalSection>(CCriticalSection & lock, unsigned long milliseconds) Line 65
Kodi.exe!CEvent::WaitMSec(unsigned int milliSeconds) Line 86
Kodi.exe!CThread::WaitForThreadExit(unsigned int milliseconds) Line 151
Kodi.exe!CThread::StopThread(bool bWait) Line 169
Kodi.exe!CDVDPlayer::CloseFile(bool reopen) Line 680
Running 30s test @ http://192.168.0.82:8000
8 threads and 32 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 5.39ms 6.39ms 68.40ms 90.05%
Req/Sec 32.27k 4.72k 93.77k 70.39%
Latency Distribution
50% 4.31ms
75% 6.79ms
90% 11.74ms
99% 0.00us