-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update blogtool structure and add stripexif command
- Loading branch information
Showing
19 changed files
with
275 additions
and
58 deletions.
There are no files selected for viewing
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: ジャンクPCと二郎ラーメンのオタク活動日誌 | ||
description: "" | ||
date: 2025-01-17T22:29:04.688621314+09:00 | ||
categories: | ||
- プライベート | ||
draft: true | ||
publish: true | ||
--- | ||
|
||
今日は私と大学の先輩2人で[NUNU PC](https://www.nunupc.com/)様の工房にお邪魔してきました。 | ||
|
||
## NUNU PCとは | ||
|
||
VRChat向けのPCを販売している通販サイトが[NUNU PC](https://www.nunupc.com/)です。 | ||
|
||
今回、特別な縁によって実際にPCの整備を行っている工房にお邪魔してきました。 | ||
|
||
とあるDiscordサーバーでNUNU PCさんから「うちの工房にあるジャンクなもの買わない?(要約)」と誘われたのがきっかけです。 | ||
|
||
## 工房の様子 | ||
|
||
~~とても私には手が出せないような~~多くの最新型のPCが置かれており、わくわくする環境でした。 | ||
安さだけを最重視して組んでしまう私とは違って、ケースやマザーボードのメーカーや配色が統一されたキレイなものが並んでいました。 | ||
|
||
しかし今回の目的は正規に販売されているものではなく、売り物にならないジャンクな物たちです。 | ||
お店では扱えない古い世代の代物を格安で譲っていただきました。 | ||
|
||
## 譲っていただいたもの |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
title: 大学の仲間と石打丸山スキー場に行った話 | ||
description: "" | ||
date: 2025-01-19T11:24:34.166058869+09:00 | ||
categories: | ||
- プライベート | ||
tags: | ||
- 旅行 | ||
- スキー | ||
draft: true | ||
publish: true | ||
--- | ||
|
||
某シェアオフィスの面々と石打丸山スキー場に行き、2日間にわたって遊んできました。 | ||
|
||
今は越後湯沢駅の前の蕎麦屋で順番を待ちながら忘れないうちに書いています。 | ||
|
||
## 持っていったもの | ||
|
||
## 一日目 | ||
|
||
一日目は主にスキーです。 | ||
|
||
### スキー場まで | ||
|
||
前橋駅から7時8分発の電車へ乗り、高崎へ向かいました。宿及びスキー場の最寄り駅である越後湯沢は新幹線で30分程度で行けるため、車の免許を持っていない交通手段弱者である私には非常にありがたいのです。 | ||
|
||
私のお財布事情を考慮すると鈍行以外の選択肢はありえないという感じなのですが、私の周りは皆新幹線で行くらしく逸れたり合流したりするのも面倒なため新幹線を選択しました。 | ||
|
||
駅前では他のスキー場へのバスに並んでいる大勢の人(私は昨年このバスに乗って神立へ行った)を通り越して、宿や出してくれている無料の送迎車に乗車。 | ||
ディズニーのファストパスやこういった際の「並んでいる人間を横目に見ながら大幅な時間短縮を行う」という行為の際に感じる優越感を得ると旅行に来たなと実感します。 | ||
(時間は金で買えるとはこのことでしょう。) | ||
|
||
今回宿泊した場所は[LODGE CANADA](https://www.lodgecanada.com/)さんです。 | ||
|
||
### スキー | ||
|
||
宿に到着したら、早速お部屋に向かいます。今回の私の部屋は4人部屋で、中には金庫とテレビがある和室で真ん中にこたつが置いてありました。(写真撮り忘れました申し訳ない。) | ||
|
||
リフト券を宿で取ってもらいお値段なんと約5000円。今回は三山共通のリフト券は使いませんでした。次は使いたいな…… | ||
午前中は初めてスキーをやるという方々に講習会。午後はスキー部の先輩とひたすら滑っていました。 | ||
この日の天気は滑り始める前までは降雪があり、滑り始めと同時に快晴になるという最高の状態でした。 | ||
|
||
山頂までリフトで登ると、他のスキー場との接続が見えると同時に下町を一望することができます。 | ||
多くのスキー場では眼の前に他の山々がドンドンという感じですが、このスキー場は実際に道路を車や人が歩いているような日常の生活が上から観察できます。 | ||
東京タワーのような感じで下町を覗き込みながら滑れるので非常に風景が楽しいスキー場でした。 | ||
|
||
![ski1](ski1.png) | ||
|
||
また、このスキー場の特色として、謎の暖房付きゲーミングリフトがあります。[サンライズエクスプレス](https://ishiuchi.or.jp/winter/facilities/sunrise-express/)とかいう | ||
この謎のゲーミングチェアの如く豪勢なこのリフトは、果たしてどこに需要があるのだろうかという感じではあるものの座り心地はやはり格別でした。 | ||
同乗可能人数もリフトで6人、ゴンドラで10人とかなりの人数が並んでいる状況にも関わらず非常に良い回転率を実現しており、結果として多く滑れたような気がします。 | ||
~~それにしても暖房機能や妙にふかふかなゲーミングチェアは不要な気がしますが。~~ | ||
|
||
<!-- ここにリフトの写真 --> | ||
|
||
昼食はスキー場の中腹にあるロッジで取りました。20歳になって初めてのスキーなのでスキー場でお酒を飲むのも初めてだったのですが、ここまでビールを美味しく感じたのは初めてでした。 | ||
カレーを食べて(写真撮り忘れ2)、そのまま後半はスキー部の先輩とひたすら滑りました。 | ||
|
||
ずっと独学と見様見真似でスキーをやっているので、パラレルが一切できず非常にカッコ悪い感じの滑り方になってしまいます。 | ||
どうにかパラレルをできるようになろうと練習を繰り返しているうちに気がついたら上級者コース(ダイナミックBコース)で思いっきり転倒しました。 | ||
板が雪に引っ張られてバランスを崩し、そのまま右足首を大きく捻って全身を強く打ち、板やストックが全部はずれた状態で下方へ3mほど転げ落ちました。 | ||
|
||
非常に急な坂なので少しでも動くと下に転げ落ちてしまうという状況で、どうしたものかと悩んでいるとめちゃくちゃ上手なスキーヤーの方が助けていただきました。 | ||
自分が憧れている将来像の1つが、この「めちゃくちゃスキーが上手い上に助けてくれるイケオジ」になりたいという密かな目標があります。 | ||
|
||
そんなこんなで16:30まで滑りました。一部のリフトが16:00で終了してしまうことを知らず、板を持って坂道を登ったことが体力を大きく消費する要因となり、 | ||
これ以上は足の疲労でコントロールが効かなくなりそうということでナイターを滑ることなく終了してしまいました。 | ||
|
||
このスキー場は昼間とナイターで具体的な境界がなく、一部のリフトは夜遅くまでやってると言った感じでリフト券も共通であるという珍しい感じです。 | ||
家に引きこもってるだけでなく体力をつけないとスポーツを十分に楽しむことはできないと日頃の運動不足を後悔しております。 | ||
|
||
コースも多い上に雪質も良く、シーズン真っ只中であるにも関わらずリフトに並ぶのは長くても数分と非常に快適なスキー場でした。 | ||
三山のリフト券や1度しか行けなかったコースも多いので、是非また行ってみたいスキー場だと思いました。 | ||
|
||
### 銭湯 | ||
|
||
当初は別の温泉に行こうとしていたものの「あそこは混んでて入浴を断られるよ」とロッジのおじさんに助言されました。 | ||
念の為電話で確認を行うと確かに定員に達しているので難しいという返事をもらった結果、またまたロッジのおじさんに代替案を教えていただきました。 | ||
|
||
そして向かったのが「ハツカ石温泉 石打ユングパルナス」です。多くのスキーヤー・ボーダーで非常に賑わっていました。 | ||
我々は温泉として向かいましたが旅館でもあるようです。ロッジのおじさんに200円割引券を頂いたので(!!)、700円で入浴できました。 | ||
|
||
お風呂の中は2種類のサウナと多くの種類の温泉があり、非常に楽しめるものでした。 | ||
|
||
## 二日目 | ||
|
||
2日目はスキーはせず、観光して午後には帰ります。 | ||
|
||
### お土産・観光 | ||
|
||
ロッジの送迎で駅まで送ってもらった後、越後湯沢駅周辺の観光をしました。 | ||
|
||
駅構内には非常に多くの | ||
|
||
### 食事 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package cmd | ||
|
||
import "github.com/Hayao0819/hayao0819.com/tools/cmd/list" | ||
import ( | ||
"github.com/Hayao0819/hayao0819.com/tools/cmd/list" | ||
"github.com/Hayao0819/nahi/cobrautils" | ||
) | ||
|
||
func init() { | ||
SubCmds = append(SubCmds, list.Cmd()) | ||
cobrautils.AddSubCmds(list.Cmd()) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package cmd | ||
|
||
import "github.com/Hayao0819/hayao0819.com/tools/cmd/moveimg" | ||
import ( | ||
"github.com/Hayao0819/hayao0819.com/tools/cmd/moveimg" | ||
"github.com/Hayao0819/nahi/cobrautils" | ||
) | ||
|
||
func init() { | ||
SubCmds = append(SubCmds, moveimg.Cmd()) | ||
cobrautils.AddSubCmds(moveimg.Cmd()) | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package cmd | ||
|
||
import "github.com/Hayao0819/hayao0819.com/tools/cmd/newpost" | ||
import ( | ||
"github.com/Hayao0819/hayao0819.com/tools/cmd/newpost" | ||
"github.com/Hayao0819/nahi/cobrautils" | ||
) | ||
|
||
func init() { | ||
SubCmds = append(SubCmds, newpost.Cmd()) | ||
cobrautils.AddSubCmds(newpost.Cmd()) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
package cmd | ||
|
||
import "github.com/spf13/cobra" | ||
import ( | ||
"github.com/Hayao0819/hayao0819.com/tools/utils/cobrautil" | ||
"github.com/Hayao0819/nahi/cobrautils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func Root() *cobra.Command { | ||
root := cobra.Command{ | ||
Use: "blogtool", | ||
Short: "ブログを管理するためのいい感じなツール", | ||
Long: "ブログの記事の新規作成やその他をよしなにしてくれるものです", | ||
} | ||
cobrautils.BindSubCmds(&root) | ||
cobrautil.ApplyTemplate(&root) | ||
return &root | ||
} | ||
|
||
var SubCmds [](*cobra.Command) = [](*cobra.Command){} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/Hayao0819/hayao0819.com/tools/cmd/stripexif" | ||
"github.com/Hayao0819/nahi/cobrautils" | ||
) | ||
|
||
func init() { | ||
cobrautils.AddSubCmds(stripexif.Cmd()) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package stripexif | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
"path" | ||
"path/filepath" | ||
|
||
"github.com/Hayao0819/hayao0819.com/tools/utils/cobrautil" | ||
"github.com/Hayao0819/nahi/flist" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func Cmd() *cobra.Command { | ||
var publicDir string | ||
var currentDir string | ||
cmd := cobra.Command{ | ||
Use: "stripexif", | ||
PreRunE: func(cmd *cobra.Command, args []string) error { | ||
var err error | ||
|
||
currentDir, err = os.Getwd() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
publicDir, err = filepath.Abs(publicDir) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
}, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
files, err := flist.Get(publicDir) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
errs := []error{} | ||
for _, file := range *files { | ||
err := stripExif(file) | ||
if err != nil { | ||
cmd.PrintErrln(err) | ||
errs = append(errs, err) | ||
} | ||
} | ||
|
||
if len(errs) > 0 { | ||
return errors.New("error occurred. see logs") | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
cobrautil.ApplyTemplate(&cmd) | ||
cmd.Flags().StringVarP(&publicDir, "public-dir", "P", path.Join(currentDir, "public", "posts"), "公開ディレクトリ") | ||
return &cmd | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package stripexif | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/Hayao0819/nahi/futils" | ||
"github.com/disintegration/imaging" | ||
) | ||
|
||
func stripExif(file string) error { | ||
|
||
ft, err := futils.DetectFileType(file) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
isImage := strings.HasPrefix(ft, "image") | ||
|
||
if !isImage { | ||
return nil | ||
} | ||
|
||
img, err := imaging.Open(file, imaging.AutoOrientation(true)) | ||
if err != nil { | ||
return err | ||
|
||
} | ||
|
||
// imaging.Save(img, file) | ||
if err := imaging.Save(img, file); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.