Skip to content

Instantly share code, notes, and snippets.

View OlivierJaquemet's full-sized avatar

Olivier Jaquemet OlivierJaquemet

View GitHub Profile
@davidsh
davidsh / DotNetProxySupport.cs
Last active July 15, 2024 22:07
Background on .NET Framework and .NET Core proxy support
// WebRequest started it all. HttpWebRequest, FtpWebRequest, FileWebRequest, etc.
// Initial values when starting. The represents an object wrapping the platform/system proxy configuration settings.
// On Windows, these settings are from the IE setting dialog ("Wininet settings").
Console.WriteLine(WebRequest.DefaultWebProxy); // Internal type "System.Net.WebRequest+WebProxyWrapper"
Console.WriteLine(WebRequest.DefaultWebProxy.Credentials); // "null"
// HttpWebRequest has a single property, 'Proxy'. If null, it should not use a proxy. If non-null, then it
// should use a proxy. The initial value is non-null and the proxy to use is the platform/system proxy.
HttpWebRequest hwr = WebRequest.CreateHttp("http://www.contoso.com");
@dontmitch
dontmitch / README.md
Last active January 17, 2019 15:00
Pwned Passwords Checker for LastPass

Pwned Passwords Checker for LastPass

This Ruby script allows you to easily check if any of your LastPass passwords appear in the Pwned Passwords database, indicating they've been compromised in one or more data breaches.

You can read more about the Pwned Passwords database and version two of the API in Troy Hunt's blog post.

Importantly, this script uses the Range API. That means that your actual passwords do not leave your computer. Instead, a short prefix of the SHA1 hash of your password is used to query for potentially matching SHA1 hashes of passwords that have been compromised. The full SHA1 hash of your password is then compared to those results locally to see if there is a match. You can read more about this system, known as k-anonymity, in the blog post.

To use this checker:

@Tenzer
Tenzer / 000-README.md
Last active July 16, 2024 10:19
LastPass Pwned Passwords checker

LastPass Pwned Passwords checker

This is a script for checking if any of the passwords you have stored in LastPass have been exposed through previous data breaches.

To use the script you need to have Python 3 installed and you need a CSV export of your LastPass vault. The export can be generated from the LastPass CLI with:

lpass export > lastpass.csv

or can be extracted with the browser plugin by going to the LastPass icon → More Options → Advanced → Export → LastPass CSV File (note that I did have problems getting this to work).

@OlivierJaquemet
OlivierJaquemet / index.html
Created October 29, 2012 18:13
IE 9 will crash when opening this file on a web server configured in the local intranet zone.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="fr" xml:lang="fr" dir="ltr" xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test Crash IE</title>
<style type="text/css">
tr:nth-child(odd) {
}
</style>
</head>
@pmahoney
pmahoney / gist:1970815
Created March 4, 2012 05:28
Jenkins and Java fork()+exec() out of memory

Orien is correct, it is the fork() system call triggered by ProcessBuilder or Runtime.exec or other means of the JVM executing an external process (e.g. another JVM running ant, a git command, etc.).

There have been some posts on the Jenkins mailing lists about this: Cannot run program "git" ... error=12, Cannot allocate memory

There is a nice description of the issue on the SCons dev list: fork()+exec() vs posix_spawn()

There is a long standing JVM bug report with solutions: Use posix_spawn, not fork, on S10 to avoid swap exhaustion. But I'm not sure if this actually made it into JDK7 as the comments suggest was the plan.

In summary, on Unix-like systems, when one process (e.g. the JVM) needs to launch another process (e.g. git) a system call is made to