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
#define PCRE2_STATIC 1 | |
#define PCRE2_CODE_UNIT_WIDTH 8 | |
#define _CRT_SECURE_NO_WARNINGS 1 | |
/* | |
* Mask Visa or Mastercard PAN in buffer | |
* | |
* pattern (4\\d{5}|5[12345]\\d{4})\\d{6}(\\d{4}) | |
* subject "____5500000000000327____4000000000000001____5500000000000327__" |
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
# https://msendpointmgr.com/2014/08/22/how-to-get-msi-file-information-with-powershell/ | |
# | |
#.\Get-MSIFileInformation.ps1 -path C:\tmp\forticlient\FortiClient.msi | |
# | |
#Name Value | |
#---- ----- | |
#Manufacturer Fortinet Technologies Inc | |
#ProductName FortiClient | |
#ProductLanguage 1033 | |
#ProductVersion 7.2.4.0972 |
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
var crypto = require('crypto'); | |
// openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 | |
// remove password | |
// openssl rsa -in key.pem -out priv.pem | |
// sign | |
// openssl dgst -sha256 -sign priv.pem -out sha256.sign myfile.txt | |
// extract public key | |
// openssl x509 -pubkey -in cert.pem -out pub.pem -noout | |
// verify |
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
# Normalize UNC path | |
# eg. \\?\UNC\server\share\project\mysite\config.toml => \\server\share\project\mysite\config.toml | |
let mut psz_path_out: [u16; 260] = [0; 260]; | |
let s = "\\\\?\\UNC\\server\\share\\project\\*mysite\\config.toml"; | |
let mut v: Vec<u16> = s.encode_utf16().collect(); | |
v.push(0); | |
let psz_path_int = PCWSTR(v.as_ptr()); | |
if let Err(err) = PathCchCanonicalizeEx(&mut psz_path_out, psz_path_int, dw_flags as u32) { |
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
<!DOCTTYPE html> | |
<html> | |
<head> | |
<style> | |
.blob-num::before { | |
content: attr(data-line-number) | |
} | |
</style> | |
</head> |
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
# Try to find the jansson libraries | |
# | |
# Redistribution and use is allowed according to the terms of the New | |
# BSD license. | |
# Copyright (C) 2022 Arnaud Grandville France <agrandville@gmail.com> | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# |
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 <windows.h> | |
#include <shlwapi.h> | |
#pragma comment(lib, "Shlwapi.lib") | |
LPCSTR basename(LPCSTR filename) { | |
return PathFindFileName(filename); | |
} | |
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
curl -s https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest | | |
jq '.assets[] | select(.name | test(".*linux_amd64$")) | .browser_download_url' | | |
xargs curl -sLo local-php-security-checker |
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
get_cmake_property(_variableNames VARIABLES) | |
foreach (_variableName ${_variableNames}) | |
message(STATUS "${_variableName}=${${_variableName}}") | |
endforeach() |
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
#!/usr/bin/env python2 | |
from xml.etree import ElementTree | |
from datetime import datetime | |
#if len(sys.argv) != 2: | |
# print("\033[0;31merror: version missiong") | |
# exit(1) | |
Outputformat='xml' | |
OutputExtension=".xml" |
NewerOlder