This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| s3cmd ls -r $1/ | while read -r line; | |
| do | |
| createDate=`echo $line|awk {'print $1" "$2'}` | |
| createDate=`date -d"$createDate" +%s` | |
| olderThan=`date --date "7 days ago" +%s` | |
| if [[ $createDate -lt $olderThan ]] | |
| then | |
| fileName=`echo $line|awk {'print $4'}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Remove all replicasets with 0 pods | |
| for i in $(kubectl get rs -o json | jq -r '.items[] | select(.status.replicas==0) | .metadata.name'); do kubectl delete rs/$i; done | |
| # Remove all resources with a certain label set | |
| for i in $(kubectl api-resources -o name); do for x in $(kubectl get $i -l "kapp.k14s.io/app=1586922989415912400" -o name); do kubectl delete $x; done; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker ps -q | xargs docker stats --no-stream --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" | sort -k 4 -h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Model: Basic cone hose converter | |
| Author: Dan Higham | |
| */ | |
| $fa = 1; | |
| $fs = 0.4; | |
| //PARAMS | |
| cone_length = 35; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/expect -f | |
| # This script automates the 'remote-con' login process. | |
| # Check for a hostname argument. | |
| if {$argc != 1} { | |
| puts "Usage: $argv0 <hostname>" | |
| exit 1 | |
| } | |
| set hostname [lindex $argv 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Sway Keyboard Cheat Sheet</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Source+Sans+3:wght@400;600;700&display=swap" rel="stylesheet"> | |
| <style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| LENGTH = 5 | |
| def extend_plates(plates) | |
| plates.flat_map do |p| | |
| last = p.last | |
| [last - 1, last + 1].select { |d| d.between?(0, 9) }.map { |d| p + [d] } | |
| end | |
| end |
OlderNewer