Skip to content

Instantly share code, notes, and snippets.

View tsubauaaa's full-sized avatar

tsubauaaa tsubauaaa

View GitHub Profile
@tsubauaaa
tsubauaaa / rename.sh
Created May 21, 2019 11:45
Rename the file directly below
#! /bin/bash
i=1
for f in IMG_*
do
if [ $i -ge 10 ]; then
mv $f 010_00$i.jpg
else
mv $f 010_000$i.jpg
fi
#! /usr/bin/env ruby
require 'net-snmp2'
Net::SNMP.init
Net::SNMP::Debug.logger = Logger.new(STDOUT)
session = Net::SNMP::TrapSession.open(
peername: 'localhost:199',
version: '2c',
@tsubauaaa
tsubauaaa / sqlserver-inspec-default_spec.rb
Created June 13, 2016 11:27
inspec file of sqlserver chef cookbook
control 'check-dot-net-3.5-installed' do
impact 1.0
title 'check dot net 3.5 installed'
desc 'Check dot net 3.5 is installed'
describe windows_feature('.NET Framework 3.5 Features') do
it { should be_installed }
end
end
control 'check-sql-server-installed' do
@tsubauaaa
tsubauaaa / sqlserver-chefspec-default_spec.rb
Last active June 13, 2016 11:26
chefspec file of sqlserver chef cookbook
require 'chefspec'
RSpec.configure do |config|
config.platform = 'windows'
config.version = '2012R2'
end
describe 'sqlserver::default' do
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
before do
@tsubauaaa
tsubauaaa / sqlserver-default.rb
Last active June 13, 2016 12:09
recipe of sqlserver chef cookbook
#
# Cookbook Name:: sqlserver
# Recipe:: default
#
# Copyright 2016, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell_script 'delete-install-directory' do
code <<-EOC
@tsubauaaa
tsubauaaa / Dockerfile_oracle11g
Created February 27, 2016 15:47
Dockerfile for run Oracle11g
FROM oraclelinux:6
MAINTAINER tsubasa1173@gmail.com
### setup
RUN groupadd -g 200 oinstall
RUN groupadd -g 201 dba
RUN groupadd -g 202 oper
RUN useradd -m -g oinstall -G oinstall -u 440 oracle
RUN echo oracle:oracle | /usr/sbin/chpasswd
RUN gpasswd -a oracle dba
RUN gpasswd -a oracle oper
@tsubauaaa
tsubauaaa / string_category.xlsx
Last active November 4, 2015 04:39
If that contain the string , classified into each of its string.
=IFERROR(VLOOKUP(LOOKUP(0,0/FIND(Sheet1!$A$2:$A$8,B2),Sheet1!$A$2:$A$8),Sheet1!$A$2:$B$100,2,0),"N/A")
@tsubauaaa
tsubauaaa / zabb_history_val.rb
Last active October 19, 2015 10:13
zabbix api history value get before 5m
#! /usr/bin/env ruby
require "zabbixapi"
require "yaml"
require "time"
config = YAML.load(File.read(".zabbix/config.yml"))
zabbix_url = config['URL']
zabbix_user = config['USER']
zabbix_passwd = config['PASSWORD']
@tsubauaaa
tsubauaaa / user_macro_reg.rb
Last active October 19, 2015 00:29
zabbix api user macro registration
#! /usr/bin/env ruby
#./user_macro_reg.rb host01 '{$INSTANCEID}' "i-a1b2c3d4"
require "zabbixapi"
unless ARGV.size == 3
puts "Usage: #{$0} [AGENT_HOST_NAME] [USERMACRO_NAME] [USERMACRO_VALUE]"
exit 1
end
@tsubauaaa
tsubauaaa / cs_vmsnapshot_count.rb
Last active October 19, 2015 10:20
cloudstack api rest response
#!/usr/bin/env ruby
require 'net/http'
require 'openssl'
require 'base64'
require 'cgi'
require 'yaml'
require 'json'
require 'time'
begin