excludechars=\`
htpasswd -bnBC 10 "" $(pwgen -sncBy -r "$excludechars" 16 1 | tee /dev/tty | tr -d '\n') | tr -d ':'htpasswd -bnBC 10 ""-buse password from command line
| # Script to shrink docker desktop data, a common issue at WSL 2 | |
| # Most of the script is generated with ChatGPT | |
| # Check if the script is running as administrator | |
| $currentUser = [Security.Principal.WindowsIdentity]::GetCurrent() | |
| $adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator | |
| $currentPrincipal = New-Object Security.Principal.WindowsPrincipal($currentUser) | |
| if (-not $currentPrincipal.IsInRole($adminRole)) { | |
| Write-Host "Requesting administrator privileges..." | |
| Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs |
| #!/bin/sh | |
| # helper script to download videos using termux and auto-indexing them | |
| # | |
| # required apps: | |
| # termux: https://f-droid.org/en/packages/com.termux/ | |
| # termux-api: https://f-droid.org/en/packages/com.termux.api/ | |
| # required packages | |
| # termux-api, python: apt install termux-api python python3 |
| #!/bin/bash | |
| currentYearMonth=$(date "+%Y-%m") | |
| echo "Ignoring files from $currentYearMonth" | |
| find . -maxdepth 1 -not -name "archive.sh" -print0 | while read -d $'\0' file | |
| do | |
| excludeDate=0 | |
| [[ "$file" =~ [0-9]{4}-[0-9]{2} ]] && excludeDate=1 |
| #!/bin/bash | |
| #--------------------------------------------------------------------------------# | |
| # # | |
| # Fix WSL DNS resolution with Cisco AnyConnect # | |
| # # | |
| # ! Don't forget to set this configuration in /etc/wsl.conf: # | |
| # [network] # | |
| # generateResolvConf = false # | |
| # # | |
| # Based on: # |
| # CREATES 100 notifications in your desktop, super dangerous script, beware | |
| from notifypy import Notify | |
| import threading | |
| ammount = 100 | |
| def notify(num): | |
| notification = Notify() | |
| notification.title = "Cool Title: " + str(num) |
| #include <iostream> | |
| #include <vector> | |
| #include "sortalgs.h" | |
| int main(int argc, char **argv) { | |
| std::vector<int> v = {1, 5, 2, 3, -3, -2, -1, 0, 3, 1}; | |
| sortalg<Bubble>::sort(v.begin(), v.end()); | |
| auto start = v.begin(); |
| var capitalByState = { | |
| 'MG': 'Belo Horizonte', | |
| 'PR': 'Curitiba', | |
| 'SP': 'São Paulo' | |
| } // Allocated only one time and the data isn't INSIDE the function | |
| // so 'capitalByState' can come from a external source! | |
| var States = {}; | |
| States.getCapitalCity = state => capitalByState[state] || 'Not Found'; // Again, allocated only one time, simulates static |
| // ==UserScript== | |
| // @name New Userscript | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match *://*/* | |
| // @grant none | |
| // @require https://code.jquery.com/jquery-3.4.1.slim.min.js | |
| // ==/UserScript== |
| package net.matbm.forca; | |
| import java.util.Scanner; | |
| import static java.lang.System.out; | |
| public class Main { | |
| public static void main(String[] args) { | |
| String palavra = "otorrinolaringologista"; | |
| int maxErro = 5; |