README
まずエイリアス登録
# 通常bashバージョン
alias nippo="curl -sL \"https://gist.githubusercontent.com/umihico/4b131c0a9a521df40abcde701c90cc67/raw/nippo.sh?v=$(date +'%s')\" | bash -e"
# エラーした人向けdocker利用バージョン
require "google/apis/youtube_v3" | |
# rails r 'puts YoutubeHelper.search' | |
# Youtubeのdescriptionの先頭に「提供」と「(引数)」がついている動画を検索する | |
module YoutubeHelper | |
class << self | |
def service | |
youtube_service = Google::Apis::YoutubeV3::YouTubeService.new |
import { linearRegression } from "simple-statistics" | |
/** | |
* 重み付き線形回帰 | |
* https://chemstat.hatenablog.com/entry/2021/01/23/194405 | |
* @param pricesY | |
* @param pricesX | |
* @param weights | |
* @returns expectedY = intercept + slope * x | |
*/ |
import cluster from "cluster" | |
import { cpus } from "os" | |
export const multiProcessHandler = async ( | |
jobConsumer: (job: string) => Promise<void>, | |
JobQueueGenerator: () => Generator<string, void, unknown>, | |
) => { | |
if (cluster.isPrimary) { | |
console.log(`Primary ${process.pid} is running`) |
# 通常bashバージョン
alias nippo="curl -sL \"https://gist.githubusercontent.com/umihico/4b131c0a9a521df40abcde701c90cc67/raw/nippo.sh?v=$(date +'%s')\" | bash -e"
# エラーした人向けdocker利用バージョン
# https://gist.github.com/umihico/3a19974ccb251a01dc870fe39b09749f | |
function aws-sub() { | |
aws-main --incognito | |
} | |
function aws-main() { | |
if [ "$1" = "--incognito" ]; then # Sign-out current user | |
open -na 'Google Chrome' --args --incognito "https://signin.aws.amazon.com/oauth?Action=logout&redirect_uri=https://aws.amazon.com" # Mac, OSX | |
else |
Host limadocker | |
HostName localhost | |
Port 60006 | |
User lima | |
NoHostAuthenticationForLocalhost yes |
FROM public.ecr.aws/lambda/python:3.8 | |
RUN yum install -y amazon-linux-extras | |
RUN cp -r /lib/python2.7/site-packages/amazon_linux_extras /var/lang/lib/python3.8/site-packages/ | |
# TEST COMMAND -> RUN amazon-linux-extras install -y mate-desktop1.x |
cd $(mktemp -d); while true; do seq 1000 | xargs -P 1000 -I NUM sh -c 'ssh-keygen -t ed25519 -f NUM.pem -N "" -C "" > /dev/null && if grep -vi umihico NUM.pem.pub > /dev/null; then rm NUM.pem NUM.pem.pub;fi' ; if find . -mindepth 1 | read; then for f in *.pem.pub; do echo $f >> files.txt; done; test -f files.txt && head -n1 files.txt | xargs -I F curl -s -X POST -d '{"text":"F"}' https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYYYY/zzzZZZzZzzZzzZZzz; break; fi ; date ; done |
import requests | |
import time | |
TOKEN = "xoxb-12345678-12345679-thairoo1airi6om7Ahga" | |
def main(): | |
url = "https://slack.com/api/users.list?token=" + TOKEN | |
response = requests.get(url) | |
response.raise_for_status() |