This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <functional> | |
#include <queue> | |
#include <chrono> | |
#include <memory> | |
#include <tuple> | |
#include <QTimer> | |
#include <QDateTime> | |
namespace Helpers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename A, typename B, typename Result = decltype(std::declval<const A&>() + std::declval<const B&>())> | |
Result loggedSum(const A& a, const B& b) | |
{ | |
Result result = a + b; // no duplication of the decltype expression | |
LOG_TRACE << a << " + " << b << "=" << result; | |
return result; | |
} | |
//------------------------------------------------------------------- | |
class IdCollection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL Helpers::create_elevated_process_as_logged_user(const wchar_t* lpApplicationName, wchar_t* lpCommandLine) | |
{ | |
BOOL ret_val = FALSE; | |
if (const DWORD session_id = WTSGetActiveConsoleSessionId(); session_id != 0xFFFFFFFF) | |
{ | |
HANDLE h_token = nullptr; | |
if (WTSQueryUserToken(session_id, &h_token)) | |
{ | |
HANDLE h_token_dup = nullptr; | |
if (DuplicateTokenEx(h_token, TOKEN_ALL_ACCESS, nullptr, SecurityImpersonation, TokenPrimary, &h_token_dup)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have just got this working using an ASUS RT-AC86U running merlin 386.7_2, which is behind my ISP supplied router and thus NATed. The phone is a Samsung galaxy S20 plus, recently updated to android 13. Prior to (and post) the update I was successfully using VPN type "IPSec / Xauth PSK" per the asus doco. When looking at ikev2, I changed the VPN type but found the Xauth option was removed when I went to revert...There's a lesson in that :/ | |
Random notes: | |
I have no real idea what I'm doing so take it with a grain of salt but it's connecting and has been up for an hour now. It seemed a bit slow initially but performance seems to have improved. | |
I messed around a lot with the config, some of which may or may not be necessary or secure or recommended. | |
On the router | |
------------- | |
Advanced settings, VPN, VPN Server Tab, IPSec VPN table: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main.cpp | |
#include <QtCore> | |
class Task : public QObject | |
{ | |
Q_OBJECT | |
public: | |
Task(QObject *parent = 0) : QObject(parent) {} | |
public slots: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<QtGlobal> - Global Qt Declarations | |
The <QtGlobal> header file includes the fundamental global declarations. It is included by most other Qt header files. More... | |
Header: #include <QtGlobal> | |
Obsolete members | |
Types | |
typedef QFunctionPointer | |
typedef QtMessageHandler | |
enum QtMsgType { QtDebugMsg, QtInfoMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg } | |
typedef qint8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtCore> | |
class MyTask : public QRunnable | |
{ | |
public: | |
MyTask(int id, int value) : m_id(id), m_value(value) {} | |
void run() override | |
{ | |
qDebug() << "Task" << m_id << "started with value" << m_value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(QMake_QT_INSTALL_HEADERS_)/QtNetwork/$(QtVersion)/QtNetwork/private/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fortunately it is easy to identify randomized MAC addresses. | |
There is a bit which gets set in the OUI portion of a MAC address to signify a randomized / locally administered address. | |
The quick synopsis is look at the second character in a MAC address, | |
if it is a 2, 6, A, or E it is a randomized address. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::regex_match (job_str.toStdString(), std::regex(R"(^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$)" ))) // we have URL |
NewerOlder