Glossary:
- md: multiple devices
| command | description |
|---|---|
cat /proc/mdstat |
show status of all raids |
mdadm --detail /dev/md0 |
detailed status of raid md0 |
| import paho.mqtt.client as mqtt | |
| # The callback for when the client receives a CONNACK response from the server. | |
| def on_connect(client, userdata, rc): | |
| print("Connected with result code "+str(rc)) | |
| # Subscribing in on_connect() means that if we lose the connection and | |
| # reconnect then subscriptions will be renewed. | |
| client.subscribe("hello/world") | |
| # The callback for when a PUBLISH message is received from the server. |
| #!/bin/bash | |
| # | |
| # mosquitto This shell script takes care of starting and stopping | |
| # mosquitto (MQTT 3.1 broker) on Amazon Linux. | |
| # | |
| # chkconfig: - 58 74 | |
| # description: mosquitto is a MQTT 3.1 broker. \ | |
| # http://mosquitto.org/ | |
| ### BEGIN INIT INFO |
| #!/bin/bash | |
| # Install script for LEMP Web Server on CENTOS 6.5 by Majid Arif Siddiqui | |
| # Init | |
| echo "Initializing..." | |
| sudo yum -y update | |
| sudo yum -y groupinstall "Development Tools" | |
| sudo yum -y install screen |
| """ | |
| Fade IN/OUT some text.. | |
| """ | |
| import sys | |
| import time | |
| import pygame | |
| ## Show some text fade in/out |
| # [General/Initial Section] | |
| # Update system | |
| yum update | |
| # Set your timezone | |
| timedatectl set-timezone UTC | |
| # Check date is set correct | |
| date |
| #!/usr/bin/env python3 | |
| # | |
| # udpserver.py | |
| # | |
| # See Gist udpclient.py to send a UDP message. | |
| # | |
| # Run UDP server on 127.0.0.1 port 8000. | |
| # | |
| # usage: python3 udpserver.py |
| #!/usr/bin/env python3 | |
| # | |
| # udpclient.py | |
| # | |
| # Required that UDP server runs on 127.0.0.1 port 8000. | |
| # See Gist udpserver.py. | |
| # | |
| # Send UDP message to UDP server. | |
| # | |
| # usage: python3 udpclient.py |
| #!/bin/sh | |
| echo "==== Disable SELinux ====" | |
| setenforce 0 | |
| sed -i "s/^SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config | |
| echo "==== Start Yum Update ====" | |
| yum -y update | |
| echo "==== Install nano and wget ====" |