This file contains hidden or 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
[Unit] | |
Description=USB-gadget | |
After=NetworkManager.service | |
Wants=NetworkManager.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/usr/bin/nmcli con up usb-otg |
This file contains hidden or 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
[Unit] | |
Description=network usage by nethogs | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/home/shirou/nethogs.sh | |
Restart=always | |
RestartSec=5 | |
StartLimitInterval=0 |
This file contains hidden or 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
cat foo.json | jq -r '.dynamodb.NewImage | with_entries(.value |= (if .S then .S elif .N then (.N|tonumber) elif .NULL then null elif .BOOL then .BOOL else . end))' |
This file contains hidden or 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
// float32Tofloat64は同じ小数点以下桁数を持つfloat64を返す | |
func float32Tofloat64(f32 float32) float64 { | |
// 小数点以下何桁かを調べるために文字列に変換。7はfloat32の有効桁数 | |
strF32 := fmt.Sprintf("%.7g", f32) | |
// .からの文字数を取得 | |
pos := 0 | |
for i := 0; i < len(strF32); i++ { | |
if strF32[i] == '.' { | |
pos = len(strF32) - i - 1 |
This file contains hidden or 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
# AIX 7.2 PowerPC "POWER9" | |
# https://github.com/shirou/gopsutil/pull/1651#issuecomment-2123753059 | |
sudo qemu-system-ppc64 -M pseries,ic-mode=xics -cpu POWER9 \ | |
-smp 4,sockets=4,cores=2,threads=2,maxcpus=16 \ | |
-m 4096 \ | |
-name aix_7200-04-02-2027 \ | |
-netdev bridge,id=net0,br=virbr0 \ | |
-device spapr-vlan,netdev=net0,mac=52:54:00:49:53:14 \ | |
-device virtio-scsi,id=scsi0 \ | |
-drive file=/var/lib/libvirt/images/aix7.2-ppc64.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none \ |
This file contains hidden or 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 debian:trixie-slim | |
ENV LAMBDA_TASK_ROOT=/var/task | |
ENV LAMBDA_RUNTIME_DIR=/var/runtime | |
RUN apt update && apt install -y curl unzip groff jq \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install AWS CLI |
This file contains hidden or 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
const maxRetryCount = 3 | |
func (s *Server) getAlbums(ctx context.Context, albumIDs []uuid.UUID) ([]Album, error) { | |
ctx, span := tracer.Start(ctx, "getAlbums") | |
defer span.End() | |
keysToGet := make([]map[string]types.AttributeValue, len(albumIDs)) | |
for i, albumID := range albumIDs { | |
idv, err := attributevalue.Marshal(albumID.String()) | |
if err != nil { |
This file contains hidden or 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
#cloud-config | |
repo_update: true | |
repo_upgrade: all | |
packages: | |
- socat | |
write_files: | |
- content: | | |
[Unit] | |
Description=Socat Port forward | |
Wants=network-online.target |
This file contains hidden or 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
local wezterm = require 'wezterm' | |
local default_prog | |
local set_environment_variables = {} | |
if wezterm.target_triple == 'x86_64-pc-windows-msvc' then | |
-- And inject clink into the command prompt | |
default_prog = | |
{ 'powershell.exe', '-NoLogo' } | |
end |
This file contains hidden or 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
import boto3 | |
DBName = 'shiroutest' | |
client = boto3.client('timestream-query') | |
SQL = "SELECT * FROM shiroutest.USDJPY WHERE time between '2022-08-15' and '2022-08-16' " | |
paginator = client.get_paginator('query') | |
pageIterator = paginator.paginate( | |
QueryString=SQL, |
NewerOlder