This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "crt.bi" | |
| function merge(c1 as ulong, c2 as ulong, w as single) as ulong | |
| dim as integer r1, g1, b1, r2, g2, b2 | |
| dim as integer m = int(w * 256) | |
| assert(m >= 0 and m < 256) | |
| r1 = c1 shr 16 and 255: r2 = c2 shr 16 and 255 | |
| g1 = c1 shr 8 and 255: g2 = c2 shr 8 and 255 | |
| b1 = c1 and 255: b2 = c2 and 255 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A reverse procedure of Scale2x, as defined by https://www.scale2x.it/algorithm: | |
| ABC | |
| DEF | |
| GHI | |
| B B | |
| D E0 E1 F | |
| D E2 E3 F | |
| H H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # sha256sum each (megabyte-sized) block of /dev/sda, prepend the block number | |
| # intent is to compare two drivesum lists and then dd out the changed blocks and send them to the other drive | |
| device=/dev/sda | |
| bs=1048576 | |
| size=$(blockdev --getsize64 $device) | |
| sumsfile=/tmp/sums_$(date +%s).txt | |
| blocks=$(( ($size+$bs-1)/$bs )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To use: adjust as needed, place in /etc/grub.d, make executable, run 'sudo update-grub' | |
| # Ubuntu | |
| # https://help.ubuntu.com/community/Grub2/ISOBoot/Examples | |
| menuentry 'Ubuntu 12.04 (64-bit)' { | |
| set isofile="/iso/ubuntu-12.04-desktop-amd64.iso" | |
| loopback loop (hd0,1)$isofile | |
| linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject keyboard-configuration/layoutcode=gb | |
| initrd (loop)/casper/initrd.lz | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Foreach ($VM in Get-VM){ | |
| Write-Output $VM.name | |
| Foreach ($HardDrive in $VM.HardDrives){ | |
| $VHDPath = $HardDrive.path | |
| Do { | |
| Write-Output ("- " + $VHDPath) | |
| $VHDPath = (Get-VHD -Path $VHDPath).ParentPath | |
| } While ($VHDPath) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $pass = Read-Host "Password" -AsSecureString; $passplain = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass)) | |
| $sha1 = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider | |
| "*" + [BitConverter]::ToString($sha1.ComputeHash($sha1.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($passplain)))) -replace '-' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/busybox ash | |
| # Woven together by Curaga (2008) | |
| # Changes made remove user interaction and allow serial console and TFTP package loading by Matthew Fearnley (2018) | |
| . /etc/init.d/tc-functions | |
| useBusybox | |
| set -x | |
| set -u | |
| ROOTFS=core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Mandatory = $true)][string]$File, | |
| [Parameter()][int]$Quality = 50 | |
| ) | |
| Add-Type -AssemblyName System.IO.Compression | |
| Add-Type -AssemblyName System.Drawing | |
| $fs = New-Object System.IO.FileStream (Resolve-Path $File), 'Open' | |
| $zip = New-Object System.IO.Compression.ZipArchive $fs, 'Update' | |
| $zip.Entries | ? {$_.FullName -like 'ppt/media/*.png'} | % { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* tvsread.c: lists KEY chunks in video and uncompresses them to ./key1.data, ./key2.data, ... */ | |
| /* See also http://www.jerrysguide.com/tips/demystify-tvs-file-format.html, https://stackoverflow.com/a/53135938/446106 */ | |
| /* Fairly quick and dirty. Tested with a Version 5 video from TeamViewer 13. */ | |
| /* compile with gcc -lz tvsread.c */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <zlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '' see also https://stackoverflow.com/questions/6334917/how-can-i-trim-the-end-of-a-binary-file | |
| '' based in part on http://vbnet.mvps.org/index.html?code/fileapi/truncaterandomfile.htm | |
| Option Explicit | |
| '' constants for CreateFile | |
| Private Const OPEN_ALWAYS As Long = 4, GENERIC_WRITE As Long = &H40000000, GENERIC_READ As Long = &H80000000, FILE_ATTRIBUTE_NORMAL As Long = &H80, INVALID_HANDLE_VALUE As Long = -1 | |
| '' constants for SetFilePointer | |
| Private Const FILE_BEGIN As Long = 0, INVALID_SET_FILE_POINTER As Long = -1 |