One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
# 👏 https://stackoverflow.com/questions/53202727/how-to-delete-only-unmounted-pvcs-and-pvs#answer-59758937 | |
# List Unmounter PVC's | |
kubectl describe -A pvc | grep -E "^Name:.*$|^Namespace:.*$|^Mounted By:.*$" |\ | |
grep -B 2 "<none>" | grep -E "^Name:.*$|^Namespace:.*$" | |
# Delete Unmounted PVC's | |
kubectl describe -A pvc | grep -E "^Name:.*$|^Namespace:.*$|^Mounted By:.*$" |\ | |
grep -B 2 "<none>" | grep -E "^Name:.*$|^Namespace:.*$" | cut -f2 -d: |\ | |
paste -d " " - - | xargs -n2 bash -c 'kubectl -n ${1} delete pvc ${0}' |
// small function to get routes from an express router | |
// https://stackoverflow.com/questions/14934452/how-to-get-all-registered-routes-in-express#answer-26275395 | |
export function listRoutes(...args: Router[]){ | |
for (var i = 0; i < arguments.length; i++) { | |
if(arguments[i].stack instanceof Array){ | |
console.log(''); | |
arguments[i].stack.forEach(function(a: any){ | |
var route = a.route; | |
if(route){ |
array=( chg8p p9dzh ); \ | |
loc="/bin/"; \ | |
for i in "${array[@]}"; \ | |
do echo $i; \ | |
mv $i $loc | |
done |
#!/bin/bash | |
kubectl get <resource-type> <resource-name> -n <source-namespace-name> -o yaml |\ | |
sed 's/namespace: <source-namespace-name>/namespace: <target-namespace-name>/' |\ | |
kubectl create -f - | |
> Example: | |
kubectl get secret auth-token -n web-dev -o yaml |\ | |
sed 's/namespace: web-dev/namespace: web-qa/' |\ | |
kubectl create -f - |
function getDomPath(el) { | |
var stack = []; | |
while ( el.parentNode != null ) { | |
console.log(el.nodeName); | |
var sibCount = 0; | |
var sibIndex = 0; | |
for ( var i = 0; i < el.parentNode.childNodes.length; i++ ) { | |
var sib = el.parentNode.childNodes[i]; | |
if ( sib.nodeName == el.nodeName ) { | |
if ( sib === el ) { |
/** | |
* Time Difference takes input in Hours Format | |
* Author: imixtron | |
* Accepts: String Values (HH:MM) | |
* Max: 24:00, Min: 00:00 | |
* | |
* example timeDifference("10:37","12:35") | |
*/ | |
timeDifference(from, to) { |
//server; /api/ | |
var APP_PREFIX = 'pMeds_', | |
APP_URL = '/api/', | |
APP_TIMEOUT = 1000 * 30, | |
HTTP_REQUEST = null, | |
APP_DATA = {}; | |
APP_FORMAT = 'json'; | |
var API = { |
#!/bin/bash | |
MONGO_DATABASE="your_db_name" | |
APP_NAME="your_app_name" | |
MONGO_HOST="127.0.0.1" | |
MONGO_PORT="27017" | |
TIMESTAMP=`date +%F-%H%M` | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
BACKUPS_DIR="/home/username/backups/$APP_NAME" |
//hexaTime.js | |
//author: imixtron | |
//Javascript function to return unique hexadecimal string (that i personally use) | |
function getUniqueKey(){ | |
return ((new Date).getTime()).toString(32); | |
} | |
var unique_key = getUniqueKey() |