Skip to content

Instantly share code, notes, and snippets.

View krzko's full-sized avatar
🥒
I'm a pickle!

Kristof Kowalski krzko

🥒
I'm a pickle!
View GitHub Profile
@krzko
krzko / natural-language-date-sort.go
Created September 14, 2023 05:41
Example natural languag date sort
package main
import (
"fmt"
"regexp"
"sort"
"strconv"
"time"
)
@krzko
krzko / github_unfurl_card.html
Last active September 3, 2023 11:03
GitHub Repo Unfurling Card for Ghost. Slack-Style Display.
<!-- The container where repo details will be populated -->
<div class="github-repo-box" id="githubRepoDetails">
<!-- Empty by default; JavaScript will populate this -->
</div>
<script>
// A function to fetch and display repo details
async function fetchRepoDetails(owner, repo) {
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}`);
const repoData = await response.json();
import argparse
import math
import textwrap
from datetime import timedelta
DURATIONS = {"s": 1, "m": 60, "h": 3600, "d": 86400, "w": 604800}
ERROR_RATES = [
0.0001,
0.0005,
0.001,
@krzko
krzko / Domain Enumeration Commands
Created March 24, 2022 11:06 — forked from its-a-feature/Domain Enumeration Commands
Common Domain Enumeration commands in Windows, Mac, and LDAP
Domain: TEST.local
User Enumeration:
Windows:
net user
net user /domain
net user [username]
net user [username] /domain
wmic useraccount
Mac:
dscl . ls /Users
@krzko
krzko / script-template.sh
Created May 17, 2021 10:05 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@krzko
krzko / zignaly_functions.sh
Last active November 16, 2020 11:17
A shell file containing bash functions to execute trades on Zignaly (https://zignaly.com) from the command line
#!/usr/bin/env bash
### Zignaly Hybrid Trades ###
#/ $ source zignaly_functons.sh
#/ $ run_the_function
export ZIGNALY_API_URL="https://zignaly.com/api/signals.php"
function log_me() {
@krzko
krzko / network_change.plist
Created September 4, 2020 01:42
Network change plist, to be used with check_alpaca.sh
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ifup.alpaca</string>
<key>LowPriorityIO</key>
<true/>
@krzko
krzko / check_alpaca.sh
Last active September 4, 2020 12:27
Checks to see if alpaca proxy is running, restarts accordingly on network changes
#!/usr/bin/env bash
# Script to restart/start alpaca on network changes.
#
# To register plist:
# launchctl load network_change.plist
# launchctl start network_change
#
# Vars

Keybase proof

I hereby claim:

  • I am krzko on github.
  • I am krzko (https://keybase.io/krzko) on keybase.
  • I have a public key ASBJhogOmk3uvKOJXozFivMBBsTgsFAN_zllbIkLLOGRWQo

To claim this, I am signing this object:

@krzko
krzko / 0_reuse_code.js
Created September 27, 2013 01:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console