Skip to content

Instantly share code, notes, and snippets.

Avatar

Shunde Zhang shundezhang

View GitHub Profile
@shundezhang
shundezhang / 0-charmed-k8s-docker-calico-openstack
Last active Jul 20, 2020
use juju to deploy charmed k8s with docker, calico and openstack integration
View 0-charmed-k8s-docker-calico-openstack
juju deploy ./bundle.yaml --overlay openstack-overlay.yaml --trust --overlay calico-overlay.yaml
View iptables
# Generated by iptables-save v1.4.21 on Mon Feb 6 13:03:28 2017
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -s 10.10.10.0/24 -p tcp -m multiport --dports 5671,5672,15672 -m comment --comment "001 amqp incoming amqp_10.10.10.51" -j ACCEPT
-A INPUT -p tcp -m multiport --dports 8042 -m comment --comment "001 aodh-api incoming aodh_api" -j ACCEPT
-A INPUT -p tcp -m multiport --dports 8777 -m comment --comment "001 ceilometer-api incoming ceilometer_api" -j ACCEPT
-A INPUT -s 10.10.10.0/24 -p tcp -m multiport --dports 3260 -m comment --comment "001 cinder incoming cinder_10.10.10.53" -j ACCEPT
-A INPUT -p tcp -m multiport --dports 8776 -m comment --comment "001 cinder-api incoming cinder_api" -j ACCEPT
@shundezhang
shundezhang / ceph-disk-list.sh
Created Jul 9, 2019
ceph disk list for ceph nautilus
View ceph-disk-list.sh
#!/bin/bash
# run "ceph-volume simple scan" to generate OSD json files, these files will be placed in /etc/ceph/osd/
JSON_PATH="/etc/ceph/osd/"
for i in `ls $JSON_PATH`; do
OSD_ID=`cat $JSON_PATH$i | jq '.whoami'`
DATA_PATH=`cat $JSON_PATH$i | jq -r '.data.path'`
DB_PATH=`cat $JSON_PATH$i | jq -r '."block.db".path'`
WAL_PATH=`cat $JSON_PATH$i | jq -r '."block.wal".path'`
echo "OSD.$OSD_ID: $DATA_PATH"
@shundezhang
shundezhang / gist:322743e77e0ebaa65d6f
Last active Dec 23, 2015
openstack puppet all-in-one on centos 7
View gist:322743e77e0ebaa65d6f
yum upgrade -y centos-release
yum install -y git gcc-c++ python-devel
https://github.com/openstack/puppet-openstack-integration
git clone git://git.openstack.org/openstack/puppet-openstack-integration
cd puppet-openstack-integration
./all-in-one.sh
View gist:15b8cd97530925bc13d4

download and compile pam-python-1.0.4 (http://pam-python.sourceforge.net/) on CentOS

(python-pam is a pam client, NOT to write pam modules)

Put everything under /lib64/security, such as pam_python.so, and python pam scripts, e.g. pam_permit.py

Here is a test script. It allows you to log in as test1 with password '11'. (User test1 needs to exist on the host.) Some output will be written to /var/log/secure.

#
# Duplicates pam_permit.c
View torque-dashboard
{"title":"Torque","services":{"query":{"list":{"0":{"query":"*","alias":"","color":"#7EB26D","id":0,"pin":false,"type":"lucene","enable":true}},"ids":[0]},"filter":{"list":{},"ids":[]}},"rows":[{"title":"NoJobs","height":"150px","editable":true,"collapse":false,"collapsable":true,"panels":[{"error":false,"span":4,"editable":true,"type":"terms","loadingEditor":false,"field":"user","exclude":[],"missing":false,"other":true,"size":15,"order":"count","style":{"font-size":"10pt"},"donut":false,"tilt":false,"labels":true,"arrangement":"horizontal","chart":"table","counter_pos":"above","spyable":true,"queries":{"mode":"all","ids":[0]},"tmode":"terms","tstat":"total","valuefield":"","title":"JobsByUser"},{"error":false,"span":4,"editable":true,"type":"terms","loadingEditor":false,"field":"user","exclude":[],"missing":false,"other":true,"size":20,"order":"count","style":{"font-size":"10pt"},"donut":false,"tilt":false,"labels":true,"arrangement":"horizontal","chart":"pie","counter_pos":"above","spyable":true,"queries":
You can’t perform that action at this time.