Skip to content

Instantly share code, notes, and snippets.

View janos-ss@kraken
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDK5drsxKGiD67bi3ZyiwnsXjuQ7/JzsQk+0yBxeSysoRU6lOSx9HV3Fnub1WBeLDZzJJkiVXk6+oUvcJwS/24EdlbMS4YVO0sHBqh/gp7MjMnwIH454V8ethYRVfgl8YpNbMb2NmTVNXmRX3yxPgQ6AP3Q7lWR9NqEebzc7ojdEK0hlRZG54DIupPiTgle8Vj9YpTKko9A5BLudEZ0aJPv/txWwFGjsOWNZ4BgnphQsk3rWHdAX/CJT4nV/YGjr16gM/rb0afgYO9xzQtqsYOl/10Lk/e4HoAOXFx4XZWuJHoZ/496c+9HOhBr8sYaLs/pIwKHf0cxkTiTjXOWdf+3 janos@kraken
View read-objects-form-file.java
try (FileInputStream fis = new FileInputStream(path);
ObjectInputStream ois = new ObjectInputStream(fis)) {
Contact[] loaded = (Contact[]) ois.readObject();
System.out.println(Arrays.toString(loaded));
}
@janosgyerik
janosgyerik / print-cookie.png
Created Apr 19, 2020
Print document.cookie XSS
View print-cookie.png
View deeds.csv
We can't make this file beautiful and searchable because it's too large.
DOCUMENT ID,CRFN,COLLATERAL,# of PAGES,REEL-PAGE,EXPIRATION DATE,DOC TYPE,FILE NUMBER,ASSESSMENT DATE,DOC DATE,RECORDED/FILED,SLID#,DOC AMOUNT,BOROUGH,% TRANSFERRED,RPTT#,MAP SEQUENCE#,MESSAGE,PARTY1-NAME,PARTY1-ADDRESS1,PARTY1-ADDRESS2,PARTY1-CITY,PARTY1-STATE,PARTY1-ZIP,PARTY1-COUNTRY,PARTY2-NAME,PARTY2-ADDRESS1,PARTY2-ADDRESS2,PARTY2-CITY,PARTY2-STATE,PARTY2-ZIP,PARTY2-COUNTRY,PARTY3-NAME,PARTY3-ADDRESS1,PARTY3-ADDRESS2,PARTY3-CITY,PARTY3-STATE,PARTY3-ZIP,PARTY3-COUNTRY,PARCELS-BOROUGH,PARCELS-BLOCK,PARCELS-LOT,PARCELS-PARTIAL,PARCELS-PROPERTY TYPE,PARCELS-EASEMENT,PARCELS-AIR RIGHTS,PARCELS-SUBTERRANEAN RIGHTS,PARCELS-PROPERTY ADDRESS,PARCELS-UNIT,PARCELS-REMARKS,REFERENCES-CRFN,REFERENCES-DOCUMENT ID,REFERENCES-BOROUGH,REFERENCES-YEAR,REFERENCES-REEL,REFERENCES-PAGE,REFERENCES-FILE NBR
View MergeSort.java
import java.util.ArrayList;
import java.util.List;
public class MergeSort {
public static <T extends Comparable<T>> void sort(List<T> list) {
sort(list, 0, list.size());
}
private static <T extends Comparable<T>> void sort(List<T> list, int start, int end) {
if (end - start < 2) return;
View test-markdown-gist.md

title

Lorem ipsum dolor sid amet.

section

Lorem ipsum dolor sid amet.

sub-section

View terraform-example.tf
provider "google" {
region = "${var.region}"
project = "${var.project_name}"
credentials = "${file("${var.credentials_file_path}")}"
}
resource "google_compute_instance" "docker" {
count = 1
View terraform-issues.md
google_compute_instance.docker[0]: Creating...
google_compute_instance.docker[0]: Still creating... [10s elapsed]
google_compute_instance.docker[0]: Still creating... [20s elapsed]
google_compute_instance.docker[0]: Provisioning with 'remote-exec'...


Error: Failed to parse ssh private key: ssh: cannot decode encrypted private keys
View 732-my-calendar-3.java
// solution to: 732. My Calendar III https://leetcode.com/problems/my-calendar-iii/
class MyCalendarThree {
private final Comparator<Pos> comparator = Comparator.<Pos>comparingInt(p -> p.pos)
.thenComparing((p1, p2) -> {
if (p1.mark == p2.mark) return Integer.compare(p1.hashCode(), p2.hashCode());
if (p1.mark == Mark.END) return -1;
return 1;
});
private final SortedSet<Pos> marks = new TreeSet<>(comparator);
View Install & Configure SonarQube.md

Create Amazon EC2 Instance

  • Ensure that inbound MySQL port 3306 is opened
  • chmod 700 "keypair-name.pem"

Install MySQL

To install MySQL, run the following command from a terminal prompt:

  • sudo apt-get install mysql-server
You can’t perform that action at this time.