Showing all posts by xuan
Stremio addons

RARBG – http://rarbg.best4stremio.space/stremio/v1
TPB+ – https://thepiratebay-plus.strem.fun
Juan Carlos – http://juan.best4stremio.space
Torrentio – https://torrentio.strem.fun/configure
https://danamag.github.io/stremio-addons-list/

Posted on May 26, 2022, 10:02 pm By
Categories: tech tips Tags:
AutoIT program to screen capture via command line
#Region ; Make 64Bit EXE
#AutoIt3Wrapper_UseX64=y
#EndRegion
;screencapture library
#include <ScreenCapture.au3>
;dos mode on
#pragma compile(Console, True)



ConsoleWrite(@CRLF & 'Screen capture tool written by Juan Calderon v.1.1 x64 24.04.22' & @CRLF)
ConsoleWrite('Distributed as is, free to use for commercial and non-commercial use. ')
ConsoleWrite('Source: https://xuan.guru/?p=342' & @CRLF & @CRLF)

Sleep (500)

; call the capture routine
Smile()

Func Smile()

		;command line parameter
		Local $tell_me_where_save_it, $rezX , $rezY, $rezX1 , $rezY2


		; if I have one parameter then lets take the screenshot
		if $cmdline[0]=5 Then

			;grab the one parameter, the path/filename
			$tell_me_where_to_save_it=$cmdLine[1]
			;grab coordinates data
			$rezX = $cmdLine[2]
			$rezY = $cmdLine[3]
			$rezX1 = $cmdLine[4]
			$rezY1 = $cmdLine[5]


			_ScreenCapture_Capture($tell_me_where_to_save_it,$rezX,$rezY,$rezX1,$rezY1)
			ConsoleWrite('Screen capture taken, saved to file ' & $tell_me_where_to_save_it & '.' & @CRLF)

			;If you dont hear a beep then something went wrong
			if @error Then
			Else
				Beep(500, 650)
			EndIf

		;So you didn't give me 5 parameters or too many
		Else
			; quick help comment.
			ConsoleWrite('Usage: cap filename.jpg coord_start_X coord_start_Y coord_end_X coord_start_Y' & @CRLF & @CRLF)
			ConsoleWrite('cap myscreen.jpg 0 0 1280 1080                   - capture main screen 1080p' & @CRLF & 'cap d:\save_here\myscreen.jpg -1280 0 0 -1080    - capture secondary screen to the left' & @CRLF)
		EndIf

EndFunc   ;Done

download windows binary x64

download source code

autoIT website

ChangeLog

V1.1 24.04.22
- Tiny delay added so the console write would be given time to print before capture takes place otherwise on some systems it truncates the message.
- Audio alert, a beep sound is make if no errors took place, if you dont hear anything then something went wrong saving the file.

V1 23.03.22
- Bugs persisted where it would not detect the resolution correctly on some systems, to bypass this I implemented passing capture region parameters to make it manual.


Known bugs
-Using display docks confuse the program, its likely I will never resolve this. 
Posted on March 27, 2022, 5:52 pm By
Categories: tech tips Tags: ,
Take a screenshot via command line

https://github.com/npocmaka/batch.scripts/blob/master/hybrids/.net/c/screenCapture.bat

This script will make an exe that can take a screenshot of the screen using command line

// 2>nul||@goto :batch
/*
:batch
@echo off
setlocal

:: find csc.exe
set “csc=”
for /r “%SystemRoot%\Microsoft.NET\Framework\” %%# in (“*csc.exe”) do set “csc=%%#”

if not exist “%csc%” (
echo no .net framework installed
exit /b 10
)

if not exist “%~n0.exe” (
call %csc% /nologo /r:”Microsoft.VisualBasic.dll” /out:”%~n0.exe” “%~dpsfnx0” || (
exit /b %errorlevel%
)
)
%~n0.exe %*
endlocal & exit /b %errorlevel%

*/

// reference
// https://gallery.technet.microsoft.com/scriptcenter/eeff544a-f690-4f6b-a586-11eea6fc5eb8

using System;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Drawing.Imaging;
using System.Collections.Generic;
using Microsoft.VisualBasic;

/// Provides functions to capture the entire screen, or a particular window, and save it to a file.

public class ScreenCapture
{

/// Creates an Image object containing a screen shot the active window 

public Image CaptureActiveWindow()
{
    return CaptureWindow(User32.GetForegroundWindow());
}

/// Creates an Image object containing a screen shot of the entire desktop 

public Image CaptureScreen()
{
    return CaptureWindow(User32.GetDesktopWindow());
}

/// Creates an Image object containing a screen shot of a specific window 

private Image CaptureWindow(IntPtr handle)
{
    // get te hDC of the target window 
    IntPtr hdcSrc = User32.GetWindowDC(handle);
    // get the size 
    User32.RECT windowRect = new User32.RECT();
    User32.GetWindowRect(handle, ref windowRect);
    int width = windowRect.right - windowRect.left;
    int height = windowRect.bottom - windowRect.top;
    // create a device context we can copy to 
    IntPtr hdcDest = GDI32.CreateCompatibleDC(hdcSrc);
    // create a bitmap we can copy it to, 
    // using GetDeviceCaps to get the width/height 
    IntPtr hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc, width, height);
    // select the bitmap object 
    IntPtr hOld = GDI32.SelectObject(hdcDest, hBitmap);
    // bitblt over 
    GDI32.BitBlt(hdcDest, 0, 0, width, height, hdcSrc, 0, 0, GDI32.SRCCOPY);
    // restore selection 
    GDI32.SelectObject(hdcDest, hOld);
    // clean up 
    GDI32.DeleteDC(hdcDest);
    User32.ReleaseDC(handle, hdcSrc);
    // get a .NET image object for it 
    Image img = Image.FromHbitmap(hBitmap);
    // free up the Bitmap object 
    GDI32.DeleteObject(hBitmap);
    return img;
}

public void CaptureActiveWindowToFile(string filename, ImageFormat format)
{
    Image img = CaptureActiveWindow();
    img.Save(filename, format);
}

public void CaptureScreenToFile(string filename, ImageFormat format)
{
    Image img = CaptureScreen();
    img.Save(filename, format);
}

static bool fullscreen = true;
static String file = "screenshot.bmp";
static System.Drawing.Imaging.ImageFormat format = System.Drawing.Imaging.ImageFormat.Bmp;
static String windowTitle = "";

static void parseArguments()
{
    String[] arguments = Environment.GetCommandLineArgs();
    if (arguments.Length == 1)
    {
        printHelp();
        Environment.Exit(0);
    }
    if (arguments[1].ToLower().Equals("/h") || arguments[1].ToLower().Equals("/help"))
    {
        printHelp();
        Environment.Exit(0);
    }

    file = arguments[1];
    Dictionary<String, System.Drawing.Imaging.ImageFormat> formats =
    new Dictionary<String, System.Drawing.Imaging.ImageFormat>();

    formats.Add("bmp", System.Drawing.Imaging.ImageFormat.Bmp);
    formats.Add("emf", System.Drawing.Imaging.ImageFormat.Emf);
    formats.Add("exif", System.Drawing.Imaging.ImageFormat.Exif);
    formats.Add("jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
    formats.Add("jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
    formats.Add("gif", System.Drawing.Imaging.ImageFormat.Gif);
    formats.Add("png", System.Drawing.Imaging.ImageFormat.Png);
    formats.Add("tiff", System.Drawing.Imaging.ImageFormat.Tiff);
    formats.Add("wmf", System.Drawing.Imaging.ImageFormat.Wmf);


    String ext = "";
    if (file.LastIndexOf('.') > -1)
    {
        ext = file.ToLower().Substring(file.LastIndexOf('.') + 1, file.Length - file.LastIndexOf('.') - 1);
    }
    else
    {
        Console.WriteLine("Invalid file name - no extension");
        Environment.Exit(7);
    }

    try
    {
        format = formats[ext];
    }
    catch (Exception e)
    {
        Console.WriteLine("Probably wrong file format:" + ext);
        Console.WriteLine(e.ToString());
        Environment.Exit(8);
    }


    if (arguments.Length > 2)
    {
        windowTitle = arguments[2];
        fullscreen = false;
    }

}

static void printHelp()
{
    //clears the extension from the script name
    String scriptName = Environment.GetCommandLineArgs()[0];
    scriptName = scriptName.Substring(0, scriptName.Length);
    Console.WriteLine(scriptName + " captures the screen or the active window and saves it to a file.");
    Console.WriteLine("");
    Console.WriteLine("Usage:");
    Console.WriteLine(" " + scriptName + " filename  [WindowTitle]");
    Console.WriteLine("");
    Console.WriteLine("filename - the file where the screen capture will be saved");
    Console.WriteLine("     allowed file extensions are - Bmp,Emf,Exif,Gif,Icon,Jpeg,Png,Tiff,Wmf.");
    Console.WriteLine("WindowTitle - instead of capture whole screen you can point to a window ");
    Console.WriteLine("     with a title which will put on focus and captuted.");
    Console.WriteLine("     For WindowTitle you can pass only the first few characters.");
    Console.WriteLine("     If don't want to change the current active window pass only \"\"");
}

public static void Main()
{
    User32.SetProcessDPIAware();

    parseArguments();
    ScreenCapture sc = new ScreenCapture();
    if (!fullscreen && !windowTitle.Equals(""))
    {
        try
        {

            Interaction.AppActivate(windowTitle);
            Console.WriteLine("setting " + windowTitle + " on focus");
        }
        catch (Exception e)
        {
            Console.WriteLine("Probably there's no window like " + windowTitle);
            Console.WriteLine(e.ToString());
            Environment.Exit(9);
        }


    }
    try
    {
        if (fullscreen)
        {
            Console.WriteLine("Taking a capture of the whole screen to " + file);
            sc.CaptureScreenToFile(file, format);
        }
        else
        {
            Console.WriteLine("Taking a capture of the active window to " + file);
            sc.CaptureActiveWindowToFile(file, format);
        }
    }
    catch (Exception e)
    {
        Console.WriteLine("Check if file path is valid " + file);
        Console.WriteLine(e.ToString());
    }
}

/// Helper class containing Gdi32 API functions 

private class GDI32
{

    public const int SRCCOPY = 0x00CC0020; // BitBlt dwRop parameter 
    [DllImport("gdi32.dll")]
    public static extern bool BitBlt(IntPtr hObject, int nXDest, int nYDest,
      int nWidth, int nHeight, IntPtr hObjectSource,
      int nXSrc, int nYSrc, int dwRop);
    [DllImport("gdi32.dll")]
    public static extern IntPtr CreateCompatibleBitmap(IntPtr hDC, int nWidth,
      int nHeight);
    [DllImport("gdi32.dll")]
    public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
    [DllImport("gdi32.dll")]
    public static extern bool DeleteDC(IntPtr hDC);
    [DllImport("gdi32.dll")]
    public static extern bool DeleteObject(IntPtr hObject);
    [DllImport("gdi32.dll")]
    public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject);
}


/// Helper class containing User32 API functions 

private class User32
{
    [StructLayout(LayoutKind.Sequential)]
    public struct RECT
    {
        public int left;
        public int top;
        public int right;
        public int bottom;
    }
    [DllImport("user32.dll")]
    public static extern IntPtr GetDesktopWindow();
    [DllImport("user32.dll")]
    public static extern IntPtr GetWindowDC(IntPtr hWnd);
    [DllImport("user32.dll")]
    public static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDC);
    [DllImport("user32.dll")]
    public static extern IntPtr GetWindowRect(IntPtr hWnd, ref RECT rect);
    [DllImport("user32.dll")]
    public static extern IntPtr GetForegroundWindow();
    [DllImport("user32.dll")]
    public static extern int SetProcessDPIAware();
}

}

Windows shortcuts

Keyboard shortcut Action
Ctrl + A Select all content.
Ctrl + C (or Ctrl + Insert) Copy selected items to clipboard.
Ctrl + X Cut selected items to clipboard.
Ctrl + V (or Shift + Insert) Paste content from clipboard.
Ctrl + Z Undo an action, including undelete files (limited).
Ctrl + Y Redo an action.
Ctrl + Shift + N Create new folder on desktop or File Explorer.
Alt + F4 Close active window. (If no active window is present, then a shutdown box appears.)
Ctrl + D (Del) Delete selected item to the Recycle Bin.
Shift + Delete Delete the selected item permanently, skipping Recycle Bin.
F2 Rename selected item.
ESC Close current task.
Alt + Tab Switch between open apps.
PrtScn Take a screenshot and stores it in the clipboard.
Windows key + I Open Settings app.
Windows key + E Open File Explorer.
Windows key + A Open Action center.
Windows key + D Display and hide the desktop.
Windows key + L Lock device.
Windows key + V Open Clipboard bin.
Windows key + Period (.) or semicolon (;) Open emoji panel.
Windows key + PrtScn Capture full screenshot in the “Screenshots” folder.
Windows key + Shift + S Capture part of the screen with Snip & Sketch.
Windows key + Left arrow key Snap app or window left.
Windows key + Right arrow key Snap app or window right.

Desktop shortcuts
You can use these keyboard shortcuts to open, close, navigate, and perform tasks more quickly throughout the desktop experience, including the Start menu, Taskbar, Settings, and more.

Keyboard shortcut Action
Windows key (or Ctrl + Esc) Open Start menu.
Ctrl + Arrow keys Change Start menu size.
Ctrl + Shift + Esc Open Task Manager.
Ctrl + Shift Switch keyboard layout.
Alt + F4 Close active window. (If no active window is present, then a shutdown box appears.)
Ctrl + F5 (or Ctrl + R) Refresh current window.
Ctrl + Alt + Tab View open apps.
Ctrl + Arrow keys (to select) + Spacebar Select multiple items on desktop or File Explorer.
Alt + Underlined letter Runs command for the underlined letter in apps.
Alt + Tab Switch between open apps while pressing Tab multiple times.
Alt + Left arrow key Go back.
Alt + Right arrow key Go forward.
Alt + Page Up Move up one screen.
Alt + Page Down Move down one screen.
Alt + Esc Cycle through open windows.
Alt + Spacebar Open context menu for the active window.
Alt + F8 Reveals typed password in Sign-in screen.
Shift + Click app button Open another instance of an app from the Taskbar.
Ctrl + Shift + Click app button Run app as administrator from the Taskbar.
Shift + Right-click app button Show window menu for the app from the Taskbar.
Ctrl + Click a grouped app button Cycle through windows in the group from the Taskbar.
Shift + Right-click grouped app button Show window menu for the group from the Taskbar.
Ctrl + Left arrow key Move the cursor to the beginning of the previous word.
Ctrl + Right arrow key Move the cursor to the beginning of the next word.
Ctrl + Up arrow key Move the cursor to the beginning of the previous paragraph
Ctrl + Down arrow key Move the cursor to the beginning of the next paragraph.
Ctrl + Shift + Arrow key Select block of text.
Ctrl + Spacebar Enable or disable Chinese IME.
Shift + F10 Open context menu for selected item.
F10 Enable app menu bar.
Shift + Arrow keys Select multiple items.
Windows key + X Open Quick Link menu.
Windows key + Number (0-9) Open app in number position from the Taskbar.
Windows key + T Cycle through apps in the Taskbar.
Windows key + Alt + Number (0-9) Open Jump List of the app in number position from the Taskbar.
Windows key + D Display and hide the desktop.
Windows key + M Minimize all windows.
Windows key + Shift + M Restore minimized windows on the desktop.
Windows key + Home Minimize or maximize all but the active desktop window.
Windows key + Shift + Up arrow key Stretch desktop window to the top and bottom of the screen.
Windows key + Shift + Down arrow key Maximize or minimize active desktop windows vertically while maintaining width.
Windows key + Shift + Left arrow key Move active window to monitor on the left.
Windows key + Shift + Right arrow key Move active window to monitor on the right.
Windows key + Left arrow key Snap app or window left.
Windows key + Right arrow key Snap app or window right.
Windows key + S (or Q) Open Search.
Windows key + Alt + D Open date and time in the Taskbar.
Windows key + Tab Open Task View.
Windows key + Ctrl + D Create new virtual desktop.
Windows key + Ctrl + F4 Close active virtual desktop.
Windows key + Ctrl + Right arrow Switch to the virtual desktop on the right.
Windows key + Ctrl + Left arrow Switch to the virtual desktop on the left.
Windows key + P Open Project settings.
Windows key + A Open Action center.
Windows key + I Open Settings app.
Backspace Return to Settings app home page.

File Explorer shortcuts
File Explorer includes many keyboard shortcuts to help you get things done a little quicker on Windows

This is a list of the most useful shortcuts for File Explorer.

Keyboard shortcut Action
Windows key + E Open File Explorer.
Alt + D Select address bar.
Ctrl + E (or F) Select search box.
Ctrl + N Open new window.
Ctrl + W Close active window.
Ctrl + F (or F3) Start search.
Ctrl + Mouse scroll wheel Change view file and folder.
Ctrl + Shift + E Expands all folders from the tree in the navigation pane.
Ctrl + Shift + N Creates a new folder on desktop or File Explorer.
Ctrl + L Focus on the address bar.
Ctrl + Shift + Number (1-8) Changes folder view.
Alt + P Display preview panel.
Alt + Enter Open Properties settings for the selected item.
Alt + Right arrow key View next folder.
Alt + Left arrow key (or Backspace) View previous folder.
Alt + Up arrow Move up a level in the folder path.
F11 Switch active window full-screen mode.
F5 Refresh the instance of File Explorer.
F2 Rename selected item.
F4 Switch focus to address bar.
F5 Refresh File Explorer’s current view.
F6 Cycle through elements on the screen.
Home Scroll to the top of the window.
End Scroll to the bottom of the window.

Settings page shortcuts
Here’s the list of the keyboard shortcuts you can use in a dialog box legacy settings pages (for example, Folder Options).

Keyboard shortcut Action
Ctrl + Tab Cycles forward through the tabs.
Ctrl + Shift + Tab Cycles back through the tabs.
Ctrl + number of tab Jumps to tab position.
Tab Moves forward through the settings.
Shift + Tab Moves back through the settings.
Alt + underline letter Actions the setting identified by the letter.
Spacebar Checks or clears the option in focus.
Backspace Opens the folder one level app in the Open or Save As dialog.
Arrow keys Select a button of the active setting.

Command Prompt shortcuts
If you use Command Prompt on Windows 10, these keyboard shortcuts will help to work a little more efficiently.

Keyboard shortcut Action
Ctrl + A Select all content of the current line.
Ctrl + C (or Ctrl + Insert) Copy selected items to clipboard.
Ctrl + V (or Shift + Insert) Paste content from clipboard.
Ctrl + M Starts mark mode.
Ctrl + Up arrow key Move the screen up one line.
Ctrl + Down arrow key Move screen down one line.
Ctrl + F Open search for Command Prompt.
Left or right arrow keys Move cursor left or right in the current line.
Up or down arrow keys Cycle through command history of the current session.
Page Up Move cursor one page up.
Page Down Move cursor one page down.
Ctrl + Home Scroll to the top of the console.
Ctrl + End Scroll to the bottom of the console.

Windows key shortcuts
The Windows key combined with other keys allows you to perform many useful tasks, such as launch Settings, File Explorer, Run command, apps pinned in the Taskbar, or open specific features like Narrator or Magnifier. You can also complete tasks like controlling windows, virtual desktops, taking screenshots, locking the computer, and a lot more.

Here’s a list of all the most common keyboard shortcuts using the Windows key.

Keyboard shortcut Action
Windows key Open Start menu.
Windows key + A Open Action center.
Windows key + S (or Q) Open Search.
Windows key + D Display and hide the desktop.
Windows key + L Locks computer.
Windows key + M Minimize all windows.
Windows key + B Set focus notification area in the Taskbar.
Windows key + C Launch Cortana app.
Windows key + F Launch Feedback Hub app.
Windows key + G Launch Game bar app.
Windows key + Y Change input between desktop and Mixed Reality.
Windows key + O Lock device orientation.
Windows key + T Cycle through apps in the Taskbar.
Windows key + Z Switch input between the desktop experience and Windows Mixed Reality.
Windows key + J Set focus on a tip for Windows 10 when applicable.
Windows key + H Open dictation feature.
Windows key + E Open File Explorer.
Windows key + I Open Settings.
Windows key + R Open Run command.
Windows key + K Open Connect settings.
Windows key + X Open Quick Link menu.
Windows key + V Open Clipboard bin.
Windows key + W Open the Windows Ink Workspace.
Windows key + U Open Ease of Access settings.
Windows key + P Open Project settings.
Windows key + Ctrl + Enter Open Narrator.
Windows key + Plus (+) Zoom in using the magnifier.
Windows key + Minus (-) Zoom out using the magnifier.
Windows key + Esc Exit magnifier.
Windows key + Forward-slash (/) Start IME reconversion.
Windows key + Comma (,) Temporarily peek at the desktop.
Windows key + Up arrow key Maximize app windows.
Windows key + Down arrow key Minimize app windows.
Windows key + Home Minimize or maximize all but the active desktop window.
Windows key + Shift + M Restore minimized windows on the desktop.
Windows key + Shift + Up arrow key Stretch desktop window to the top and bottom of the screen.
Windows key + Shift + Down arrow key Maximize or minimize active windows vertically while maintaining width.
Windows key + Shift + Left arrow key Move active window to monitor on the left.
Windows key + Shift + Right arrow key Move active window to monitor on the right.
Windows key + Left arrow key Snap app or window left.
Windows key + Right arrow key Snap app or window right.
Windows key + Number (0-9) Open app in number position in the Taskbar.
Windows key + Shift + Number (0-9) Open another app instance in the number position in the Taskbar.
Windows key + Ctrl + Number (0-9) Switch to the last active window of the app in the number position in the Taskbar.
Windows key + Alt + Number (0-9) Open Jump List of the app in number position in the Taskbar.
Windows key + Ctrl + Shift + Number (0-9) Open another instance as an administrator of the app in the number position in the Taskbar.
Windows key + Ctrl + Spacebar Change previous selected input option.
Windows key + Spacebar Change keyboard layout and input language.
Windows key + Tab Open Task View.
Windows key + Ctrl + D Create a virtual desktop.
Windows key + Ctrl + F4 Close active virtual desktop.
Windows key + Ctrl + Right arrow Switch to the virtual desktop on the right.
Windows key + Ctrl + Left arrow Switch to the virtual desktop on the left.
Windows key + Ctrl + Shift + B Wake up the device when black or a blank screen.
Windows key + PrtScn Capture full screenshot in the “Screenshots” folder.
Windows key + Shift + S Create part of the screen screenshot.
Windows key + Shift + V Cycle through notifications.
Windows key + Ctrl + F Open search for the device on a domain network.
Windows key + Ctrl + Q Open Quick Assist.
Windows key + Alt + D Open date and time in the Taskbar.
Windows key + Period (.) or semicolon (;) Open emoji panel.
Windows key + Pause Show System Properties dialog box.

Posted on February 7, 2022, 10:37 pm By
Categories: tech tips
Barrier – Sharemouse equivalent

https://github.com/debauchee/barrier/wiki

Posted on November 24, 2021, 10:03 pm By
Categories: tech tips Tags:
Yealink – Adjusting the sending volume (outgoing volume) on the T2, T4 and T5 Series Phones

Log into the web interface of the phone, in the audio tab, in the section highlighted change the values, 0 is default, -50 to 50 is the range.

Youtube to MP3 on android

Get F-Droid – Install Newline

move all mp4 files into dated directory

The objective of this bat file is recursive search for MP4s in a source folder and move them into a single dated folder.

@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"

set "datestamp=%YYYY%%MM%%DD%" & set "timestamp=%HH%%Min%%Sec%"
set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
echo datestamp: "%datestamp%"
echo timestamp: "%timestamp%"
echo fullstamp: "%fullstamp%"


FOR /R "X:\SOURCE" %%i IN (*.mp4) DO (
MD "X:\DESTINATION\%datestamp%\"
MOVE "%%i" "X:\DESTINATION\%datestamp%\")

rem delete the source files left over and folders
x:
cd "X:\SOURCE"

del * /S /q

rd /s /q .

PHP Script to email a SQL database backup
<?php
// Create the mysql backup file
// edit this section
ini_set("memory_limit","40M");
$dbhost = "xxx.com"; // usually localhost
$dbuser = "username";
$dbpass = "pass";
$dbname = "db";

// don't need to edit below this section

$backupfile = $dbname . date("d-m-Y") . '.sql';
$backupzip = $backupfile . '.tar.gz';
system("mysqldump --opt --no-create-db -h $dbhost -u $dbuser -p$dbpass $dbname > $backupfile");
system("tar -czvf $backupzip $backupfile");


$fileatt = $backupzip; // Path to the file
$fileatt_type = "application/octet-stream"; // File Type
$fileatt_name = $backupzip; // Filename that will be used for the file as the attachment

$email_from = "from_me@xxx.com"; // Who the email is from
$email_subject = "Subject with date".date("d-m-Y"); // The Subject of the email
$email_txt = ""; // Message that the email has in it

$email_to = "to_whom@xxx.com"; // Who the email is too

$headers = "From: ".$email_from;

$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);

$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";

$email_message .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$email_message . "\n\n";

$data = chunk_split(base64_encode($data));

$email_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";

$ok = @mail($email_to, $email_subject, $email_message, $headers);

if($ok) {
echo "<font face=verdana size=2>The file was successfully sent!</font>";
} else {
die("Sorry but the email could not be sent. Please go back and try again!");
} 


// Delete the file from your server
unlink($backupfile);
unlink($backupzip);
?>
Abandonware site

https://vetusware.com/

Tapedisk Pro Mounts SCSI DAT as HD on DOS and Windows 95

TapeDisk 6.5.4 for Windows 3.1 and Windows ’95 Final

https://vetusware.com/download/TapeDisk%206.5.4%20for%20Windows%203.1%20and%2095%206.5.4/?id=5843

Next Page