Skip to content

Instantly share code, notes, and snippets.

View jay's full-sized avatar
🇺🇸

Jay Satiro jay

🇺🇸
  • New Rochelle, New York, United States
View GitHub Profile
@jay
jay / add_crypt32.pl
Last active June 4, 2020 07:33
Add crypt32.lib to AdditionalDependencies in curl project templates
#!/usr/bin/env perl
=begin comment
README
./add-crypt32.pl
This script was written to fix Windows project file templates in the curl repo.
It adds crypt32.lib to any additional dependency list that contains
ssleay32.lib (OpenSSL), if it is not there already. crypt32 is now usually
@jay
jay / CurrentSpeed.c
Last active February 20, 2020 22:37
Use libcurl to show the current speed while transferring a file.
/* Use libcurl to show the current speed while transferring a file.
Usage: CurrentSpeed
This example downloads a 200MB file from a speedtest server and shows the
current speed during the download. The current speed is updated approximately
once every second based on the last 5 seconds. The file is not saved to disk.
The bulk of the code in this example came from libcurl's lib/progress.c.
https://github.com/curl/curl/blob/curl-7_68_0/lib/progress.c
@jay
jay / multi_vs_easy.cpp
Last active October 31, 2021 05:09
Use libcurl to test multi vs easy performance.
/* Use libcurl to test multi vs easy performance.
Usage: multi_vs_easy
This program compares the different methods that can be used to make transfers
to the same host. The code was written only for the purpose of comparison of
the different methods.
g++ -o multi_vs_easy multi_vs_easy.cpp `curl-config --cflags --libs`
@jay
jay / test-schannel-ciphers.pl
Last active March 20, 2019 07:00
Test which Schannel (Windows SSL) ciphers work for curl --ciphers
#!/usr/bin/env perl
=begin comment
README
./test-schannel-ciphers.pl <CIPHERS.md> <curl> <host | ssl-url>
Test which Schannel (Windows SSL) ciphers work for curl --ciphers
Written in response to https://github.com/curl/curl/issues/3389
@jay
jay / FixPEChecksum.cpp
Last active June 17, 2023 06:10
FixPEChecksum fixes the PE checksum in 32-bit and 64-bit PE files.
/* FixPEChecksum fixes the PE checksum in 32-bit and 64-bit PE files.
Usage: FixPEChecksum [--no-csv-header] [--dryrun] [--] <file> [[file]...]
cl /W4 FixPEChecksum.cpp
Copyright (C) 2018 Jay Satiro <raysatiro@yahoo.com>
All rights reserved. License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
@jay
jay / ShowIPPort.c
Last active December 14, 2017 07:39
Use libcurl to show the local port and IP address in the progress function.
/* Use libcurl to show the local port and IP address in the progress function.
Usage: ShowIPPort <URL> [filename]
If filename is specified then the data received is saved to filename.tmp which
is then renamed to filename if the download was successful (2xx) or deleted if
not.
If filename is not specified then the data received is sent to stdout. If
stdout is attached to a tty and the data received appears to be binary data
@jay
jay / setbrightness.bat
Last active November 10, 2017 05:02
Set the AC & DC brightness in the current power scheme.
:: Set the AC & DC brightness in the current power scheme.
::
:: Usage: "setbrightness.bat" <brightness-level>
::
:: Based on https://stackoverflow.com/a/26766798
:: Also see https://github.com/HubKing/LinkBrightness
::
:: Public Domain: No License. Written by Jay Satiro <raysatiro@yahoo.com>
::
:: https://gist.github.com/jay/2c4ca23314f1ed31c24da390d86c2b23
@jay
jay / ParseStream.c
Last active August 24, 2023 09:53
Parse a stream received by libcurl into sections.
/* Parse a stream received by libcurl into sections.
Usage: ParseStream
This program is the same as libcurl example getinmemory.c except that it also
parses the received data into sections.
A data section refers to attributes and data and is received in this format:
[[<4 bytes: attribute size><attributes><8 bytes: data size><data>]...]
@jay
jay / getargs.c
Last active January 19, 2021 07:54
Display how arguments are parsed in Windows
/*
Display how arguments are parsed in Windows.
VS 2010 x86:
cl /nologo /W4 getargs.c /MD /Fegetargs-cl && getargs-cl
VS 2010 x86, for win2k compatibility build against the WinDDK:
cl /nologo /W4 getargs.c /MD /Fegetargs-cl C:\WinDDK\7600.16385.1\lib\win7\i386\msvcrt_win2000.obj /IC:\WinDDK\7600.16385.1\inc\crt /link /SUBSYSTEM:CONSOLE,5.00 /OSVERSION:5.00 /LIBPATH:C:\WinDDK\7600.16385.1\lib\Crt\i386 && getargs-cl
mingw x86:
@jay
jay / Test-DLL-atexit-handler
Last active March 12, 2024 13:23
Test whether or not a DLL's atexit handler is called on FreeLibrary