Skip to content

Instantly share code, notes, and snippets.

@mrpeardotnet
mrpeardotnet / PVE-HP-ssacli-smart-storage-admin.md
Created November 25, 2019 22:10
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@graywen24
graywen24 / getData4.py
Last active October 11, 2023 20:15
flask query data from mysql and return json format
#update in https://www.cnblogs.com/gray13/p/10977375.html
#!flask/bin/python
# coding=utf-8
from flask import Flask, jsonify
import json
import mysql.connector
from mysql.connector import Error
app = Flask(__name__)
Run post request to http://10.208.200.102:9200/grm/guest_property/_search
{
"from": 0,
"size": 0,
"query": {
"match_all": {}
},
"aggs": {
"interests": {
"terms": {
@SabretWoW
SabretWoW / json_response_handling_ruby.rb
Created December 11, 2013 14:20
Ruby script that uses open-uri to fetch the contents of a JSON endpoint, uses the JSON gem to parse the string into a Ruby array & prints some of the records. This is the foundation for all web API requests, so feel free to use it in the future.
# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html
require 'open-uri'
# https://github.com/flori/json
require 'json'
# http://stackoverflow.com/questions/9008847/what-is-difference-between-p-and-pp
require 'pp'
# Construct the URL we'll be calling
request_uri = 'http://localhost:3000/users.json'
request_query = ''
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@tricker
tricker / gist:2414640
Created April 18, 2012 16:15
Simple csv file parser, takes infile, adds a time where appropriate, writes to outfile. All should reside in the same directory.
#!/usr/bin/perl
open INFILE, "fin2_tran.csv" or die $!;
open OUTFILE, ">fin2_out.csv" or die $!;
while (<INFILE>) {
s/,(\d{4}-\d{2}-\d{2})(,[^,]+$)/,"$1 11:00:00"$2/;
print OUTFILE;
}