Skip to content

Instantly share code, notes, and snippets.

@Pamir
Pamir / dbspaces.sql
Created September 6, 2023 05:07
DBSPaces Script compatible with CDB
select type, sum(bytes)/1048576 mb
from (select 'Datafile' type, bytes from cdb_data_files
union all
select 'Tempfile' type, bytes from cdb_temp_files
union all
apiVersion: v1
kind: Pod
metadata:
labels:
run: jvm-vulnerable-lab
name: jvm-vulnerable-lab
internalVersion: 0.0.1
name: jvm-vulnerable-lab
spec:
containers:
#!/bin/bash
dump_pvinfo(){
namespace=$1
for pvc in $(kubectl get pvc -o=jsonpath="{.items[*].metadata.name}" -n $namespace); do
echo " " $pvc
pv=$(kubectl get pvc -o=jsonpath="{.spec.volumeName}" -n $namespace $pvc)
echo " " $pv
pdName=$(kubectl get pv -o=jsonpath="{.spec.gcePersistentDisk.pdName}" -n $namespace $pv)
echo " " $pdName
#!/bin/bash
dump_pvinfo(){
namespace=$1
for pvc in $(kubectl get pvc -o=jsonpath="{.items[*].metadata.name}" -n $namespace); do
echo " " $pvc
pv=$(kubectl get pvc -o=jsonpath="{.spec.volumeName}" -n $namespace $pvc)
echo " " $pv
pdName=$(kubectl get pv -o=jsonpath="{.spec.gcePersistentDisk.pdName}" -n $namespace $pv)
echo " " $pdName
@Pamir
Pamir / logstash.conf
Last active May 26, 2018 17:01
sample-logstash.conf
inputs{
file {
path => "/var/logs/*.log"
exclude => "*.gz"
sincedb_path => "/dev/null"
start_position => "beginning"
type => "weblogic"
}
}
output {
@Pamir
Pamir / elasticsearch
Created May 25, 2018 06:54
elasticsearch /etc/rc.d/init.d
#!/bin/bash
#
# elasticsearch <summary>
#
# chkconfig: 2345 80 20
# description: Starts and stops a single elasticsearch instance on this system
#
### BEGIN INIT INFO
@Pamir
Pamir / exports
Last active May 30, 2018 05:45
kubernetes nfs persistent volume
/etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#