Skip to content

Instantly share code, notes, and snippets.

View ngsw's full-sized avatar
💭
:-):-):-)

ngsw ngsw

💭
:-):-):-)
View GitHub Profile
@ngsw
ngsw / .zshrc
Created March 19, 2014 06:55
NeoBundleInstall テスト用
# Created by newuser for 4.3.10
@ngsw
ngsw / gist:9602179
Created March 17, 2014 16:04
Scratchpad_font-size
.CodeMirror { font-size: 20px !important; }
@ngsw
ngsw / ggg.rb
Last active December 21, 2015 04:39
松江市に捧ぐ
#-*- coding: utf-8 -*-
gugigi = Enumerator.new do |g|
number = 1
loop do
ggg = number % 15 == 0 ? "おどりゃクソ森" :
number % 5 == 0 ? "グギギッ" :
number % 3 == 0 ? "ギギギ" :
number % 2 == 0 ? "くやしいのう" : "ギ"
number += 1
#!/usr/bin/env bash
##(snip)
# Appends a value to an array.
#
# @param [String] $1 Name of the variable to modify
# @param [String] $2 Value to append
function append() {
eval $1[\${#$1[*]}]=$2
}
#!/bin/sh
wget http://ftp.apnic.net/stats/apnic/delegated-apnic-latest -O - |
grep ipv4 |
grep 'apnic|JP' |
awk -F'|' '{print $4"/"$5}' |
sed -e 's@4294967296@0@g' |
sed -e 's@2147483648@1@g' |
sed -e 's@1073741824@2@g' |
sed -e 's@536870912@3@g' |
@ngsw
ngsw / gist:4702660
Created February 3, 2013 17:17
Raspberry Pi swap領域増量
# swap 増やす(100MB -> 1024MB)
sudo sed -i_origin 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=1024/' /etc/dphys-swapfile
sudo service dphys-swapfile stop && sudo service dphys-swapfile start
@ngsw
ngsw / gist:4702503
Created February 3, 2013 16:47
Raspberry Pi での初期設定 無線LAN設定
# すでに raspi-config を終わらせたものとする
# 再起動重要(expand-rootfs の変更を反映/反映しないとswap変更もできないので)
reboot
# user作成 と ユーザ pi の sudo 無効化
myuser="username"
sudo groupadd -g 500 ${myuser}
sudo useradd -u 500 -o -g 500 -m ${myuser}
rm ~${myuser}/pistore.desktop
@ngsw
ngsw / gist:4702485
Created February 3, 2013 16:44
Raspberry Pi イメージを Mac で作成
# すでに Raspberry Pi がインストールされているSDカードなので
# /Volumes/Untitled と変名されている、という前提があります。
write_target=`df -h |
grep 'Untitled$' |
awk -F' ' '{print $1}' |
sed -e 's/[a-z][0-9]$//g' -e 's/disk/rdisk/g'`
diskutil unmount `df -h |
grep 'Untitled$' |
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.88
netmask 255.255.255.0
gateway 192.168.1.1
allow-hotplug wlan0
iface wlan0 inet manual
##Raspberry Pi(SD Class10)
time dd if=/dev/zero of=/tmp/1024M bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 57.3186 s, 18.7 MB/s
dd if=/dev/zero of=/tmp/1024M bs=1024 count=1048576 1.74s user 26.69s system 49% cpu 57.843 total
##MacBook Pro(SSD)
time dd if=/dev/zero of=/tmp/1024M bs=1024 count=1048576
1048576+0 records in