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 pathlib | |
| import os | |
| import pipes | |
| import subprocess | |
| import sys | |
| # Add env to prevent the Protobuf error | |
| os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python' | |
| # I forgot what to install ... | |
| import yaml |
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
| # Forked from https://gist.github.com/pganssle/0e3a5f828b4d07d79447f6ced8e7e4db | |
| # Licensed under MIT License which the author permits to release with. | |
| # Copyright 2024 Takumi Sueda | |
| # Copyright 2019 Paul Ganssle | |
| # A clang-format style that approximates Python's PEP 7 | |
| # Useful for IDE integration | |
| BasedOnStyle: Google | |
| AlwaysBreakAfterReturnType: AllDefinitions | |
| AllowShortIfStatementsOnASingleLine: false |
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
| ''' | |
| This script scrapes okayamahealthtourism.com/food/okayama-city/ and | |
| gathers all restaurants' name and address. | |
| The result will be printed out to the stdout. Redirect the stderr | |
| if you find it annoying. | |
| The result will need some hand-picking and hand-cleansing. | |
| While I've never confirmed, this will work for Maniwa City page. |
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
| #!/bin/sh | |
| g=/sys/kernel/config/usb_gadget/eth | |
| mkdir ${g} | |
| echo "0x3066" > ${g}/bcdDevice | |
| echo "1" > ${g}/os_desc/use | |
| echo "0xcd" > ${g}/os_desc/b_vendor_code | |
| echo "MSFT100" > ${g}/os_desc/qw_sign |
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
| """ | |
| Slack Archive Emoji Counter | |
| Copyright (c) 2023 Takumi Sueda (puhitaku@gmail.com) | |
| SPDX-License-Identifier: MIT | |
| Put this script by the channel directories and run it. | |
| """ | |
| import json | |
| import sys |
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 time | |
| from datetime import datetime | |
| from email.utils import parsedate | |
| # pip install requests | |
| import requests | |
| last = 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
| #!/bin/sh | |
| if [ -e /proc/sys/fs/binfmt_misc/qemu-arm ]; then | |
| echo "qemu-arm is already registered to binfmt_misc." | |
| exit 1 | |
| fi | |
| # Ref: https://docs.kernel.org/admin-guide/binfmt-misc.html | |
| NAME='qemu-arm' | |
| TYPE='M' |
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 requests as req | |
| from bs4 import BeautifulSoup | |
| def scrape_tokai() -> list[tuple]: | |
| res = req.get('https://www.jr-cp.co.jp/wp-json/wp/v2/services?per_page=100&services_category=21') | |
| j = res.json() | |
| return [(item['title']['rendered'], item['data']['price_services']) for item in res.json()] |
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 requests as req | |
| from bs4 import BeautifulSoup | |
| def scrape_tokai() -> list[tuple]: | |
| res = req.get('https://www.jr-cp.co.jp/wp-json/wp/v2/services?per_page=100&services_category=21') | |
| j = res.json() | |
| return [(item['title']['rendered'], item['data']['price_services']) for item in res.json()] | |
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
| U-Boot 1.1.3 (Oct 3 2014 - 14:23:51) | |
| Board: Ralink APSoC DRAM: 64 MB | |
| relocate_code Pointer at: 83fb4000 | |
| enable ephy clock...done. rf reg 29 = 5 | |
| SSC disabled. | |
| spi_wait_nsec: 29 | |
| spi device id: ef 40 18 0 0 (40180000) |
NewerOlder