Skip to content

Instantly share code, notes, and snippets.

View tokida's full-sized avatar

Hideaki Tokida tokida

View GitHub Profile
@tokida
tokida / FollowerSilent.js
Last active October 31, 2020 01:39
Diablo2 Kolbot alternate follower script ( via https://pastebin.com/LnXCQ3ES )
/*
* Follower by kolton
*
* you should set "LocalChat" in mode 2 for all chars:
* Config.LocalChat.Enabled = true; // enable the LocalChat system
* Config.LocalChat.Mode = 2; // 0 = disabled, 1 = chat from 'say' (recommended), 2 = all chat (for manual play)
*
* version: 28.02.2020
*
* silent-automated follower changes:
@tokida
tokida / ansible_create_swap_tasks_main.yml
Last active May 14, 2019 02:55
create swap on Ubuntu
---
- name: carete swapfile
command: dd if=/dev/zero of={{ swap_file }} bs={{ ansible_memtotal_mb }} count=1M
args:
creates: '{{ swap_file }}'
- file:
path: '{{ swap_file }}'
mode: '0600'

皆さん、Slackを使っていますか!?

Bluemix User Groupでもコミュニケーション様にSlackを用意してますがなかなか利活用されていません。 そこで、もっと皆が楽しく使うためにはどうしたらよいか!その答えをBotに求めたいと思います!

実施内容

ルール

  • Bluemixのライトアカウントで動く範囲で作成してください。
  • 今日のゴールはアイディアが出るところまで。
import requests
import base64
def main(dict):
# check dict
# dict { url }
dummy = 'https://2e1690af-4bca-4a99-9200-b1307b8f0427-bluemix.cloudant.com/photo/e447266d3d2dbb824e3ebfa2509c7f0c/sample.jpg'
geturl = ''
if ( dict.get('url',dummy) ):
geturl = dict.get('url',dummy)
@tokida
tokida / todoist2slack_openwhisk.py
Created January 26, 2017 15:59
openwhisk action : today todo in todoist 2 slack post
import requests
import datetime
import json
def main(dict):
token = dict.get('todoist_token')
project_id = dict.get('todoist_projectId')
url = dict.get('slack_url')
# -*- coding: utf-8 -*-
import requests
from datetime import datetime as dt
def getAllList(token):
q = {
'token': token,
'seq_no': 0,
@tokida
tokida / gist:b9ea87f7994c45107c429d621c2343d2
Created June 30, 2016 06:24
ansible-playbook ubuntu localization(japan)
# Install Modules
- name: apt-get update
apt: update_cache=yes cache_valid_time=3600
- name: standard application install
apt: name={{ item }} state=latest install_recommends=yes
with_items:
- git
@tokida
tokida / dispToTemp.py
Created May 20, 2016 19:21
i2c接続のBME280センサーで取得した値を LCD(AQM0802A)に描画する
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 温度計の温度をLCDに表示する
import smbus
import time
from datetime import datetime
class BME280:
@tokida
tokida / Rakefile
Last active February 27, 2016 15:50 — forked from kyanny/Rakefile
Qiita::Team お引越しスクリプト
require 'json'
require 'yaml'
require 'nokogiri'
require 'uri'
require 'faraday'
require 'ostruct'
require 'pry'
require 'time'
def y data
# docker-library/buildpack-deps:curl
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
&& rm -rf /var/lib/apt/lists/*
# docker-library/buildpack-deps:scm
apt-get update && apt-get install -y --no-install-recommends \