This file contains 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://imququ.com/post/web-proxy.html | |
var http = require('http'); | |
var net = require('net'); | |
var url = require('url'); | |
function connect(cReq, cSock) { | |
var u = url.parse('http://' + cReq.url); | |
var pSock = net.connect(u.port, u.hostname, function() { | |
cSock.write('HTTP/1.1 200 Connection Established\r\n\r\n'); |
This file contains 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
<# -- UserRights.psm1 -- | |
The latest version of this script is available at https://gallery.technet.microsoft.com/Grant-Revoke-Query-user-26e259b0 | |
VERSION DATE AUTHOR | |
1.0 2015-03-10 Tony Pombo | |
- Initial Release | |
1.1 2015-03-11 Tony Pombo | |
- Added enum Rights, and configured functions to use it |
This file contains 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
// See https://aka.ms/new-console-template for more information | |
using System.Text; | |
using System.Text.RegularExpressions; | |
var lines = File.ReadAllLines("error.txt"); | |
var regex = new Regex(@"(C:\\workspace.+.cs)\((.+),(.+)\): Error CodeAnalyzer0001", RegexOptions.Compiled); | |
Console.WriteLine("start"); | |
var fileRowsDict = new Dictionary<string, List<int>>(); |
This file contains 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
#Generate CA Certificate | |
#Generate private Key | |
openssl genrsa -out CA.key 2048 | |
#Generate CA CSR |
This file contains 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
void Update(DataRow newRow, string connStr, string tableName) | |
{ | |
using MySqlDataAdapter da = new MySqlDataAdapter( | |
$"select * from {tableName}", | |
connStr | |
); | |
da.UpdateCommand = new MySqlCommandBuilder(da).GetUpdateCommand(); | |
DataSet ds = new DataSet(); |
This file contains 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
void func() { | |
CDatabase db; | |
CRecordset rs(&db); | |
db.OpenEx("Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\dbo.mdb;"); | |
db.ExecuteSQL("select * from Sporter"); | |
rs.Open(CRecordset::dynaset, "select * from [Sporter]", CRecordset::none); | |
BOOL a = rs.CanAppend(); |
This file contains 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
function Convert-Gbk-To-Utf8($source, $dest) { | |
$gbk = [System.Text.Encoding]::GetEncoding("gb2312") | |
$utf8 = [System.Text.Encoding]::UTF8 | |
$text = [System.IO.File]::ReadAllText($source, $gbk) | |
[System.IO.File]::WriteAllText($dest, $text, $utf8) | |
} |
This file contains 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
function Set-TrustAllCertsPolicy { | |
Add-Type @" | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
public class TrustAllCertsPolicy : ICertificatePolicy { | |
public bool CheckValidationResult( | |
ServicePoint srvPoint, X509Certificate certificate, | |
WebRequest request, int certificateProblem) { | |
return true; | |
} |
This file contains 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
$roleAssignments = Get-AzRoleAssignment | |
$roles = Get-AzRoleDefinition | |
# https://docs.microsoft.com/en-us/azure/role-based-access-control/resource-provider-operations | |
$storageActionRegexList = @('^\*$', '^\*/.+$', '^Microsoft\.Storage/.+$') | |
$storageDataActionRegexList = @('^\*$', '^\*/.+$', '^Microsoft\.Storage/.+$') | |
$storageManagementAccessRoles = @() | |
$storageDataAccessRoles = @() |
NewerOlder