Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am surgicalmaskman on github.
  • I am surgicalmaskman (https://keybase.io/surgicalmaskman) on keybase.
  • I have a public key whose fingerprint is 0DB6 8F21 EB9F 650D 308A D34B CB24 A001 D9B3 FCB8

To claim this, I am signing this object:

#_preseed_V1
#### Contents of the preconfiguration file (for bullseye)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string C
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
d-i debian-installer/country string JP
d-i debian-installer/locale string C.UTF-8
@surgicalmaskman
surgicalmaskman / computus.py
Created April 2, 2019 19:02
復活祭を無限に計算できるやつ
#! /usr/bin/env python3
import datetime
print("復活祭の日付を計算します。計算したい年を入力してください。")
y = input()
if y.isdigit() != True:
print("再入力。")
y = input()
else:
pass
@surgicalmaskman
surgicalmaskman / computus.py
Created April 2, 2019 16:54
復活祭の日付を計算する python プログラム
#! /usr/bin/env python3
import datetime
year = datetime.date.today().year
for year in range(year, 2100):
a = year % 19
b = year % 4
c = year % 7
---
_nominatim_url: 'https://nominatim.openstreetmap.org/reverse?format=json&lat=35.6803200&lon=139.7436850&&zoom=18&addressdetails=1&accept-language=ja'
PH: # https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%B0%91%E3%81%AE%E4%BC%91%E6%97%A5
- {'name': '元日', 'fixed_date': [1, 1]}
- {'name': '成人の日', 'variable_date': firstJanuaryMonday, 'offset': +7}
- {'name': '建国記念の日', 'fixed_date': [2, 11]}
- {'name': '春分の日', 'variable_date': [3, 20], 'only_years': [2020, 2021, 2024, 2025, 2026]}
- {'name': '春分の日', 'variable_date': [3, 21]}
- {'name': '昭和の日', 'fixed_date': [4, 29]}
# copyright (C) 2018 @surgical21
# this sorcecode provife under Mozilla Public License v1.1 / GNU GPL v2
#!/usr/bin/env python
# -*- coding: utf8 -*-
import math
income= int(input('給与所得控除後の金額 >'))
excempt= int(input('所得控除後の合計額 >'))
base= math.floor((income-excempt)/1000)
if base <= 1950:
tax= base * 0.05
@surgicalmaskman
surgicalmaskman / iso8601ste.py
Created June 26, 2017 06:54
replace file name for ISO8601 standard to ISO 8601 extended
#! /bin/env python
# -*- coding:utf-8 -*-
import os
files= os.listdir(os.getcwd())
for i in range(len(files)):
if files[i].isdigit()== True:
print(files[i])
tmp= files[i]
yr= tmp[:4] + '-' + tmp[4:]
@surgicalmaskman
surgicalmaskman / plan_holiday.py
Last active June 20, 2020 14:49
random date generator for planned annual vacation request
import datetime
import random
def jdn1():
return datetime.datetime(datetime.date.today().year,4,1).toordinal()
def jdn12():
return datetime.datetime(datetime.date.today().year+1,3,31).toordinal()
x= [1]*10
w32tm /config /manualpeerlist:"jp.pool.ntp.org,0x8 time.nist.gov,0x8 ntp1.v6.mfeed.ad.jp,0x8 ntp2.v6.mfeed.ad.jp,0x8 ntp3.v6.mfeed.ad.jp,0x8 ntp.nict.go.jp,0x8 time.windows.com,0x8 time1.google.com,0x8 time2.google.com,0x8 time3.google.com,0x8 time4.google.com,0x8 ats1.e-timing.ne.jp,0x8 " /syncfromflags:MANUAL
#!/bin/bash
a=1
for i in RIMG*.JPG; do
s=$(printf "RIMG%04d.JPG" $a)
echo $s
mv -f $i $s
let a="${a}+10"
done