Skip to content

Instantly share code, notes, and snippets.

@mafice
mafice / server.properties
Created December 8, 2012 10:36
server.properties
generator-settings=
allow-nether=true
level-name=world
enable-query=false
allow-flight=false
server-port=25565
level-type=DEFAULT
enable-rcon=false
level-seed=
server-ip=
@mafice
mafice / server.py
Created December 5, 2012 08:47
Minecraftサーバ管理スクリプト
#!/usr/bin/env python3
import os
import sys
import subprocess
import threading
import urllib
import time
import re
import yaml
import requests
@mafice
mafice / lanch_vm.scpt
Created November 8, 2012 12:33
launch a VM and Terminal in full-screen mode on Mac OS X
#
# save this code as a application in the AppleScript Editor.
#
set VMNAME to "############ VM NAME ############"
set SSH_PORT to "############ SSH_PORT ############"
tell application "Terminal"
do script "VBoxManage startvm '" & VMNAME & "'" in window 1
activate
@mafice
mafice / minectaft_server.py
Created October 28, 2012 13:14
Minecraftサーバのあれ
#!/usr/bin/env python3
import os
import sys
import subprocess
import threading
import time
import re
cmd = "java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui"
@mafice
mafice / build_omake.sh
Created October 11, 2012 13:09
Build OMake 0.9.8.5
#!/bin/sh
cd /tmp
mkdir build_omake && cd build_omake
curl -O http://omake.metaprl.org/downloads/omake-0.9.8.5-3.tar.gz
tar xf omake-0.9.8.5-3.tar.gz
curl -O https://gist.github.com/raw/63e85213323a7c034145/9ea9db61c59e9b44f6de8aff9392fdc25540cb3b/build_omake-0.9.8.5.patch
patch -p0 < build_omake-0.9.8.5.patch
cd omake-0.9.8.5
make bootstrap
./omake-boot
@mafice
mafice / alias
Created September 18, 2012 14:33
launch VirtualBox VM and ssh into Guest OS (OS X -> Arch Linux)
VBOX_ARCH="Arch Linux x64"
alias arch="VBoxManage startvm '$VBOX_ARCH';
sleep 3;
osascript -e 'tell application \"System Events\" to set visible of process \"VirtualBox VM\" to false';
ssh localhost -p 1234"
@mafice
mafice / japanese_env.md
Created September 4, 2012 13:51
Arch LinuxのCUIに日本語のあれを作る
  • ロケールの設定をちゃんとやる LANGja_JP.UTF-8じゃないとnanoとかが文字化けするっぽい

  • フレームバッファが使えるかどうかチェック /proc/fbがあればOKらしい

  • fbtermをインストール libx86のインストールが推奨されてるけど多分要らない

@mafice
mafice / gist:3462089
Created August 25, 2012 07:31
Postfixとのやりとり
220 localhost ESMTP Postfix (Ubuntu)
HELO localhost
250 localhost
MAIL FROM: root@localhost
250 2.1.0 Ok
RCPT TO: seiya@localhost
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
From: root@localhost
@mafice
mafice / get_curPos.html
Created August 25, 2012 06:42
get cursor X-Y position in textarea
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<p style="font-weight:bold" id="debug"></p>
<textarea style="font-size:15px;"></textarea>
<script>
@mafice
mafice / setup.sh
Created August 10, 2012 09:30
setup.sh (Ubuntu Server)
#!/bin/sh
#
# $ wget http://bit.ly/setup_mf_ubuntu_server -O - | sh
#
cd
sudo ntpdate ntp.nict.jp
sudo apt-get update