Skip to content

Instantly share code, notes, and snippets.

View katz's full-sized avatar

Katsuyuki Sakai katz

View GitHub Profile
@ar-android
ar-android / Api.java
Created November 10, 2016 16:59
OkHttp With RxAndroid and RxJava
public static Observable<Response> getData() {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
final OkHttpClient client = new OkHttpClient();
final Request request = new Request.Builder()
.url("https://github.com/ar-android/panfic/raw/master/Panfic/gen/com/ocit/data.json")
.get()
.addHeader("cache-control", "no-cache")
@nebgnahz
nebgnahz / shaper
Last active June 21, 2024 19:45
Traffic Shape using `tc` for Linux
#!/bin/bash
set -e
function usage() {
cat << EOF
USAGE:
./shaper start <interface> <bw as XXX kbit>
./shaper clear <interface>
./shaper show <interface>
EOF
@kchenery
kchenery / raspberrydog.md
Last active January 26, 2020 07:58
Steps for setting up DataDog agent as a systemd service on a Raspberry PI

Install the requirements

sudo apt-get install sysstat

Install the agent from Datadog "from source". You'll get a command to run on the Pi that looks like this:

DD_API_KEY=0123456789abcdef0123456789abcdef sh -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/setup_agent.sh)"

Run that and wait for it to install and the agent to start running.

@zwaldowski
zwaldowski / safari-inline-video.sh
Last active December 10, 2020 07:31
Safari Inline Video
defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
@voluntas
voluntas / saikyo.rst
Last active September 13, 2023 02:33
ぼくのかんがえたさいきょうの超低遅延大規模配信

ぼくのかんがえたさいきょうの超低遅延大規模配信

更新:2018-08-20
作者:@voluntas
バージョン:18.8.3
URL:https://voluntas.github.io/
@voluntas
voluntas / webrtc_ advantage.rst
Last active October 16, 2020 02:24
WebRTC の優位性

WebRTC の優位性

更新:2018-09-21
作者:@voluntas
作者サイト:https://voluntas.github.io/
バージョン:18.9.3
セッション日時:2018-09-25 21:10-21:30
セッション場所:さくらインターネット 大阪本社
@lizthegrey
lizthegrey / attributes.rb
Last active April 29, 2026 20:02
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@xl1
xl1 / gist:940d653451fd96a06618a6df08d5df84
Last active July 21, 2025 10:14
PDF に謎の漢字が含まれるとき

PDF に謎の漢字が含まれるとき

PDF などの中にある一部の日本語の漢字が、見た目は同じだけど異なる謎の文字に変換されていることがある

@TheZoc
TheZoc / Setting up guide for ArchLinux on Raspberry Pi.md
Last active March 18, 2026 01:19
This is a guide to setup Arch Linux in Raspberry Pi 4, using macOS as the auxiliary system.

Raspberry Pi Setup Guide

This guide will use either a macOS or an ArchLinux base system, to prepare a microSD card with Arch Linux for Raspberry Pi.

If someone managed to do the initial setup using Windows, please let me know, so I can add to this guide.

This guide will be verbose at times for some simple tasks. This is intended to help people just starting out, so it's not confusing. If something confuses you, let me know and I'll try my best to answer it.