Skip to content

Instantly share code, notes, and snippets.

View VTRyo's full-sized avatar
🍺
I'm a beer taster. I'm loving it

VTRyo VTRyo

🍺
I'm a beer taster. I'm loving it
View GitHub Profile
@VTRyo
VTRyo / check_s3_backup_policy.sh
Last active September 25, 2023 11:32
s3 versioning, lifecycle
#/bin/sh
################# Usage ########################
# ./check_s3_backup_policy.sh AWS_PROFILE_NAME
################################################
PROFILE=$1
if [ -z "$PROFILE" ]; then
echo "Usage: $0 <aws-profile>"
exit 1
@VTRyo
VTRyo / procedure.sql
Created June 22, 2023 04:14
This stored procedure is creating incremental dummy data in sample article table.
delimiter //
create procedure insert_loop(in x int)
begin
declare max_id int;
declare i int;
set i = 0;
select max(id) into max_id from article;
while i < x do
set i = i + 1;
insert into article values (max_id + i, concat('article', i), concat('body_', i));
@VTRyo
VTRyo / aws-get-resource-by-awsconfig.sh
Last active May 17, 2023 02:41
You can get AWS resources Type, ID, and Name by AWS Config. This result is standard output as CSV format.
services=(
"AWS::EC2::CustomerGateway"
"AWS::EC2::EIP"
"AWS::EC2::Host"
"AWS::EC2::Instance"
"AWS::EC2::InternetGateway"
"AWS::EC2::NetworkAcl"
"AWS::EC2::NetworkInterface"
"AWS::EC2::RouteTable"
"AWS::EC2::SecurityGroup"
@VTRyo
VTRyo / all_having.go
Created March 15, 2023 04:40
Do you have everything?
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
@VTRyo
VTRyo / christmas_threatens.go
Created December 20, 2022 09:00
christmas threatens to come.
package main
import (
"fmt"
"time"
)
func main() {
cnt := 14
for i := 0; i <= cnt; i++ {
@VTRyo
VTRyo / 0_setup.md
Last active August 27, 2022 10:52
Stable Diffusion
@VTRyo
VTRyo / ojousamaFizzBuzz.go
Last active June 23, 2022 06:26
10分で書いたFizzBuzzですわよ〜〜
package main
import (
"bufio"
"fmt"
"math/rand"
"os"
"strconv"
"time"
)
@VTRyo
VTRyo / fileList.go
Created May 25, 2022 10:35
List the file paths in the directory
package main
import (
"fmt"
"io/ioutil"
"path/filepath"
)
func fileList(dir string) []string {
files, err := ioutil.ReadDir(dir)
@VTRyo
VTRyo / spreadsheet.gs
Created August 16, 2021 09:04
SpreadSheet Base Settings
//アクティブシートの取得
spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
sheetname = 'シート1'
sheet = spreadsheet.getSheetByName(sheetname)
//最終行の取得
lastRow = sheet.getLastRow()
//よくある存在する行分ループするやつ
//この場合のlineNumは行番号を入れるとどの行から始めるか変更できる
@VTRyo
VTRyo / kubernetes label
Created March 17, 2021 04:01
kubernetes memo. for label
# kubernetes create labels
kubectl label nodes <NODE> <key>=<value>
# kubernetes delete labels
kubectl label nodes <NODE> <key>-