Skip to content

Instantly share code, notes, and snippets.

View toshke's full-sized avatar

Nikola Tosic toshke

  • Buffer Overflow
  • Melbourne, Australia
  • X @thetoske
View GitHub Profile
@toshke
toshke / gist:defb7da559515bdf290ecb0484dbe5b9
Created May 12, 2017 00:16
Develoeprs Global Gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.d
​*.d.*​
*.o
*.a
@toshke
toshke / pipeline.groovy
Last active June 20, 2021 16:39
Declarative jenkins pipeline example
pipeline {
//run by default on docker-in-docker slave
agent {
label 'docker'
}
stages {
//demo of running builds within custom container
stage('PrintNodeVersion') {
@toshke
toshke / gist:c22e5b924f061cb067ae895accb0da32
Created September 22, 2017 05:15
jenkins declarative pipeline in place sort
@NonCPS
def nonCpsTest() {
def list = [
['CreationDate': '200'],
['CreationDate': '300'],
['CreationDate': '100'],
]
def rval = list.sort true, { it['CreationDate'] }
@toshke
toshke / clean-dynamo-table
Last active June 15, 2023 13:08 — forked from k3karthic/truncate_dynamodb.sh
Truncate all keys in a dynamodb table
#!/bin/bash
####
#### Delete (remove) all items from Aws Dynamo DB table, by specifing table name and primary key
####
#### Forked from https://gist.github.com/k3karthic/4bc929885eef40dbe010
####
#### Usage:
#### clean-dynamo-table TABLE_NAME PRIMARY_KEY
####
@toshke
toshke / truncate_dynamodb.sh
Created September 28, 2017 00:15 — forked from k3karthic/truncate_dynamodb.sh
Truncate all keys in a dynamodb table
#!/bin/bash
TABLE_NAME=$1
# Get id list
aws dynamodb scan --table-name $TABLE_NAME | grep ID | awk '{ print $2 }' > /tmp/truncate.list
# Delete from id list
cat /tmp/truncate.list | xargs -IID aws dynamodb delete-item --table-name $TABLE_NAME --key '{ "id": { "S": "ID" }}'
@toshke
toshke / truncate_dynamodb.sh
Created September 28, 2017 00:15 — forked from k3karthic/truncate_dynamodb.sh
Truncate all keys in a dynamodb table
#!/bin/bash
TABLE_NAME=$1
# Get id list
aws dynamodb scan --table-name $TABLE_NAME | grep ID | awk '{ print $2 }' > /tmp/truncate.list
# Delete from id list
cat /tmp/truncate.list | xargs -IID aws dynamodb delete-item --table-name $TABLE_NAME --key '{ "id": { "S": "ID" }}'
@toshke
toshke / truncate_dynamodb.sh
Created September 28, 2017 00:15 — forked from k3karthic/truncate_dynamodb.sh
Truncate all keys in a dynamodb table
#!/bin/bash
TABLE_NAME=$1
# Get id list
aws dynamodb scan --table-name $TABLE_NAME | grep ID | awk '{ print $2 }' > /tmp/truncate.list
# Delete from id list
cat /tmp/truncate.list | xargs -IID aws dynamodb delete-item --table-name $TABLE_NAME --key '{ "id": { "S": "ID" }}'
@toshke
toshke / dynamodb_copy_table_items
Last active January 31, 2024 19:27
Copy DynamoDB table items from one table to other
#!/usr/bin/env python
import boto3
import sys
####
#### usage copy_dynamo_items.py <srcTable> <dstTable> [dstTableRegion] [dstTableProfile]
#### source table region will get picked up from environment variables
#### if target table region is different than source region, pass it as 3rd argument to script
#### source table credentials are picked up from environment
#### if target table credentials are different from source, pass it as 4rd argument to the script as local profile name
@toshke
toshke / pypi-release-checklist.md
Created November 13, 2017 23:22 — forked from audreyfeldroy/pypi-release-checklist.md
My PyPI Release Checklist
  • Update HISTORY.rst
  • Commit the changes:
git add HISTORY.rst
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch

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.