Skip to content

Instantly share code, notes, and snippets.

@nogajun
nogajun / wine-japanese.reg
Last active December 18, 2023 12:12
LinuxのWine環境で日本語周りをいい感じに設定するレジストリデータ。Windowsで使われるフォント名置換とビットマップフォント無効、InputStyleをrootにします
Windows Registry Editor Version 5.00
' 文字コードをUTF-16リトルエンディアン、改行をCR+LFで保存してください
[HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements]
"Meiryo UI"="Noto Sans CJK JP"
"Meiryo"="Noto Sans CJK JP"
"MS Gothic"="Ume Gothic"
"MS Mincho"="Ume Mincho"
"MS PGothic"="Ume P Gothic"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<include ignore_missing="yes" prefix="xdg">fontconfig/msfonts.conf</include>
<match target="font">
<edit name="rgba" mode="assign">
<const>rgb</const>
</edit>
<edit name="hinting" mode="assign">
<bool>false</bool>
@nogajun
nogajun / fonts.conf
Created August 21, 2016 02:23
fontconfig
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<include ignore_missing="yes" prefix="xdg">fontconfig/msfonts.conf</include>
<match target="font">
<edit mode="assign" name="rgba"><const>rgb</const></edit>
<edit mode="assign" name="hinting"><bool>false</bool></edit>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<edit mode="assign" name="antialias"><bool>true</bool></edit>
#!/bin/bash
#
# Convert HUE/360 Palette to LibreOffice Color Palette.
# Usage: hue3602soc.sh [ HUE360_palette.txt ]
#
# input file structure
# color name: #(color code)
#
# input file example:
# white: #ffffff
#!/bin/bash
#
# Convert GIMP Palette to LibreOffice Color Palette.
# Usage: hue3602soc.sh [ GIMP_palette.gpl ]
#
# Copyright: Jun NOGATA <nogajun@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
uedamac:MEMO ueda$ echo "わたしは aho です。4 さいです。" |
sed 's/\([^a-zA-Z0-9]\) \([a-zA-Z0-9]\)/\1\2/g' |
sed 's/\([a-zA-Z0-9]\) \([^a-zA-Z0-9]\)/\1\2/g'
わたしはahoです。4さいです。
@nogajun
nogajun / tail.sh
Created November 16, 2012 15:02
Himeji IT Study Vol.11 L-1 GP 3.tail
#!/bin/bash
parse_options(){
N=5 # default line number
while getopts "n:" OPT; do
case ${OPT} in
n) N="$OPTARG" ;;
esac
done
shift $(($OPTIND-1))
@nogajun
nogajun / gpa.sh
Created November 16, 2012 15:01
Himeji IT Study Vol.11 L-1 GP 2.GPA(Grade Point Average)
#!/bin/bash
N=$(head -n1 $1)
S=$(tail -n1 $1)
A=$(echo ${S}|tr -d [BCDF])
B=$(echo ${S}|tr -d [ACDF])
C=$(echo ${S}|tr -d [ABDF])
D=$(echo ${S}|tr -d [ABCF])
F=$(echo ${S}|tr -d [ABCD])
@nogajun
nogajun / fizzbuzz.sh
Created November 16, 2012 14:59
Himeji IT Study Vol.11 L-1 GP 1. FizzBuzz
#!/bin/bash
fizzbuzz(){
NUM=""
(($1 % 3 == 0)) && NUM=${NUM}Fizz
(($1 % 5 == 0)) && NUM=${NUM}Buzz
[ ! ${NUM} ] && NUM=$1
echo ${NUM}
}
@nogajun
nogajun / gist:2130747
Created March 20, 2012 03:18
NHK FMの録音
mplayer -playlist http://mfile.akamai.com/129933/live/reflector:46051.asx\
-ao pcm:waveheader:fast:file=/dev/stdout -vo null -vc dummy -really-quiet -quiet |\
lame -h -ms - ~/20120320-nhkfm.mp3