Skip to content

Instantly share code, notes, and snippets.

View skarllot's full-sized avatar
💭
I may be slow to respond.

Fabrício Godoy skarllot

💭
I may be slow to respond.
View GitHub Profile
@skarllot
skarllot / full-context-menu-explorer.cmd
Created May 3, 2023 01:42
Manual override through Windows Registry in order to force Explorer to fall back to the classic full menu
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
@skarllot
skarllot / Program.cs
Created April 2, 2023 00:40
Using Azure Cosmos DB and Entity Framework Core
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
namespace CosmosCodeFirstDemo
{
class Program
@skarllot
skarllot / TypeClipboard.md
Last active April 22, 2024 10:06 — forked from ethack/TypeClipboard.md
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

@skarllot
skarllot / nuget_pack_assets.md
Last active January 9, 2020 19:07
Change generated NuSpec dependency 'exclude' and 'include'
IncludeAssets ExcludeAssets PrivateAssets Valid Include Exclude
null null null true Analyzers,Build
null Native null true Analyzers,Build,Native
Compile null null true Analyzers,Build,BuildTransitive,Native,Runtime
Compile;Runtime null null true Analyzers,Build,BuildTransitive,Native
@skarllot
skarllot / tgz2zip.py
Created August 8, 2018 01:34
Pipes the content of GZipped Tar file to a Zip file without temporary files
#!/usr/bin/python
import sys
import tarfile
import zipfile
tarf = tarfile.open(sys.argv[1], "r:*")
zipf = zipfile.ZipFile(sys.argv[2], "w", zipfile.ZIP_DEFLATED, allowZip64 = True)
for m in tarf:
if m.isreg():
zipf.writestr(m.path, tarf.extractfile(m).read())
@skarllot
skarllot / .gitlab-ci.yml
Created June 20, 2018 20:28 — forked from ashalkhakov/.gitlab-ci.yml
Running .NET 3.5 CF builds under Docker for Windows
# this is the GitLab-CI file for building the image
variables:
CURRENT_IMAGE_TAG: rfid-applied/netcf35_build_environment:dev
stages:
- dockerize
dockerize:
stage: dockerize
script:
@skarllot
skarllot / CancellationTokenAsynchronousExtensions.cs
Created April 24, 2018 20:12
Enable await for CancellationToken
using System;
using System.Runtime.CompilerServices;
using System.Threading;
public static class CancellationTokenAsynchronousExtensions
{
public static CancellationTokenAwaiter GetAwaiter(this CancellationToken cancellationToken)
{
return new CancellationTokenAwaiter(cancellationToken);
}
@skarllot
skarllot / AmazonEBConfigurationProvider.cs
Last active November 29, 2019 07:05
Amazon Elastic Beanstalk variables configuration provider implementation for Microsoft.Extensions.Configuration.
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json.Linq;
using System.IO;
using System.Linq;
namespace SklLib.Configuration.Amazon
{
public class AmazonEBConfigurationProvider : ConfigurationProvider
{
private const string ConfigurationFilename = @"C:\Program Files\Amazon\ElasticBeanstalk\config\containerconfiguration";
You can use Visual Studio 2015 to compile to Compact Framework 3.5 by following the instructions below:
- Install the '.NET Compact Framework 3.5 Redistributable';
- Copy files from '*C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE*';
- Paste the files at '*C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\\.NETFramework\v3.5\Profile\CompactFramework*' directory;
- Create a directory named '*RedistList*';
- Create a file named '*FrameworkList.xml*' at '*RedistList*' directory;
- Set the follwing content to the file created:
<?xml version="1.0" encoding="utf-8"?>
@skarllot
skarllot / net35-cf.md
Last active April 19, 2024 11:07
Build .NET Compact Framework 3.5

Install

Force MSBuild support

  • Copy files and directories from 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\*' to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5';
  • Copy files from 'C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\*' to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework' directory;
  • Create 'RedistList' directory inside created 'CompactFramework' directory;
  • Create 'FrameworkList.xml' inside 'RedistList' directory and type the following: