Skip to content

Instantly share code, notes, and snippets.

@yoh2
yoh2 / bf.pl
Created December 12, 2013 14:13
何となく書いてしまったBrainf*ck実装。
#!/usr/bin/perl -w
# usage: bf.pl [source (default: stdin)]
sub run_bf
{
my @prog = @_;
my $ip = 0;
my $dp = 0;
@yoh2
yoh2 / swat
Created June 21, 2013 19:34
SWATを有効にするためのxinetd設定ファイル /etc/xinetd.d/swat の我が家での設定。 デフォルトだとonly_fromがlocalhostになっていることがあって、そのままでは他ホストからアクセスできないのできちんと設定するのがミソ。 面倒なら 0.0.0.0/0 で横着する手も。
# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
# to configure your Samba server. To use SWAT, \
# connect to port 901 with your favorite web browser.
# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/config/swat.xinetd,v 1.1 2007/09/07 21:07:40 dev-zero Exp $
service swat
{
port = 901
socket_type = stream
@yoh2
yoh2 / nyancat
Created June 21, 2013 19:11
VPSに設定しているtelnetポート設定
service telnet
{
socket_type = stream
protocol = tcp
wait = no
user = games
server = /usr/games/bin/nyancat
server_args = -t
only_from = 0.0.0.0/0 ::/0
flags = IPv6
@yoh2
yoh2 / nanoなの.txt
Created May 22, 2013 17:35
vim、emacsの他にnanoも使ってます!
$ cat /proc/cpuinfo
processor : 0
vendor_id : CentaurHauls
cpu family : 6
model : 15
model name : VIA Nano processor L2200@1600MHz
stepping : 3
cpu MHz : 800.000
cache size : 1024 KB
fpu : yes
@yoh2
yoh2 / make.conf-note
Created May 12, 2013 11:31
make.conf晒し。これはノートPCの。
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /etc/make.conf.example for a more detailed example.
CFLAGS="-O2 -funroll-loops -ftree-vectorize -ftree-loop-optimize -march=native -mtune=native -msse4.2 -pipe"
#CFLAGS="-O2 -funroll-loops -pipe"
#CFLAGS="-O2 -funroll-loops -march=nocona -mtune=nocona -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
@yoh2
yoh2 / make.conf-tower
Created May 12, 2013 11:25
make.conf晒してみる。これはデスクトップ用途のタワーPC
# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
#CFLAGS="-O2 -mtune=i686 -pipe"
#CFLAGS="-O2 -march=opteron -mtune=opteron -pipe"
CFLAGS="-O3 -march=native -mtune=native -msse4a -mfma -mfma4 -mxop -pipe -ftree-vectorize -ftree-loop-optimize"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="$CFLAGS"
FFLAGS="$CFLAGS"
MAKEOPTS="-j45"
#MAKEOPTS="-j33"