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
@jshen28
jshen28 / ovs-cheat.md
Last active April 21, 2021 08:14 — forked from djoreilly/ovs-cheat.md
OVS cheat sheet

CTL

ovs-vsctl list open_vswitch
ovs-vsctl list interface
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl --format=table --columns=name,mac_in_use find Interface name=br-dpdk1
ovs-vsctl get interface vhub656c3cb-23 name/ofport
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
# from a directory with some stuff 
# but still want to push to an existing repository
git init
git add -A
git commit -m "some rants"

git remote add origin <origin url>
git pull orgin <branch> --allow-unrelated-histories
#!/bin/bash
set -e

source ${ENV_FILE}

# set image name
IMAGE_DEF=

# set url