Skip to content

Instantly share code, notes, and snippets.

def printSystemProperty(key)
{
def jenkins = hudson.model.Hudson.instance
def slaves = jenkins.slaves
slaves.each {
def com = it.toComputer()
def properties = com.getSystemProperties()
if( properties != null )
{
def ver = properties[key]
@srz-zumix
srz-zumix / benchmark.cpp
Last active August 29, 2015 14:27
VC++ 2015 TMP benchmark
// http://qnighy.hatenablog.com/entry/20090204/1233733232
#include <iostream>
using namespace std;
namespace TMP
{
template<bool expr, typename IfTrue, typename IfFalse>
struct select
@echo off
SET TARGET_KEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers
SET TARGET_KEY_WOW64=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\explorer\ShellIconOverlayIdentifiers
rem call :dropbox %TARGET_KEY%
if not "%PROCESSOR_ARCHITECTURE%" == "x86" (
call :dropbox %TARGET_KEY_WOW64%
)
goto :EOF
@srz-zumix
srz-zumix / Zundoko.groovy
Created March 22, 2016 13:37
ズンドコキヨシ for Jenkins
import hudson.model.Cause.UpstreamCause
static checkZUN(manager, cause, count)
{
def causes = cause.getUpstreamCauses()
def name = cause.getUpstreamProject()
manager.listener.logger.println name
if( name == "ZUN" ) {
count += 1
if( count == 4 ) {
@srz-zumix
srz-zumix / WindowsUpdate.ps1
Created September 14, 2016 04:12
WindowsUpdate powershell
Write-Host "--- Running Windows Update ---"
Write-Host "Searching for updates..."
$updateSession = new-object -com "Microsoft.Update.Session"
$updateSearcher = $updateSession.CreateupdateSearcher()
$searchResult = $updateSearcher.Search("IsInstalled=0 and Type='Software' and AutoSelectOnWebSites=1")
Write-Host "List of applicable items on the machine:"
if ($searchResult.Updates.Count -eq 0) {
Write-Host "There are no applicable updates."
}
else
@srz-zumix
srz-zumix / chco_setup
Last active November 21, 2017 08:20
Windows setup scripts
rem パッケージリスト : https://chocolatey.org/packages
rem 管理者権限があるかどうかチェック
whoami /PRIV | find "SeLoadDriverPrivilege" >NUL
if not errorlevel 1 goto start
rem ない場合は powershell 経由で自分自身を実行
powershell.exe -Command Start-Process "%~0" -Verb Runas
goto :EOF
#include <windows.h>
#include <tchar.h>
void FindFirstFileTest()
{
_tprintf(_T("FindFirstFile\n"));
TCHAR buf[3] = _T("c:");
for( TCHAR letter = _T('c'); letter <= _T('z'); letter += 1 )
{
@echo off
rem 管理者権限があるかどうかチェック
whoami /PRIV | find "SeLoadDriverPrivilege" >NUL
if not errorlevel 1 goto start
rem ない場合は powershell 経由で自分自身を実行
rem %0 のドライブレターで検索して UNC パスを取得
for /f "usebackq tokens=1,2,3" %%i in (`net use`) do if "%%j" == "%~d0" SET UNC=%%k
rem net use で割当をしてから実行(既に割当たっている場合もあるので成否にかかわらずコマンド実行)
powershell.exe -Command Start-Process -FilePath cmd.exe -ArgumentList '/c "net use %~d0 %UNC% || %~dp0%~nx0"' -Wait -Verb Runas
@srz-zumix
srz-zumix / wercker.yml
Created January 30, 2017 07:40
iutesst wercker.yml sample
# This references the default Python container from
# the Docker Hub with the 2.7 tag:
# https://registry.hub.docker.com/_/python/
# If you want to use a slim Python container with
# version 3.4.3 you would use: python:3.4-slim
# If you want Google's container you would reference google/python
# Read more about containers on our dev center
# http://devcenter.wercker.com/docs/containers/index.html
box: python:2.7
# You can also use services such as databases. Read more on our dev center:
# doxygen special commands list (v1.18.13)
DOXYGEN_COMMAND_LIST={ \
} \
a \
addindex \
addtogroup \
anchor \
arg \
attention \
author \