Skip to content

Instantly share code, notes, and snippets.

View lo48576's full-sized avatar
✔️
activated

YOSHIOKA Takuma lo48576

✔️
activated
View GitHub Profile
@lo48576
lo48576 / README
Last active December 14, 2015 12:59
utilities for @No_961
ファイル置いてく。あと解説
startmine.sh, minebackup.sh, backup_install.sh は/home/no961/mc/ に置く。
startmine.sh:
これを使ってマイクラ鯖プロセスを起動する。Ctrl+Cで終了。
起動時にramdiskを4GiB確保(実際は、使用される分だけメモリが動的に確保され、その最大が4GiB)。
なお、この容量は変更可能。スクリプト見ればわかる。
また、正常終了/強制終了に関わらず、スクリプト終了の際にデータをHDD側に同期し、ramdiskを開放。
ramdisk確保の際にroot権限が必要なため、パスワードを求められるが、マイクラ鯖自体は特権を用いずに起動される。
また、実行ファイル(jarファイル)自体もramdiskにコピーされ、そちらの方のが起動される。
@lo48576
lo48576 / walk-input.js
Created April 9, 2013 07:10
walk-input.js which works correctly in firefox20. 本家が修正されるまではこっち使おう
// Vimperator plugin: 'Walk Input'
// License: BSD
// Version: 1.3.0
// Maintainer: Takayama Fumihiko <[email protected]>
// anekos <[email protected]>
// ------------------------------------------------------------
// The focus walks <input> & <textarea> elements.
// If you type M-i first, the focus moves to "<input name='search' />".
// Then if you type M-i once more, the focus moves to "<input name='name' />".
@lo48576
lo48576 / ssh_attack_report.sh
Last active December 16, 2015 00:59
sshへの攻撃(正確にはログイン失敗)を検出し、twitterへ報告を上げる。twish( https://github.com/L1048576/hikikomorish/blob/master/twish.sh )必須。
#!/bin/sh
IFS=":"
EXE_DIR="`dirname "$0"`"
TEMP_ATTACK_LOG="${EXE_DIR}/.ssh_attack.log"
DATETIME_CACHE="${EXE_DIR}/.ssh_attack_datetime_cache"
NOW="$(date '+%Y-%m-%d %H:%M:%S' --date="@$(( `date '+%s'` - 1 ))")"
if [ ! -r "${DATETIME_CACHE}" ] ; then
@lo48576
lo48576 / README
Last active August 29, 2015 14:00
auto login scripts for TokyoTech Portal and titech-pubnet
titech-automatrix-bookmarklet.js : ブックマークレット用にちょっとだけ最適化したコード
titech-automatrix.user.js : FirefoxのGreasemonkey用ユーザスクリプト
使い方:
Greasemonkey用のは使える人はわかるだろうし省略。
お気に入りに登録して使うブックマークレット用のは、
javascript:(function(d,j,i,p,m){var l=d.login,f=d.getElementsByTagName('input'),t,c;switch(location.search.replace(/[&?]Template=([^&]*)(&.*)?/,'$1')){case "userpass_key":l.usr_name.value=i;l.usr_password.value=p;l.submit();break;case "idg_key":while(j++<3){t=f.item(j);c=t.parentNode.parentNode.getElementsByTagName('th')[0].innerHTML;t.value=m[c.match(/[1-7]/)[0].charCodeAt(0)-'1'.charCodeAt(0)].charAt(c.match(/[A-J]/)[0].charCodeAt(0)-'A'.charCodeAt(0));}l.submit();break;default:location.href='http://portal.titech.ac.jp/';}})(document,0,'14X99999','password1234',["1111111111","2222222222","3333333333","4444444444","5555555555","6666666666","7777777777"]);
@lo48576
lo48576 / README
Last active August 29, 2015 14:05
~/.vim/ 以下にnszk_splash.vimとnszk_splash.txtを配置。
.vimrcに(最終行あたりに)
runtime! nszk_splash.vim
の一行を追加。
vim-splashが必要です。NeoBundleとかで入れちゃってください。
NeoBundle 'thinca/vim-splash'
とかで。
FIXME:
@lo48576
lo48576 / queen1.c
Last active August 29, 2015 14:07
n_queen
#include <stdio.h>
#include <stdlib.h>
/*
* 1マスあたり1bitなテーブルで管理しているのでメモリ消費は
* 結構少ないと思われ。
*/
typedef unsigned long uint32;
@lo48576
lo48576 / README_outdated
Last active December 7, 2017 12:34
sgr_macro.h
Moved to <https://github.com/lo48576/sgr_macro>.
@lo48576
lo48576 / main.c
Last active August 29, 2015 14:16
コメント参照。
/*!
* \file main.c
* \brief
* \date 2015/02/22
* C version: C99
*/
#ifdef __cplusplus
extern "C" {
#endif
@lo48576
lo48576 / convert.sh
Last active August 29, 2015 14:20
asciidoc to pdf (with fop)
#!/bin/sh
a2x -fpdf -dbook --fop --fop-opts="-c ./fop.xconf" --xsl-file=fop-vl-pgothic.xsl template.adoc
@lo48576
lo48576 / xmonad.hs
Created April 28, 2015 08:29
したろうさん用
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
import XMonad