This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
SUDO_COMMAND=pkexec | |
#SUDO_COMMAND=gksu | |
#SUDO_COMMAND=kdesu | |
avilable_governors=($(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)) | |
#avilable_governors=(powersave performance) | |
#avilable_governors=(powersave schedutil performance) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function build_repoliststr { | |
ruby -ryaml -e 'print YAML.load(ARGF).map {|i| i.join(":::") }.join("%%%")' $HOME/.config/reasonset/workrepos.yaml | |
} | |
export repoliststr="$(build_repoliststr)" | |
function splitrepos { | |
echo $repoliststr | sed 's:%%%:\n:g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# -*- mode: ruby; coding: utf-8 -*- | |
pwlength = ARGV.shift&.to_i || 64 | |
pwlength = 64 if pwlength < 1 | |
converter_symbols = ARGV.shift&.each_char | |
converter = converter_symbols ? ("a" .. "z").to_a + ("A" .. "Z").to_a + ("0" .. "9").to_a + converter_symbols : ('!' .. '~').to_a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
from PyQt5.QtCore import * | |
from PyQt5.QtWidgets import QApplication | |
from PyQt5.QtWebEngineWidgets import * | |
app = QApplication(sys.argv) | |
web = QWebEngineView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'yaml' | |
logic = {} | |
File.open(ARGV.shift) do |f| | |
logic = YAML.load f | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
setopt EXTENDED_GLOB | |
device="$(zenity --title="Select Device" --width=600 --height=500 --list --column="DEVICES" "${(f)$(xinput --list | ruby -e 'print ARGF.each.map {|i| i =~ /[^A-Za-z]*([A-za-z1-9 ]+[a-zA-Z0-9])\s*id=(\d+)/; "#$2 #$1\n" }.join.chomp')}"| perl -ne '/\d+/; print $&;')" | |
if (( $? == 0 )) && [[ -n $device ]] | |
then | |
action="$(zenity --list --column="ACTION" "turn on" "turn off")" | |
if (( $? == 0 )) && [[ -n $action ]] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
#### Default Settings #### | |
hts_voicefile=/usr/share/open-jtalk/voices/mei_normal.htsvoice | |
mecab_dictdir=/usr/share/open-jtalk/dic/ | |
jtalk_tuning=(-a 0.6 -r 0.8 -fm -2.0 -jf 1.5) | |
jtalk_tmpfile=$HOME/tmp/forcedtodo.wav | |
notify_interval=180 | |
notify_time=15000 | |
task_editor=mousepad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
# Generate HTML files from Markdown files. | |
# It convert foo/bar.md to foo/bar.html | |
# This needs Pandoc. | |
STYLE_FILE="$HOME/local/repos/markdown-css/build/github/github.css" | |
BODY_CLASS="github" | |
PANDOC_OPTS=(-s --self-contained -t html5 -c $STYLE_FILE --toc) | |
for i in **/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
zmodload zsh/net/socket | |
producer() { | |
typeset -i threads="$1" | |
typeset -i deadcount=0 | |
shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
worker() { | |
worker_num=$1 | |
while true | |
do | |
exec 9>| lock | |
flock -x 9 | |
num=$(read -e) | |
exec 9>&- |
NewerOlder