Skip to content

Instantly share code, notes, and snippets.

View DiracSpace's full-sized avatar
:shipit:
Hacking the world, one 0x41414141 at a time

Roberto de León DiracSpace

:shipit:
Hacking the world, one 0x41414141 at a time
  • Asterias Software Solutions
  • San Luis Potosi
  • X @0x0302
View GitHub Profile
@DiracSpace
DiracSpace / import.sh
Created August 26, 2023 23:41
Script for importing multiple collections in JSON format into MongoDB using CLI
#! /bin/bash
find -- *.json | sed 's/.json$//' | while read -r col; do
echo "importing $col"
mongoimport -d edgraph -c "$col" --file "$col.json" --jsonArray
done
<#
Uses the dotnet tool for determining NuGet package
vulnerabilities inside a project solution by checking all
available csproj files.
#>
function Find-Vulnerabilities {
param (
[Parameter(Mandatory = $false)]
[string] $FilePath,
[Parameter(Mandatory = $false)]
@DiracSpace
DiracSpace / README.md
Created August 4, 2023 18:42 — forked from taxilian/README.md
Mongodb scripts for incremental backup

Introduction

I can't take credit for much of the work here -- I adapted it from this blog post: https://tech.willhaben.at/mongodb-incremental-backups-dff4c8f54d58

My main contribution was to make it a little easier to use with docker as well as numerous little cleanup tasks. I also made it gzip the oplog backups and added support for SSL connections

Note that I havne't yet tested the point in time restore script; it likely needs work, particularly to make things work with the gzipped oplog files

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

using Asterias.Application.Providers;
using Microsoft.AspNetCore.Http;
namespace Asterias.Infrastructure.Providers.File.LocalFileProvider
{
public class LocalFileProvider : IFileProvider
{
/// <summary>
/// Used for limiting amount of buffer
/// in memory
@DiracSpace
DiracSpace / install-AzCopy.sh
Created June 23, 2023 18:26 — forked from aessing/install-AzCopy.sh
Install AzCopy on Linux
#!/bin/bash
# Download, extract and make executable
sudo bash -c 'cd /usr/local/bin; curl -sSL https://aka.ms/downloadazcopy-v10-linux | tar --strip-components=1 --exclude=*.txt -xzvf -; chmod +x azcopy'
@DiracSpace
DiracSpace / why-tcl.md
Created June 21, 2023 00:11 — forked from nat-418/why-tcl.md
Why Tcl?

Why Tcl?

Introduction

I use [Tcl] as my scripting language of choice, and recently someone asked me why. This article is an attempt to answer that question.

Ousterhout's dichotomy claims that there are two general categories of programming languages:

These are manual instructions on enabling SSH access on your Steam Deck, adding public key authentication, and removing the need for a sudo password for the main user (deck).

This gist assumes the following:

  • you have a Steam Deck
  • you have a home PC with access to a Linux shell that can ssh, ssh-keygen, and ssh-copy-id
  • your Steam Deck and home PC are on the same local network, with standard SSH traffic (tcp/22) allowed over that network from the PC to the Steam Deck

NOTE: @crackelf on reddit mentions that steamOS updates blow away everything other than /home, which may have the following effects:

  • removing the systemd config for sshd.service, which would prevent the service from automatically starting on boot
  • removing the sudoers.d config, which would reenable passwords for sudo

How to install Windows 10 on KVM-based virtualization environment

Instructions

  1. Download virtio-win.iso for KVM drivers
  2. Run qemu manually, don't relay on libvirt
qemu-system-x86_64 --enable-kvm \
 -smp 4 -m 4096 -cpu host -vga qxl \
# USE THIS SCRIPT TO UPLOAD LARGE .PBIX FILES TO POWER BI REPORT SERVER
#
# I needed to manually construct the form-data as PowerShell doesn't appear to have full support for
# this yet, though it appears to be coming soon.
#CREDENTIALS
[string]$userName = 'BIWIN\MS'
[string]$userPassword = 'xxxxxxxxxxxxx'
[securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($userName, $secStringPassword)