Skip to content

Instantly share code, notes, and snippets.

View kphrx's full-sized avatar

kPherox kphrx

View GitHub Profile
#!/bin/sh
# Nginx
NGINX_LATEST_VER=$(curl -sL https://nginx.org/en/CHANGES | grep 'Changes' | head -n1 | awk '{print $4}')
curl --progress-bar -L http://nginx.org/download/nginx-${NGINX_LATEST_VER}.tar.gz | tar xz
# PHP
PHP_LATEST_VER=$(curl -sL https://www.php.net/releases/feed.php | awk '/entry/,/\/entry/' | tr '\n' ' ' | awk '{ print $3 }')
curl --progress-bar -L http://jp2.php.net/get/php-${PHP_LATEST_VER}.tar.xz/from/this/mirror | tar xJ
#!/bin/sh
if [ "$(whoami)" != "root" ]; then
exit 126
fi
#!/bin/sh
echo -n "Default yes [Y/n]: "
read y
if [[ "${y:0:1}" == [nN] ]]; then
echo "Answer no."
exit 1
fi
#!/bin/sh
abort () {
echo "Aborted."
exit 1
}
echo "Ctrl-D to continue, Ctrl-C to abort."
trap abort 2
@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
@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 / 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"

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
#!/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;
@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 <[email protected]>
==/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 {