Skip to content

Instantly share code, notes, and snippets.

View Zobber's full-sized avatar
🎯
Focusing

Erick Z Zobber

🎯
Focusing
  • Universidad Nacional Abierta y a Distancia
  • Colombia
  • 13:02 (UTC -05:00)
View GitHub Profile
#!/bin/sh
#
# ufetch-arch - tiny system info for arch
## INFO
# user is already defined
host="$(cat /etc/hostname)"
os='Arch Linux'
kernel="$(uname -sr)"
$a = netsh.exe wlan show profiles | Select-String -Pattern ": "; For ($i=1; $i -le $a.length * 2; $i+=2){ $b = ($a -split "`t" -split ": ")[$i]; $c = netsh.exe wlan show profile name=$b key=clear | Select-String -Pattern "clave "; "Red: " + $b + $c}
<?php
// This script is run every 5 minutes
// A ping failure will generate an email
// We ping critical servers that serve to identify both a server failure and/or a circuit or VPN failure.
// Define descriptions and ip addresses below to test on
$hosts = array(
array("description" => "Google.com", "hostip" => "www.google.com"),
array("description" => "Office1", "hostip" => "192.168.1.2")
);
lsblk --ascii -o "NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT"
#!/bin/bash
#
# showmydisks - report partitions, types, filesystems, and disk space usage
#
PRGVERSION="v0.12 * 2015-09-12 (c) Andreas Schamanek"
# Copyright 2004-2015: Andreas Schamanek <[email protected]>
# Homepage: http://wox.at/as/_/showmydisks
# License + History: see end of file
zq -f text "cut ts,id.orig_h,id.orig_p,conn_state,history,orig_ip_bytes,resp_ip_bytes" conn.log;zq "sum(orig_bytes)" conn.log;zq "avg(orig_bytes)" conn.log;zq "history="D"|count ()" conn.log
#Zeekurity Zeek_IDS. Remote Windows Network audit. (SSH).
ssh [email protected] -p2223 ..... zeek -S -Q -C -r - -e 'redef LogAscii::use_json=T;' local.bro bro-scripts/scripts/geo/geo policy/frameworks/files/extract-all-files.bro
watch -n2 -c 'tree -aJhD| jq . | ccze -A'
sudo apt-get install cmake make gcc g++ flex bison libpcap-dev libssl-dev python-dev swig zlib1g-dev
sudo apt-get install libmaxminddb-dev postfix curl git
git clone --recursive https://github.com/zeek/zeek
cd zeek
./configure
make
sudo make install
Grep hostnames from ssl certificate
echo | openssl s_client -connect example\.com | openssl x509 -noout -text | grep DNS
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.6.2-amd64.deb
sudo dpkg -i filebeat-7.6.2-amd64.deb
##### Modify /etc/filebeat/filebeat.yml to set the connection information:
output.elasticsearch:
hosts: ["<es_url>"]
username: "elastic"
password: "<password>"
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar