Skip to content

Instantly share code, notes, and snippets.

# putty をインストールする
-> % brew install putty
Updating Homebrew...
# この中の −0の private-openssh で最終的にKeyを作る
-> % puttygen -h
PuTTYgen: key generator and converter for the PuTTY tools
Release 0.73
Usage: puttygen ( keyfile | -t type [ -b bits ] )
[ -C comment ] [ -P ] [ -q ]
# python コマンドは、2.7.16
-> % python
Python 2.7.16 (default, Jan 27 2020, 04:46:15)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
# それは、以下のPATHのことなので
-> % /usr/bin/python
Python 2.7.16 (default, Jan 27 2020, 04:46:15)
# エラーの内容
-> % gcloud compute instances -h
pyenv: python2: command not found
The `python2' command exists in these Python versions:
2.7.15
2.7.15/envs/iotdemo
2.7.15/envs/py27
iotdemo
py27
#1 空のレポジトリをクローンする
gcloud source repos clone <NEW REPOSITORY NAME> --project=s002
cd <NEW REPOSITORY NAME>
#2 コピーしたいレポジトリをRemoteに temp という名前として追加
git remote add temp https://source.developers.google.com/p/s001/r/<OLD REPOSITORY NAME>
#3 LOCALにプルする この場合は、MasterとしてPULLしている
git pull temp master
#4 変更して、コミット
git add .
git commit -m "initial commit"
#!/usr/bin/env python
import argparse
import datetime
import os
import random
import ssl
import time
import jwt
# --- 追加(ここから) ---
@pumpkinpietea
pumpkinpietea / checklocationOnLocation.py
Created July 27, 2019 00:38
gettint location information of Iphone from Pythonista
import location
import json
import datetime
address_now=location.get_location()
address_now.update(created=datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S"))
output = json.dumps(address_now)
print (output)
print(type(output))
print(type(address_now))
results = location.reverse_geocode(address_now)
# find と rfind メソッドを試す
a = 'THIS IS A PEN. THIS IS AN APPLE.'
# 1: 'IS' を前から探す → 2が返ってくる
print(a.find('IS'))
# 2: 'THIS' を前から探す → 0が返ってくる
print(a.find('THIS'))
# 3: 'THIS' を後ろから探す → 15が返ってくる
# -*- coding: utf-8 -*-
import sys
from operator import itemgetter
# input
a = []
for i in range(6):
a1, a2, a3 = map(str, input().split())
a.append([a1, int(a2), a3])
# ソート前
print('Before Sort')
# -*- coding: utf-8 -*-
# ColabのPython3(Python 3.6.7)で実行
################
# 素因数分解   試し割り法
################
def factorization(n):
i = 2
l = []
const mapToObj = inputMap => {
const obj = {}
for (const [key, value] of inputMap) {
obj[key] = value
}
return obj
}
const example = new Map([['udon', 500], ['soba', 500], ['ramen', 800], ['mentaipasta', 1000]])