Skip to content

Instantly share code, notes, and snippets.

@noamnotyou
noamnotyou / vivaldi-force-new-window.cmd
Last active November 20, 2022 06:20
Force Vivaldi browser to open URL links in new windows
@echo off
title New windows for external links, for Vivaldi browser - by noamnotyou
set workdir=%temp%\noamnotyou
set errmsg="Unknown"
set args=--
set nw=--new-window
set im=-incognito
echo.
@DanGough
DanGough / Get-PowerBI.ps1
Last active November 28, 2022 22:56
Powershell web scraper to retrieve latest version and download URLs for Microsoft PowerBI
$ProgressPreference = 'SilentlyContinue'
try {
$Version = ((Invoke-WebRequest 'https://www.microsoft.com/download/details.aspx?id=58494' -UseBasicParsing).Content | Select-String -Pattern 'Version:\s+</div><p>(.+)</p>').Matches.Groups[1].Value
$URL32 = ((Invoke-WebRequest 'https://www.microsoft.com/en-us/download/confirmation.aspx?id=58494' -UseBasicParsing).Links | Where-Object href -like '*PBIDesktopSetup_x64.exe')[0].href
$URL64 = ((Invoke-WebRequest 'https://www.microsoft.com/en-us/download/confirmation.aspx?id=58494' -UseBasicParsing).Links | Where-Object href -like '*PBIDesktopSetup.exe')[0].href
if ($Version -and $URL32) {
[PSCustomObject]@{
Version = $Version
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active May 10, 2024 09:44
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active April 21, 2024 04:49
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
@shinchiro
shinchiro / packages.txt
Last active December 22, 2022 04:39
Missing Cygwin/MSYS2 packages
1. Install re2c
git clone --depth 1 https://github.com/skvadrik/re2c.git
./autogen.sh
./configure --prefix=/usr
make && make install
2. Install ninja
git clone --depth 1 https://github.com/ninja-build/ninja.git
./configure.py --bootstrap
mv ninja.exe /usr/bin
@haggen
haggen / string.random.lua
Last active February 21, 2024 04:16
Random strings in Lua
math.randomseed(os.time())
local charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
function string.random(length)
if length > 0 then
return string.random(length - 1) .. charset:sub(math.random(1, #charset), 1)
else
return ""
end
@ducas
ducas / Create-Administrator.ps1
Last active January 14, 2024 07:18
Create a local administrator account using PowerShell
$Username = "su"
$Password = "password"
$group = "Administrators"
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }
if ($existing -eq $null) {
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@SimonEast
SimonEast / cloudflare.min.js
Created April 4, 2014 07:28
CloudFlare Javascript (including Rocket Loader?)
/*! CloudFlareJS-0.1.11 Tue Mar 11 2014 07:42:08
*/
! function (a, b) {
function c(a) {
if (!(this instanceof c)) return new c(a);
if (!a || !m.isElement(a)) throw new Error("A DOM element reference is required");
return this.element = a, this.tokens = a.classList, this
}
var d = {}, e = "0.1.11",
f = a.setTimeout,
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>Just a moment...</title>
<style type="text/css">