Skip to content

Instantly share code, notes, and snippets.

View kphrx's full-sized avatar

kPherox kphrx

View GitHub Profile
echo 'APT::Install-Recommends "false";
APT::Install-Suggests "false";' | sudo tee /etc/apt/apt.conf.d/00install-recommends > /dev/null
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce nftables
sudo update-alternatives --set iptables $(which iptables-nft)
sudo update-alternatives --set ip6tables $(which ip6tables-nft)
sudo usermod -aG docker $(whoami)
@kphrx
kphrx / feelcycle-diff-sheet.user.js
Last active May 14, 2021 12:37 — forked from owatan/feelcycle-diff-sheet.js
FEELCYCLE の予約ページで難易度を表示する userscript
// ==UserScript==
// @name feelcycle-diff-sheet.js
// @namespace http://tampermonkey.net/
// @version 0.3
// @description FEELCYCLE の予約ページで難易度を表示する userscript
// @author owatan
// @match https://m.feelcycle.com/reserve
// @icon https://m.feelcycle.com/favicon.png
// @grant none
// ==/UserScript==
@kphrx
kphrx / twitter_userid_crawl.sh
Created April 7, 2021 13:44
ツイッターのユーザーID収集。一回の実行で90000の範囲を探すのに10分ぐらいかかる
#!/bin/bash
# ##Requirements
# - twurl
# - Ruby
# - SQLite 3
set -e
# cronとかで使えるようにsqliteとruby、ruby gemsのパスを通す。これはmacOSのHomebrewで入れた場合
@kphrx
kphrx / niconico-user-page-dark-theme.user.css
Last active April 8, 2021 10:32
ニコニコ動画のマイページとユーザーページを暗くするやつ。stylish: https://userstyles.org/styles/190808
/* ==UserStyle==
@name niconico user page dark theme
@namespace kpherox.dev
@version 1.2.0
@author kPherox <admin@mail.kr-kp.com>
==/UserStyle== */
@-moz-document url-prefix("https://www.nicovideo.jp/my"),
url-prefix("https://www.nicovideo.jp/user"),
url-prefix("https://www.nicovideo.jp/series") {
body.BaseLayout {
#!/usr/bin/perl
use feature qw(say);
use strict;
use warnings;
use Cwd 'abs_path';
use File::Basename 'dirname';
use File::Spec;
use Getopt::Long 'GetOptions';
use JSON::PP;

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@kphrx
kphrx / nginx-proxy.docker-compose.yml
Last active May 13, 2020 13:13
nginx-proxy and letsencrypt-nginx-proxy-companion for Docker compose version 3
version: '3.5'
services:
nginx-proxy:
image: jwilder/nginx-proxy:alpine
restart: always
network_mode: host
ports:
- "443:443"
- "80:80"
@kphrx
kphrx / youtube-chat-hidden-name.css
Last active September 18, 2020 05:11
If you want user script/style, click raw button of youtube-chat-hidden-name.user.{js,css}
/* Need `.yt-live-chat-text-message-renderer >` for ignored Super Chat/stickers design. */
.yt-live-chat-text-message-renderer > #author-name {
display: none !important;
}
/* Floating left member badge. Need `.yt-live-chat-text-message-renderer >` for ignored Super Chat/stickers design. */
.yt-live-chat-text-message-renderer > #chat-badges {
position: absolute;
top: 8px;
left: 2px;
}
@kphrx
kphrx / LICENSE
Last active November 3, 2022 07:51
This license applies to all public Gists of https://gist.github.com/kphrx unless otherwise stated.
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
#!/bin/sh
abort () {
echo "Aborted."
exit 1
}
echo "Ctrl-D to continue, Ctrl-C to abort."
trap abort 2