1/ Go to ARR Cache, then Server Proxy Settings
2/ Check on Enable proxy
3/ Create a site call AutoACME and add a binding to support autoacme.com port 80
4/ Go to URL Rewrite
-- https://myadventuresincoding.wordpress.com/2013/05/27/sql-server-check-index-fragmentation-on-all-indexes-in-a-database/ | |
SELECT dbschemas.[name] as 'Schema', | |
dbtables.[name] as 'Table', | |
dbindexes.[name] as 'Index', | |
indexstats.alloc_unit_type_desc, | |
indexstats.avg_fragmentation_in_percent, | |
indexstats.page_count | |
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS indexstats | |
INNER JOIN sys.tables dbtables on dbtables.[object_id] = indexstats.[object_id] | |
INNER JOIN sys.schemas dbschemas on dbtables.[schema_id] = dbschemas.[schema_id] |
WebAPI | |
// GET api/values | |
public dynamic Get() | |
{ | |
var root = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; | |
var path = Path.Combine(root, "App_Data/Koala.jpg"); | |
var bytes = File.ReadAllBytes(path); | |
var base64 = Convert.ToBase64String(bytes); |
This contains some steps to start working with RVDB 4.2 | |
1. Download the zip at https://ravendb.net/download | |
2. Unzip to a folder eg D:\Tools\RavenDB\RavenDB-4.2.113-windows-x64 | |
3. Start a PowerShell in Admin mode and change to RVDB folder, execute run.ps1 script | |
4. Go through some simple steps, ignore configuring any server certificate, we can start using RVDB at this address: http://127.0.0.1:8080/studio/index.html |
// Remove multi spaces | |
const string reduceSpaces = @"[ ]{2,}"; | |
var finalText = Regex.Replace(allText.Replace('\t', ' '), reduceSpaces, " "); | |
// Remove empty lines | |
const string emptyLine = @"^\s+$[\r\n]*"; | |
var finalText = Regex.Replace(finalText, emptyLine, string.Empty, RegexOptions.Multiline); |
// source is a byte array | |
using (var reader = new PdfReader(source)) | |
{ | |
using (var output = new StringWriter()) | |
{ | |
for (int i = 1; i <= reader.NumberOfPages; i++) | |
{ | |
output.WriteLine(PdfTextExtractor.GetTextFromPage(reader, i)); | |
} |
# Remove ALL containers | |
docker ps -a -q | % { docker rm $_ } | |
# Stop and then remove all RUNNING containers | |
docker ps -q | % { docker stop $_; docker rm $_ } | |
# Dockerfile command to create a L drive from C:\Logs folder | |
RUN Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'L:' -Value '\??\C:\Logs' -Type String; |
-- Get all db files from a bak | |
RESTORE FILELISTONLY | |
FROM DISK = 'Path to full backup file' | |
GO | |
-- Restore database from a bak with move logical files (note on NORECOVERY) | |
RESTORE DATABASE FindTheBest FROM DISK = 'Path to full backup file' | |
WITH MOVE 'Data file 1' TO 'Path to data file', | |
MOVE 'Log file 1' TO 'Path to log file', | |
NORECOVERY |
In my opinion this is the best way for executing external commands from PowerShell with arguments in a safe manner - via the use of an array to hold the arguments.
Consider this one a PowerShell gem to keep in the toolbox.
Note: the example below makes use of EchoArgs.exe
- a small utility that simply echoes back arguments passed to it. Utility is part of the PowerShell Community Extensions, or the exe alone can be downloaded at http://ss64.com/ps/EchoArgs.exe.
Running example.ps1
yields the following output: