Skip to content

Instantly share code, notes, and snippets.

@clive2000
clive2000 / 7zip.ps1
Created March 18, 2019 19:09
Powershell script to create 7z archive for each subfolder
# Loop thorugh folder
$7z = 'C:\Program Files\7-Zip\7z.exe'
Get-ChildItem $PWD -Directory | ForEach-Object {
& $7z a -t7z (-join($_.Name,".7z")) $_.FullName
}
@clive2000
clive2000 / pwrp.sh
Created January 22, 2019 02:39
Cyberpower Powerpanel Personal Linux1
# You need to exectue pwrstat as root
sudo pwrstat -status
sudo pwrstat -alarm off
# Shutdown script is at /etc/pwrstatd-powerfail.sh. Combine that with ESXCLI to shutdown host vm

How to install VMware vSphere CLI on Ubuntu

Ubuntu に VMware vSphere CLI をインストールする方法です。
CLI ツールを使用して、ホストの構成情報のバックアップやリストアが可能です。

Environment

  • Ubuntu 16.04.3 LTS
  • VMware vSphere 6 Standard
@clive2000
clive2000 / huya_api.py
Created June 4, 2018 02:07 — forked from Justsoos/huya_api.py
huya.com api,直播流URL提取
#! /usr/bin/env python3
import re
import requests
import argparse
sess = requests.Session()
def get_api(url):
headers = {"User-Agent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Mobile Safari/537.36"}
@clive2000
clive2000 / curl_multi_test.c
Created January 17, 2017 04:16 — forked from clemensg/curl_multi_test.c
libcurl multi interface example
/* curl_multi_test.c
Clemens Gruber, 2013
<clemens.gruber@pqgruber.com>
Code description:
Requests 4 Web pages via the CURL multi interface
and checks if the HTTP status code is 200.
Update: Fixed! The check for !numfds was the problem.
# -*- coding: utf-8 -*-
#
# Example using python and serial to control Microchip Tech. Mote
#
# requires pyserial: pip install pyserial
#
import serial
import sys
from time import sleep