Skip to content

Instantly share code, notes, and snippets.

View 4ndrej's full-sized avatar

Andrej 4ndrej

View GitHub Profile
@4ndrej
4ndrej / infoq.sh
Created December 22, 2013 02:28 — forked from shirishp/infoq.sh
#! /bin/bash
# Author: Shirish Padalkar (https://twitter.com/_Garbage_)
if [ "$#" -ne 1 ]; then
echo "Usage: $0 infoq_presentation_url"
exit 1
fi
url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"`
package main
import (
"fmt"
"math/big"
"sync"
)
func runInThread(wg *sync.WaitGroup, startFrom int64, numOfIterations int64) {
defer wg.Done()
@4ndrej
4ndrej / Test.java
Created October 14, 2019 20:56 — forked from nogweii/Test.java
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@4ndrej
4ndrej / certbot-authhook-az-cli-annotated.sh
Created September 1, 2020 23:28 — forked from colindekker/certbot-authhook-az-cli-annotated.sh
CertBot manual auth hook for Azure DNS using Azure CLI
#!/bin/bash
# The hook supports 2 actions, 'create' and 'delete', passed as the first argument.
# When 'create' is passed in, a validation TXT record is added,
# 'delete' cleans up that record after validation
ACTION=$1
# The second the name of the Azure Account that contains the DNS Zone Resource
AZ_ACCOUNT=$2
echo $AZ_ACCOUNT
# set the name of the Azure Resource Group that contains the DNS Zone Resource
@4ndrej
4ndrej / thestoryofus.sh
Created February 22, 2023 07:47 — forked from dirkjanfaber/thestoryofus.sh
Download the story of us as epub (waitbutwhy)
#/bin/bash
dir=$(mktemp --directory)
declare -a input=()
cat <<__EOT__ > ${dir}/metadata.txt
---
title: The Story of Us
author: Tim Urban
rights: Creative Commons Non-Commercial Share Alike 3.0