Search Repository
TIMVKN.NL/TECH hosts a repository of scripts and patterns I have created over the course of time.
TIMVKN.NL/TECH hosts a repository of scripts and patterns I have created over the course of time.
sudo ufw status [numbered]
sudo ufw [delete] allow 443/tcp
sudo ufw [delete] allow from 10.0.0.1 proto tcp to any port 443 comment 'allow https trafic from 10.0.0.1'
sudo ufw [delete] [insert 1] reject from 10.0.0.0/24 comment 'Denies all trafic from specific subnet'
sudo ufw [delete] reject out to any proto tcp port 25
sudo ufw [delete] reject out to 192.168.5.0/24 proto tcp port 80,443
sudo ufw delete {rownumber}
# Add essential proc subs: /proc/sys, /proc/cpuinfo, /proc/modules
twadmin -m P /etc/tripwire/twpol.txt
tripwire --init
tripwire --check [--email-report]
tripwire --update --twrfile /var/lib/tripwire/report/servername-YYYYMMDD-HHMMSS.twr
Update script with last report:
lastfilename=(`ls -Art /var/lib/tripwire/report/ | tail -n 1`)
sudo tripwire --update --twrfile /var/lib/tripwire/report/${lastfilename}
I was doing some maintenance on my local NAS. I used the command below to effectively move data from one location to another without losing file attributes.
rsync -avzhP --remove-source-files /mnt/das-2T-1/source/ /mnt/das-2T-1/destination/ [--dry-run]
You can also temporarily cancel the move and when you start the command again it continues where it stopped.
I also did some internal replication using replication tasks on my TrueNAS device. This creates a snapshot of the data set to replicate to an empty dataset. The destination dataset is overwritten so this option cannot be used to merge datasets. If you want to merge datasets is best to use the rsync option mentioned above.
Al shortlist of my most frequently used nano (editor) shortcuts besides CRTL-X (EXIT) and CTRL-W (SEARCH) obviously.
LINE NUMBERS TOGGLE ALT-N
LINE WRAPPING TOGGLE ALT-S
LINE COMMENT TOGGLE ALT-3
CUT LINE CTRL-K
PASTE LINE CTRL-U
Check this overview page for a full list of shortcuts.
Force file timestamp to a specific datetime.
touch -t 202301251415.00 Filename
Delete evicted pods from current OpenShift project.
oc get pods | grep Evicted | awk '{print $1}' | xargs oc delete pod
Create an OpenShift secret from the command line.
oc create secret generic gateway1 --from-file=server.p12
Mavin compile (Java) code and create local package.
mvn clean package -DskipTests
Run a specific unit test from the command line.
mvn test -Dtest=JavaClassTest#specificTest
Example script with a check on the number of submitted parameters.
#!/bin/bash
[ $# -ne 1 ] && echo "ERROR: Input Required" && exit 1;
echo $1
A simple bash-script for OpenShift to determine which deployment configs make use of a specific secret (within the active project).
#!/bin/bash
oc get dc -o custom-columns="Name:metadata.name,readyReplicas:status.availableReplicas,Volumes:spec.template.spec.volumes,env:spec.template.spec.containers[].env,envFrom:spec.template.spec.containers[].envFrom,Volumes:spec.template.spec.volumes" | grep -E "($1)" | grep -oE "^[a-z0-9-]{3,99}"
$ os-sec-usage.sh secretname