Skip to content

Instantly share code, notes, and snippets.

cat php.ini.org | grep -v ";" | grep -v '^\s*$' > php.ini
export IFS=$'\n';for file in `find . -iname "*.avif"`;do echo "${file} -> ${file%%.avif}.jpg";convert "${file}" "${file%%.avif}.jpg" && /bin/rm -vf "${file}";done
// ==UserScript==
// @name nicovideo fake premium
// @namespace https://piou.dev
// @include https://www.nicovideo.jp/watch/*
// @version 1.2.0
// @grant none
// @run-at document-start
// ==/UserScript==
const observer = new MutationObserver((mutations) => {
@tknr
tknr / drawthumbnail.js
Created March 24, 2022 01:38
文字列から画像生成
String.prototype.toZenkaku = function () {
return String(this).replace(/[!-~]/g, function (all) {
return String.fromCharCode(all.charCodeAt(0) + 0xFEE0);
});
}
String.prototype.chunk = function (length) {
return this.match(new RegExp('.{1,' + length + '}', 'g'));
}
@tknr
tknr / compact_all.sh
Last active January 25, 2022 09:42
do compact all virtualbox hdds
#/bin/bash
## https://www.ringosan.net/?p=258
export IFS=$'\n'
for uuid in `vboxmanage list hdds | grep ^UUID | sed 's/ //g'| cut -d ':' -f 2`
do
echo ${uuid}
vboxmanage modifyhd ${uuid} --compact
done
<#
.SYNOPSIS
exports installed packages.
.DESCRIPTION
exports installed packages:
exportChocolatey.ps1 > packages.config
You can install the packages using :
choco install packages.config -y
.LINK
https://gist.github.com/alimbada/449ddf65b4ef9752eff3
@tknr
tknr / dommune.html
Created May 28, 2019 11:21
dommuneがustreamで放送されてた頃に画面いっぱいに見るためのhtml。今はもう使えないので放流
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>
dommune
</title>
<style type="text/css">
<!--
#body{ margin: 0px; } #video { margin:0px; padding:0px; } #timeline { margin:0px; padding:0px; }
@tknr
tknr / optimize_sqlite_db.sh
Created March 21, 2019 16:21
optimize sqlite db files
## http://d-goo.hatenablog.com/entry/2013/07/30/124148
for db in `find ~/ -name *.db`;do echo ${db};sqlite3 ${db} vacuum; sqlite3 ${db} reindex;done
#!/bin/bash -x
echo "this command must be executed in root user."
if [ ${EUID:-${UID}} != 0 ]; then
echo 'do this with being root . for example : sudo su - '
exit 1;
fi
## install maildev
yum -y install nodejs npm postfix
#! /bin/bash
### BEGIN INIT INFO
# Provides: maildev
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Maildev
# Description: This file starts and stops Maildev server
#