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
curl -sLJ https://github.com/grafana/k6/releases/download/v0.52.0/k6-v0.52.0-linux-amd64.tar.gz | tar xvzf - -C /tmp | |
curl -sLJ https://github.com/derailed/k9s/releases/download/v0.32.5/k9s_linux_amd64.tar.gz | tar xvzf - -C /tmp | |
curl -sLJ https://github.com/Versent/saml2aws/releases/download/v2.36.17/saml2aws_2.36.16_linux_amd64.tar.gz | tar xvzf - -C /tmp |
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
@echo off | |
setlocal enabledelayedexpansion | |
cd %~dp0 | |
for /f "usebackq tokens=4*" %%a in (`tasklist /v ^| findstr RDP`) do ( | |
set SessionNumber=%%a | |
) | |
tscon !SessionNumber! /dest:console |
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
<# | |
.SYNOPSIS | |
セッション状態を確認するスクリプト | |
.DESCRIPTION | |
対象ユーザのセッションがアクティブでない場合にLINEへ通知を送る | |
.EXAMPLE | |
PS C:\Users> .\session-checker.ps1 -token xxxx -server test-server -user Administrator | |
... |
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
$windows_module_installer = "TrustedInstaller" | |
$windows_update = "wuauserv" | |
Get-Service -Name $windows_module_installer | |
Get-Service -Name $windows_update | |
$answer = (Read-Host "Windows Update 有効化/無効化 (e/d)") | |
if($answer -eq "e"){ | |
Set-Service -Name $windows_module_installer -StartupType "Manual" |
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
PECO_VERSION="v0.5.11" | |
curl -LOk https://github.com/peco/peco/releases/download/${PECO_VERSION}/peco_linux_amd64.tar.gz | |
tar -xf peco_linux_amd64.tar.gz | |
sudo chmod +x peco_linux_amd64/peco | |
sudo cp peco_linux_amd64/peco /usr/local/bin/peco |
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
LIBEVENT_VERSION="2.1.12-stable" | |
TMUX_VERSION="3.2a" | |
sudo yum install -y gcc kernel-devel make ncurses-devel openssl-devel | |
curl -LOk https://github.com/libevent/libevent/releases/download/release-${LIBEVENT_VERSION}/libevent-${LIBEVENT_VERSION}.tar.gz | |
tar -xf libevent-${LIBEVENT_VERSION}.tar.gz | |
cd libevent-${LIBEVENT_VERSION} | |
./configure --prefix=/usr/local | |
make -j4 |
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
#!/bin/bash | |
ok=true | |
for file in $(git diff --name-only --cached | grep .mqh); do | |
if [ "`nkf --guess $file | grep 'Shift_JIS'`" ]; then | |
: | |
else | |
ok=false | |
echo "$file is not Shift_JIS" | |
fi |
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
# output: 1 - 100 | |
# don't use "if" and "for" | |
print "\n".join(map(lambda x: [["FizzBuzz", "Fizz"], ["Buzz", str(x)]][bool(x%3)][bool(x%5)], range(1, 101))) |
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 -*- | |
# if文禁止 | |
print([i%j == 0 for i, j in zip([int(input())]*3, [4, 100, 400])].count(True) % 2 == 1) | |
# if文・for文禁止 | |
print(sum(list(map(lambda x, y: x%y == 0, [int(input())]*3, [4, 100, 400]))) % 2 == 1) |
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
from collections import Counter | |
my_dict = {'F': 200, 'G': 500, 'D': 100, 'E': 400, 'B': 200, 'C': 300, 'A': 500} | |
# duplicate values list | |
dup_list = [k for k, v in Counter(my_dict.values()).items() if v > 1] # [200, 500] | |
print({k: v for k, v in my_dict.items() if v in dup_list}) # {'F': 200, 'G': 500, 'B': 200, 'A': 500} |
NewerOlder