Skip to content

Instantly share code, notes, and snippets.

View habbdt's full-sized avatar
🎯
Focusing

Booztum habbdt

🎯
Focusing
View GitHub Profile
@habbdt
habbdt / httpstatus
Created February 8, 2021 21:51 — forked from rsvp/httpstatus
httpstatus : bash script to get HTTP response code with optional status message (includes verbose definitions in comment)
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-08-25
#
# _______________| httpstatus : get HTTP status code
#
# Usage: httpstatus URL [timeout] [--code or --status] [see 4.]
# ^message with code (default)
# ^code (numeric only)
# ^in secs (default: 3)
# ^URL without "http://" prefix works fine.
Run OWASP juice shop app on the minikube
========================================
Depending on your platform use the appropriate method to install minikube on your system. For macOS it can be installed using the brew.
# brew install minikube
# minikube start --driver=vmwarefusion
# docker pull bkimminich/juice-shop
# kubectl create deployment juice-shop --image=bkimminich/juice-shop
# kubectl expose deployment juice-shop --port=3000 --type=LoadBalancer
# minikube service juice-shop
@habbdt
habbdt / splunk
Last active January 30, 2019 02:50
+-------------------+
| Splunk Operations |
+-------------------+
# /opt/splunkforwarder/bin/splunk add forward-server <server_name>:<index_port>
# /opt/splunkforwarder/bin/splunk list forward-server
# /opt/splunkforwarder/bin/splunk add monitor /var/log/messages
# /opt/splunkforwarder/bin/splunk start
+------------------------------------+
| Splunk Processing Language Example |
oc <verb> <resoure_type> [<name>]
User Login and Authetication
============================
oc login -u system:admin https://ose-master01.example.com:8443
oc whoami
oc whoami -t # prints token which is used to authenticate any api requests from this session to master.
oc logout
oc new-project build-project
@habbdt
habbdt / Git cheat sheets
Last active May 16, 2018 07:00
Cheat Sheets
Installation and Setting Parameters:
yum install git # Install git
git config --global user.name "<user_name>" # Git global conf
git config --global user.email "<email>" # Git global conf
git config --global system.name "server1.example.com" # Git global conf
git config --global core.editor vim # Set editor to be vim
git config --global core.page 'more' # Git global conf
git config --global core.excludefile ~/.gitignore_global # Ignore files - add lists of the files to be excluded
git config --list
@habbdt
habbdt / vagrant-cheat-sheet.md
Created June 20, 2017 03:13 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@habbdt
habbdt / scp_demo.py
Created June 14, 2017 12:58 — forked from mlafeldt/scp_demo.py
[Python] paramiko examples
#!/usr/bin/env python
import sys, paramiko
if len(sys.argv) < 5:
print "args missing"
sys.exit(1)
hostname = sys.argv[1]
password = sys.argv[2]
@habbdt
habbdt / python_scripting.rst
Created June 12, 2017 03:00 — forked from jasonkeene/python_scripting.rst
Get started with writing your own python scripts to automate system tasks.

Python for System Admins / Operators

Installing Python

Most Unix/Linux systems come with python pre-installed:

$ python -V