Posts

How to update lookup fileld of Kintone using pykintone

 When you try to update kintone record's lookup field, you will fail see the error saying you don't have enough privilege to do that. "フィールド「XXXX」の値「YYYY」が、ルックアップの参照先のフィールドにないか、またはアプリやフィールドの閲覧権限がありません。" This is because you need to have both writing access to looking-up application and reading access to looked-up application. You can include two api tokens in header for REST API, you can also do that by pykintone just connect two api tokens by comma. import pykintone app = pykintone.app('tr3xr', "30", "tokenXXX...XXX,tokenYYY....YYY") Isn't that easy?

SSH fails with "client_loop: send disconnect: Broken pipe"

 Thanks to  this page(japanese) , following ~/.ssh/config setting worked for me!! Host * IPQoS lowdelay throughput

When "sam local start-api" does not mount public folder as "/"...

With aws-sam-cli, I've been experiencing public folder is not mounted as root(/). For example, if we have ./public/index.html file, it should be accessed as "http://localhost:3000/index.html" after  # sam local start-api (You doesn't have to have -s or --static-dir option if public  folder is OK for you) To make it work  Make sure you have the public folder. confirm  Following message on the screen, "Mounting static files from /api/sam-app/public at /" If the message doesn't show even though you have a public folder (which was my case), try remove . aws-sam/build folder. At least it worked for my case. .aws-sam/build is recreated every time sam build is executed, so I use shell script removing the folder before sam local start-api.

Using cheap Intel ComputeStick STCK1A8LFC with Lubuntu 18.04

Image
I bought a cheap Intel Compute Stick PC(STCK1A8LFC, 1GB RAM/8GB storage) to make it a remote 3D printer host for my M3D micro+(https://printm3d.com/themicro/). Since M3D micro+ only works on Windows and Linux now (Mac version is incompatible to Mojave), I installed a Lubuntu to it. Although, there is a blog about the a script (isorespin.sh) for customizing bootable iso image to Atom base PC(http://linuxiumcomau.blogspot.com/2017/06/customizing-ubuntu-isos-documentation.html), it seems we don't need it anymore. So, here is what I did. 1. Update bios download latest bios image from https://downloadcenter.intel.com/download/28070/BIOS-Update-FCBYT10H-86A-?product=84815 . Choose Recovery BIOS update [FC0038.bio]. save it to a USB flash drive. restart ComputeStick hitting F7 from BIOS update menu, choose USB and FC00XX.bio. 2. Install Lubuntu Download lubuntu alternate image from https://lubuntu.me/downloads/ . We cannot install from normal lubuntu iso bec...

How to format IPython starck trace. (IPythonのスタックトレースを見やすくする)

Image
Problem IPython is absolutely great tool to create Python code interactively, but when I use complicated libraries like pandas or scipy, its stack trace gets very very long and it's hard to find where was the original mistake, thanks to the verbose rich texts explaining errors. Moreover, although there are several libraries which can format the stack traces, they don't work with IPython, because IPython skip standard sys.excepthook. https://stackoverflow.com/questions/1261668/cannot-override-sys-excepthook Here is how to make it work, using one of those formatting tool TBVaccine ( https://github.com/skorokithakis/tbvaccine ). I wrote following at the python initial code(script set for $PYTHONSTARTUP). try: import tbvaccine kargs = {"code_dir":os.getenv('PWD'), "isolate":True, "show_vars":False} tbvaccine.add_hook(**kargs) if get_ipython(): # IPYTHON tbv = tbvaccine.TBVaccine(**kargs) def f(*args, **argv): tbv.prin...

Python pip stop working because of SSL Error on Mac (with Homebrew)

I bought a new MacBook pro, and recover from an old MacBook ends successfully, but "pip" stopped working because of the SSL Error . pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Even upgrading pip like this pip install --upgrade pip fails. It seems homebrew python is upgraded and SSL was old too. see links Change from pip 3.4 to 3.5 , Unable to install Python libraries Here is how I fixed. brew reinstall openssl curl https://bootstrap.pypa.io/get-pip.py | python3