This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Usage: | |
# script.py <robocopy.log> [robocopy.log]... | |
import re | |
from sys import argv | |
# key = division name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cacti> | |
<hash_0000248223b362bd688a74951a1ee6323e69d1> | |
<name>Windows - DedupSavedSpace(WMI)</name> | |
<graph> | |
<t_title>on</t_title> | |
<title>|host_description| - DedupSavedSpace</title> | |
<t_image_format_id></t_image_format_id> | |
<image_format_id>1</image_format_id> | |
<t_height></t_height> | |
<height>120</height> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import winrm | |
import sys | |
import getopt | |
import json | |
# set default | |
host = "localhost" | |
credencial_file = "/etc/cacti/cactiwinrm.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cacti> | |
<hash_0000247a26072efb1c6c5b9358fa308220a69a> | |
<name>Windows - DNS(WMI)</name> | |
<graph> | |
<t_title>on</t_title> | |
<title>|host_description| - DNS</title> | |
<t_image_format_id></t_image_format_id> | |
<image_format_id>1</image_format_id> | |
<t_height></t_height> | |
<height>120</height> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script required administrator permission. | |
# Disk, Partition and Firewall getting cmdlet require 2012 or later. | |
$LOG = "C:\$(hostname)_OS_Test_$((Get-Date -Format d).Replace('/','')).log" | |
function EchoTitle($title) | |
{ | |
echo "" | |
echo "******************** ${title} ********************" | |
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to get HVFP filesystem used size via http api. | |
# API Refference: http://itdoc.hitachi.co.jp/Pages/document_list/manuals/vfp.html | |
$filesystem = "FS01" | |
# [System.Web.HttpUtility] for japanese UrlEncode if necessary. | |
#[void]([Reflection.Assembly]::LoadWithPartialName("System.Web")) | |
# Ignore warning about self signed SSL cert. | |
[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add everyone read-only ACE to target path. | |
# Doc: https://technet.microsoft.com/en-us/library/ff730951.aspx | |
function Add-ReadOnlyACE([string]$path) | |
{ | |
if (-not (Test-Path $path)) { return } | |
# Create additionnal ACE. | |
$colRights = [System.Security.AccessControl.FileSystemRights]"AppendData, ChangePermissions, CreateDirectories, CreateFiles, Delete, DeleteSubdirectoriesAndFiles, Write" | |
$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit" | |
$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# よく使うやつ。主にStartTime見る用 | |
Get-Process -Name 'winlogon' | Format-Table -AutoSize -Property Name, StartTime, Id, PM, VM, WS | |
# Service. StartModeが取れないダメCmdlet。そっちが目的ならGet-WmiObject | |
Get-Service | format-table -Autosize -Property DisplayName, Name, Status | |
# Get-ServiceでPIDが取れないのでWMIを使わざるを得ない。大体タスクマネージャーから確認した方が早い。 | |
Get-Process -Id (Get-WmiObject -Query "select * from win32_service where name='wuauserv'").ProcessId | Format-Table Name, StartTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIApplication (SafariActiveURL) | |
- (id)activeURL; | |
//maybe return NSString class | |
@end | |
//... | |
id activeURL = [[UIApplication sharedApplication] activeURL]; |