Skip to content

Instantly share code, notes, and snippets.

View devlights's full-sized avatar
🤧
hay fever....

devlights devlights

🤧
hay fever....
View GitHub Profile
@devlights
devlights / README.md
Created September 30, 2024 09:47
[Java] モジュール形式でjarファイルまで作成する手順 (IDEを使わずに)

Java

$ java -version
openjdk version "23" 2024-09-17
OpenJDK Runtime Environment Temurin-23+37 (build 23+37)
OpenJDK 64-Bit Server VM Temurin-23+37 (build 23+37, mixed mode, sharing)

手順

@devlights
devlights / script.go
Last active August 15, 2024 08:31 — forked from bessarabov/script.pl
Script to generate data shown in post 'At what time of day does famous programmers work? Part 2. Workweek vs Weekend.' — https://ivan.bessarabov.com/blog/famous-programmers-work-time-part-2-workweek-vs-weekend
/*
# Overview
git log --author="$GIT_USER_NAME" --format="%H %ai" の結果を集計するプログラムです。
# Usage
$ gcw --help
Usage of ./gcw:
-dir string
@devlights
devlights / main.go
Created August 14, 2024 15:22
Generate random strings in Golang
package main
import (
"bytes"
"io"
"math/rand"
"os"
"time"
)
@devlights
devlights / Makefile
Last active August 28, 2024 06:30
C言語でサンプル作る際のMakefile
THIS_FILE := $(CURDIR)/$(firstword $(MAKEFILE_LIST))
SRCDIR := $(CURDIR)
DESTDIR := $(CURDIR)
PROGRAM := app
PROGRAM_PATH := $(DESTDIR)/$(PROGRAM)
SRCS := $(shell find $(CURDIR) -name '*.c' -type f)
INCDIRS += $(shell find $(CURDIR) -type f -name '*.h' -exec dirname {} \; | sort | uniq)
EXT_INCDIRS +=
OBJS := $(SRCS:%.c=%.o)
DEPS := $(SRCS:%.c=%.d)
@devlights
devlights / README.md
Created March 26, 2024 12:50
gccの定義済みdefineを列挙 (gcc -dM -xc -E /dev/null)
$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
@devlights
devlights / main.go
Created March 5, 2024 15:21
[GO] C言語みたいにバイナリを構造体にキャスト
package main
import (
"bytes"
"encoding/binary"
"encoding/hex"
"fmt"
"unsafe"
)
@devlights
devlights / simple-portscan.ps1
Created February 1, 2024 09:52
PowerShellでシンプルなポートスキャン (ローカルでの確認用)
# スキャンするターゲットのIPアドレスまたはホスト名
$target = "xxx.xxx.xxx.xxx"
# スキャンするポート範囲
$startPort = 20
$endPort = 25
# 指定したポート範囲でスキャンを実行
for ($port = $startPort; $port -le $endPort; $port++) {
$tcpClient = New-Object System.Net.Sockets.TcpClient
@devlights
devlights / README.md
Created December 22, 2023 10:09
Use Gitpod CLI
@devlights
devlights / README.md
Created November 16, 2023 05:23
VSCodeのターミナルのデフォルトを pwsh にする (Windows)

設定

以下の設定を入れる。

    "terminal.integrated.defaultProfile.windows": "pwsh",
    "terminal.integrated.profiles.windows": {
        "pwsh": {
            "path": ["${env:USERPROFILE}\\scoop\\apps\\pwsh\\current\\pwsh.exe"],
 "icon": "terminal-powershell"