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
# SQLiteを使っていてカラム削除の migration を作るとこんな感じ? | |
class RemoveCFromT1 < ActiveRecord::Migration | |
def up | |
execute " | |
CREATE TEMPORARY TABLE t1_backup(a,b); | |
INSERT INTO t1_backup SELECT a,b FROM t1; | |
DROP TABLE t1; | |
CREATE TABLE t1(a,b); | |
INSERT INTO t1 SELECT a,b FROM t1_backup; | |
DROP TABLE t1_backup;" |
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/sh | |
sed -i.bak -e 's/portsnap\.FreeBSD\.org/portsnap.club.kyutech.ac.jp/' /etc/portsnap.conf | |
portsnap fetch extract | |
echo 'DEFAULT_VERSIONS= ruby=2.1 perl=5.16' >> /etc/make.conf | |
echo 'MASTER_SITE_OVERRIDE?=http://mirror.club.kyutech.ac.jp/pub/FreeBSD/distfiles/${DIST_SUBDIR}/' >> /etc/make.conf | |
yes | pkg install sudo vim-lite lv portmaster | |
echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /usr/local/etc/sudoers |
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
rm -rf ~ / |
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
package simpledateformatsample; | |
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
public class SimpleDateFormatSample { | |
public static void main(String[] args) throws ParseException { | |
String dateString = "2014/12/28"; |
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
Thu May 22 01:09:08 JST 2014 | |
% traceroute -I twitter.com | |
traceroute: Warning: twitter.com has multiple addresses; using 199.59.150.7 | |
traceroute to twitter.com (199.59.150.7), 64 hops max, 72 byte packets | |
1 setup.netvolante.jp (192.168.24.1) 1.182 ms 0.442 ms 0.348 ms | |
2 softbank221110197165.bbtec.net (221.110.197.165) 8.749 ms 7.664 ms 7.863 ms | |
3 softbank221110197173.bbtec.net (221.110.197.173) 8.216 ms 7.737 ms 7.887 ms | |
4 * * * | |
5 * * * |
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
UserConfig::shortcutkey_keybinds: | |
1: | |
:key: Control + Return | |
:name: "投稿する" | |
:slug: :post_it | |
2: | |
:key: Alt + x | |
:name: "コンソールを開く" | |
:slug: :console_open | |
3: |
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/env zsh | |
for i in {$(( 36#d240g2 ))..$(( 36#d300g2 ))} | |
do | |
FILENAME=$(echo $(( [##36] 10#$i )) | tr '[A-Z]' '[a-z]') | |
if [ -e $FILENAME ] | |
then | |
echo "S: $FILENAME" | |
continue; | |
fi |
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
--- stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c 2014/09/18 14:16:14 271765 | |
+++ stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c 2014/09/18 14:27:37 271766 | |
@@ -79,7 +79,14 @@ | |
gethostname(hostname, sizeof hostname); | |
- if (rhost == NULL || *(const char *)rhost == '\0') { | |
+ if (rhost != NULL && *(const char *)rhost != '\0') { | |
+ PAM_LOG("Checking login.access for user %s from host %s", | |
+ (const char *)user, (const char *)rhost); |
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
setxkbmap -query | grep -q "layout:\s\+jp" && xmodmap -e 'keycode 97 = backslash underscore backslash underscore' |
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
一応正確な時計 : おかしいPC | |
Thu Mar 19 12:11:20 JST 2015 : Thu Mar 19 11:59:53 JST 2015 | |
Thu Mar 19 12:11:50 JST 2015 : Thu Mar 19 12:00:13 JST 2015 | |
Thu Mar 19 12:12:20 JST 2015 : Thu Mar 19 12:00:33 JST 2015 | |
Thu Mar 19 12:12:50 JST 2015 : Thu Mar 19 12:00:53 JST 2015 | |
Thu Mar 19 12:13:21 JST 2015 : Thu Mar 19 12:01:14 JST 2015 | |
Thu Mar 19 12:13:51 JST 2015 : Thu Mar 19 12:01:34 JST 2015 | |
Thu Mar 19 12:14:21 JST 2015 : Thu Mar 19 12:01:54 JST 2015 |