Skip to content

Instantly share code, notes, and snippets.

View mamemomonga's full-sized avatar
🏠
Working from home

mamemomonga mamemomonga

🏠
Working from home
View GitHub Profile
@mamemomonga
mamemomonga / gw-450d-raspbian.patch
Last active August 29, 2015 14:13
mt7610u_wifi_sta_v3002_dpo_20130916 patch for Planex GW-450d
diff -cr mt7610u_wifi_sta_v3002_dpo_20130916.orig/Makefile mt7610u_wifi_sta_v3002_dpo_20130916/Makefile
*** mt7610u_wifi_sta_v3002_dpo_20130916.orig/Makefile 2013-09-16 23:03:08.000000000 +0900
--- mt7610u_wifi_sta_v3002_dpo_20130916/Makefile 2015-01-18 18:01:21.657950330 +0900
***************
*** 14,20 ****
# rt8592(for rt85592), mt7650e, mt7630e, mt7610e, mt7650u, mt7630u, mt7610u
ifeq ($(CHIPSET),)
! CHIPSET = mt7650u mt7630u mt7610u
endif
@mamemomonga
mamemomonga / Cygwin.bat
Created January 19, 2015 21:06
Cygwin mintty起動スクリプト
@echo off
SET HOME=/home/%USERNAME%
cd /d C:\cygwin64\bin
start "" mintty -
@mamemomonga
mamemomonga / gist:abcb2c278e689656b595
Last active August 29, 2015 14:13
Print the IP address( from raspbian /etc/rc.local )
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# Debianで起動後画面を消さないなら
vim /etc/inittab
1:2345:respawn:/sbin/getty --noclear 38400 tty1
@mamemomonga
mamemomonga / gist:1d99d33ed012442410c8
Created January 21, 2015 08:46
特定ユーザで自動ログインする (Debian)
vim /etc/inittab
#1:2345:respawn:/sbin/getty --noclear 38400 tty1
1:2345:respawn:/bin/login -f demouser tty1 </dev/tty1 >/dev/tty1 2>&1
@mamemomonga
mamemomonga / gist:1839e1cadd6dc36f45e0
Created January 22, 2015 16:52
LinuxでmDNSのSSHをアナウンスする設定
@mamemomonga
mamemomonga / gist:2d7df1c0eb99fd092a31
Last active August 29, 2015 14:13
Raspberry Pi(raspbian)でSSHからHDMI接続中の画面にXを使わず画像を表示する。
#!/bin/bash
REV=`zcat /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | grep '* firmware as of' | head -n 1 | sed -e 's/\ \*\ firmware as of \(.*\)$/\1/'`
rm -rf rasp-tmp
mkdir -p rasp-tmp
mkdir -p rasp-tmp/linux
wget https://raw.github.com/raspberrypi/firmware/$REV/extra/git_hash -O rasp-tmp/git_hash
wget https://raw.github.com/raspberrypi/firmware/$REV/extra/Module.symvers -O rasp-tmp/Module.symvers
@mamemomonga
mamemomonga / gist:84fbaaa926b9e1b7e951
Last active August 29, 2015 14:14
raspberry Piで白色Lチカ
#!/bin/sh
LEDGPIO=27
echo $LEDGPIO > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$LEDGPIO/direction
trap 'echo 0 > /sys/class/gpio/gpio$LEDGPIO/value; echo $LEDGPIO > /sys/class/gpio/unexport; exit' 1 2 3 15
while true; do
echo 1 > /sys/class/gpio/gpio$LEDGPIO/value
sleep 1
echo 0 > /sys/class/gpio/gpio$LEDGPIO/value
@mamemomonga
mamemomonga / gist:1df143258f3928b943ef
Created January 31, 2015 02:59
Raspberry Pi 直結したボタンが押されたときに反応する
#!/usr/bin/env perl
# Raspberry Pi
# Perl(IO::Poll)でGPIO 22に直結したボタンが押されたときに反応する
# プルアップはBCM2835の機能を使う、Device::BCM2835 を使ってこの設定をする
# 回路:
# [ GPIO 22 ] - [ 押しボタンスイッチ ] - [ GND ]
#
@mamemomonga
mamemomonga / gist:ef82d6d45088e4f7f3bb
Created February 5, 2015 09:45
OSXでカレントディレクトリにあるファイルのZone.Identiferを削除し、「ロック」フラグを削除し、パーミッションを644に変更する。
#!/bin/sh -x
xattr -d Zone.Identifier *
chflags -R nouchg *
sudo chown 644 *