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 / remove-wolfssl-config.pl
Last active November 1, 2024 17:43
This script removes wolfSSL configurations from the legacy Visual Studio curl projects in the projects directory.
#!/usr/bin/env perl
=begin comment
README
This script removes wolfSSL configurations from the legacy Visual Studio
curl projects in the projects directory.
Copyright (C) 2024 Jay Satiro <[email protected]>
https://curl.se/docs/copyright.html
@jay
jay / test-RtlGetNtVersionNumbers.c
Last active March 22, 2024 22:06
test of GetVersionExW, RtlGetVersion and RtlGetNtVersionNumbers on Windows 11.
/*
test of GetVersionExW, RtlGetVersion and RtlGetNtVersionNumbers on Windows 11.
can be built with cygwin/mingw/mingw-w64 gcc or microsoft cl.
https://cygwin.com/pipermail/cygwin/2024-March/255728.html
---
without manifest:
@jay
jay / getaddrinfo.c
Last active February 19, 2024 20:42
Use getaddrinfo to retrieve addresses the same way libcurl does.
/* Use getaddrinfo to retrieve addresses the same way libcurl does.
Usage: getaddrinfo [-u] [-4|-6] [--] <host> [service|port]
curl bug report:
'Cannot resolve named proxy host when configured with async DNS'
https://github.com/curl/curl/issues/12955
* Copyright (C) 2024 Jay Satiro <[email protected]>
https://curl.se/docs/copyright.html
@jay
jay / change_openssl_lib_names.pl
Last active March 1, 2021 08:31
Update curl project file templates for OpenSSL 1.1.x
#!/usr/bin/env perl
=begin comment
README
./change_openssl_lib_names.pl
This script was written to update Windows project file templates in the curl
repo. It changes the OpenSSL libnames from 1.0.x to 1.1.x:
@jay
jay / multi_synchronous.cpp
Last active February 10, 2021 22:54
Use libcurl to test synchronous transfers in a multi.
/* Use libcurl to test synchronous transfers in a multi.
Usage: multi_synchronous
This is a demonstration of a repeated synchronous transfer done in a multi
by creating a separate easy handle for each transfer. Normally you would not
do this, you'd use curl_easy_perform in a loop instead.
I forget what curl issue I wrote this in response to.
@jay
jay / utf8_encoded_example.bat
Last active January 17, 2021 07:04
Example of a UTF-8 encoded batch file.
:: Example of a UTF-8 encoded batch file.
::
:: Usage: utf8_encoded_example.bat
::
:: Ref: https://github.com/curl/curl/issues/6386#issuecomment-761745450
::
:: Public Domain: No License. Written by Jay Satiro <[email protected]>
::
:: https://gist.github.com/jay/731030525b58ae3845b7ba59c0757b3c
::
@jay
jay / hooktest2.cpp
Last active November 24, 2023 21:43
Monitor *raw* mouse buttons and keypresses in Windows
/* hooktest2
Monitor *raw* mouse buttons, keypresses, everything but MOUSEMOVE via low level
mouse and keyboard hooks. I wrote this to help identify some bugs in Chrome and
software running on Dell laptops.
The program will exit when the caps lock key is pressed. You can change that in
the LowLevelKeyboardProc function.
g++ -Wall -o hooktest2 hooktest2.cpp && hooktest2
@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`