Skip to content

Instantly share code, notes, and snippets.

#
## Count number of pyhsical/virtual drives
```
MegaCli64 -PDGetNum -aN
MegaCli64 -LDGetNum -aN
```
## List all existent physical/virtual drives
udevadm info -q property -n ${DIKS_OR_PARTION_NAME}
blkid /dev/${DISK_OR_PARTITION_NAME}
# print local date
date
# print UTC date
date -u
# format
date "+%m/%d/%Y -%H:%M:%S"
# date substraction
# force reinstall existing packages
apt install --reinstall -y ${PAKCAGE}
@jshen28
jshen28 / README.md
Created October 13, 2018 13:06 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@jshen28
jshen28 / README.md
Created October 21, 2018 09:40 — forked from smoser/README.md
MAAS and curtin debug

Debugging curtin from within MAAS

Deploying a node with MAAS cli

You can deploy a node with the maas cli which is often preferable to clicking a button on a web UI.

$ SYSTEM_ID=node-787b19d8-d25c-11e4-9f9e-00163eca91de
$ NAME="random-nodename"
$ MAASNAME="maaslocal"

$ maas $MAASNAME machine allocate "name=$NAME"

# get router gateway external gateway network id
ROUTER_ID=
openstack router show ${ROUTER_ID} -f value -c gateway_external_info | jq '.network_id' | sed 's/"//g'
# router namespace is named in the form of qrouter-<ROUTER-ID>
# snat namespace is named with snat-<ROUTER-ID>
# fip namespace is named with fip-<EXTERNAL-NETWORK-ID>
# dvr layout
# edge node
#!/bin/bash
set -e

source ${ENV_FILE}

# set image name
IMAGE_DEF=

# set url

SNIFF SSL TRAFFIC

Recently I get confused on how to sniff HTTPS traffic, I think I need a proxy and it turns out correct. I setup a proxy chain by using stunnel.

SETUP

I use two machines (which is not optimal), one is used for executing command and serving stunnel server; then other one is used for stunnel client and sniffing.

STUNNEL SERVER & CLIENT

CONFIGURE FIREWALLS

WINDOWS

On newer windows,

netsh advfirewall set  allprofiles state off/on

:: or equivalently