Skip to content

Instantly share code, notes, and snippets.

View aeveltstra's full-sized avatar

Ænðr E. Feldstraw aeveltstra

View GitHub Profile
Requires Java 10 or 11.
IDTO:
/**
* Half-DAO architecture to load read-only data structures from a data store,
* and map those to domain objects to be used inside a Java application.
* @author A.E.Veltstra
* @version 2.18.1130.1540
*/
@aeveltstra
aeveltstra / create-scheduled-tasks-using-msdos.bat
Created May 5, 2021 16:42
how to create or update a scheduled task in Windows using CLI or DOS
schtasks /Create /S "server-name" /RU "domain\user" /SC WEEKLY /D FRI /TN "some\scheduled\tasks\path" /TR "C:\Windows\System32\calc.exe" /ST "12:30" /SD "12/06/2019" /ED "12/07/2019" /F /RL LIMITED
@aeveltstra
aeveltstra / how-to-proxy-eclipse-java-through-fiddler.txt
Last active May 5, 2021 16:45
how-to-proxy-eclipse-java-through-fiddler
http://stackoverflow.com/questions/8549749/how-to-capture-https-with-fiddler-in-java
Create a keystore containing the Fiddler certificate. Use this keystore as the truststore for the JVM along with the proxy settings.
Here's how to do that:
Export Fiddler's root certificate
@aeveltstra
aeveltstra / how-to-regenerate-the-java-secure-keystore-and-encryption-key.txt
Created May 5, 2021 16:47
how-to-regenerate-the-java-secure-keystore-and-encryption-key
How to regenerate the Java Secure Keystore and the Secure Encryption Key.
August 6, 2018
André E. Veltstra
New servers will not yet have a keystore with an encryption key that our API consumer applications can use to decrypt user names and passwords that are needed to access our databases and shared file locations. This document explains how to regenerate that. If you regenerate the keystore and the encryption key, you will need to redo the encryption, too.
Note: they keystore is not going to store the user names or passwords themselves. It's going to store an encryption key. That is used to decrypt user names and passwords stored encrypted in configuration files. Each application can use its own keystore and encryption key. Each server can use its own. Which is most appropriate depends on the situation.
(When this document says "JAVA_HOME", it refers to the Java Home folder for the JRE version of java used by the application that needs to access the keystore. )
(This document assumes java version 1
@aeveltstra
aeveltstra / regex-remove-duplicates-from-list.regex
Created May 5, 2021 16:52
regex-remove-duplicates-from-list
^(.*?)$\s+?^(?=.*^\1$)
@aeveltstra
aeveltstra / export-biz-bdds-to-file.ps
Created May 5, 2021 17:00
export-biz-bdds-to-file-using-powershell
Param(
[Parameter(Mandatory=$true, Position=0, HelpMessage='Supply DB user name')][String]${Supply DB user name},
[Parameter(Mandatory=$true, Position=1, HelpMessage='Supply DB password')][SecureString]${Supply DB password}
);
$plainSecret = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR(${Supply DB password}))
$connect_to_biz = "server=server_name;database='db_name';trusted_connection=false;user id='${Supply DB user name}';password='${plainSecret}';";
$getActiveProfiles = "SELECT OBJECT_NAME, REPOSITORY_OBJECT
FROM BizLink4.dbo.EC_REPOSITORY_OBJ with (nolock)
WHERE AREA = 1
and OBJECT_TYPE = 'compiled_bdd'
@aeveltstra
aeveltstra / qlikview-section-access.vbs
Created May 5, 2021 17:44
QlikView Section Access in a Nutshell
///$tab Main
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
@aeveltstra
aeveltstra / email-attachments using-powershell-and-archive-them.ps1
Created July 26, 2021 17:44
How to email attachments using powershell and then archive them
$verbosity_ERROR = 0;
$verbosity_WARN = 1;
$verbosity_VERBOSE = 2;
$verbosity = $verbosity_VERBOSE;
$now = Get-Date -Format s;
$read_from_folder = "\\server\volume\mail\out\user";
$file_patterns = @(
"prefix_*.csv",
@aeveltstra
aeveltstra / poor-mans-guide-to-logging-sql-change-tests-and-results.txt
Created January 27, 2022 16:26
Poor-man's guide to logging SQL change tests and results
1. Create a spreadsheet.
2. Each line is a test.
3. Describe what it is the test tests.
4. Set the expected outcome of the test.
5. Make a column to input the actual test outcome.
6. Make a column to compare 4 and 5, and return 1 in case of equality, and 0 for difference.
7. Make a column to hold the SQL for each test. If you can't create SQL to perform a test, go back to designing the test.
8. Count the amount of tests. Then add up the numbers in the column for point 6.
9. Compare the numbers found in point 8. If equal: all tests succeeded. You could show it as a percentage: how many of the tests succeeded.
10. Save the spreadsheet for future reference.
@aeveltstra
aeveltstra / delete-my-fb-posts.py
Created December 30, 2022 06:05
Delete my Facebook Posts (python, Selenium web driver)
from selenium import webdriver
from selenium.common.exceptions import StaleElementReferenceException
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as conditions
email_address = "my email address for facebook"
password = "my facebook password"
profile_name = "name of my facebook profile"