Skip to content

Instantly share code, notes, and snippets.

data:
artifactRepository: |
archiveLogs: true
s3:
bucket: artifacts
endpoint: argo-artifacts:9001
insecure: true
accessKeySecret:
name: argo-artifacts
key: accesskey
@andrewelkins
andrewelkins / interview-cron.md
Created November 11, 2021 22:41 — forked from rajivm/interview-cron.md
CRON to Dates API Endpoint

Cron2Date Parser

Summary

Create an API endpoint that accepts a json payload of cron strings, and returns a json payload of valid dates for these strings. Include any applicable tests for this endpoint using the testing platform of your choice.

Details

Frequency Object

A 'frequency' is an object that contains two attributes: name <string> and crons <Array> The crons property is a javascript array of strings (with cron format of "* * * * * *" representing "[sec] [min] [hr] [date] [month] [day of week]"). The following is an array of frequency objects.

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@andrewelkins
andrewelkins / .zshrc
Last active February 14, 2020 21:28
a zshrc configuration file
# .zshrc interactive configuration file for zsh
# Thanks to klapmuetz, caphuso, Mikachu, +chris+, zshwiki.org.
# Originally from http://leahneukirchen.org/dotfiles/.zshrc
# first revision: 26/09/2019 andrew
#
# Path to your oh-my-zsh installation.
export ZSH="/Users/$USER/.oh-my-zsh"
## Addresses bash and pre installed item
@andrewelkins
andrewelkins / install-docker-on-linux-mint-18.sh
Last active February 2, 2020 21:53
Install Docker on Linux Mint 18
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/andrewelkins/1adc587feb610f586f8f40b50b7efc3a/install-docker-on-linux-mint-18.sh | bash -x
##########################################
# Kernel version http://stackoverflow.com/a/4024263
versionlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
versionlt() {
@andrewelkins
andrewelkins / bash-add.sh
Last active July 6, 2016 23:12
Cassandra recommended limits per academy course configuring-kernel
#!/bin/bash
echo '* soft as unlimited' | sudo tee --append /etc/security/limits.conf
echo '* hard as unlimited' | sudo tee --append /etc/security/limits.conf
echo '* soft cpu unlimited' | sudo tee --append /etc/security/limits.conf
echo '* hard cpu unlimited' | sudo tee --append /etc/security/limits.conf
echo '* soft data unlimited' | sudo tee --append /etc/security/limits.conf
echo '* hard data unlimited' | sudo tee --append /etc/security/limits.conf
echo '* soft fsize unlimited' | sudo tee --append /etc/security/limits.conf
echo '* hard fsize unlimited' | sudo tee --append /etc/security/limits.conf
#!/usr/bin/env bash
shopt -s nocasematch
procs=$(ps aux | egrep '(crond[0-9]+)' | awk '{print $2}')
for pid in $procs; do
path=$(ls -l /proc/$pid/exe | cut -d'>' -f2 | cut -d' ' -f2)
if [ "$path" ]; then
echo "Process $pid is running the suspected file $path:"
if [ -f $path ]; then
echo "$path is still present on the filesystem..."
read -p "Would you like to prevent future execution of this file?
#!/usr/bin/env bash
regex='\$GLOBALS\['\''([a-zA-Z0-9]+)'\''\](?\s)=(?\s)\$([a-zAZ0-9]+)\[([0-9]+\])\.\$([a-zA-Z0-9]+)\[([0-9]+\])\.\$([a-zAZ0-9]+)\[([0-9]+\])\.'
filenames="admin.php ajax.php alias.php article.php blog.php cache.
php code.php config.php css.php db.php defines.php diff.php dir.php
dirs.php dump.php error.php file.php files.php footer.php functions.
php gallery.php general.php global.php header.php help.php include.
php inc.php info.php ini.php javascript.php lib.php list.php login.php
menu.php model.php object.php option.php options.php page.
php plugin.php press.php proxy.php search.php session.php sql.php
start.php stats.php system.php template.php test.php themes.php
@andrewelkins
andrewelkins / Preferences.sublime-settings
Last active October 6, 2015 20:05
Sublime User Settings
{
"bold_folder_labels": true,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_extra_width": 4,
"caret_style": "solid",
"theme": "Material-Theme.sublime-theme",
"color_scheme": "Packages/Facebook Material Theme/schemes/Material-Theme.tmTheme",
"font_size": 12,
"highlight_line": true,