Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

mamemomonga mamemomonga

🏠
Working from home
View GitHub Profile
@mamemomonga
mamemomonga / gw-450d-raspbian.patch
Last active Aug 29, 2015
mt7610u_wifi_sta_v3002_dpo_20130916 patch for Planex GW-450d
View gw-450d-raspbian.patch
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 Jan 19, 2015
Cygwin mintty起動スクリプト
View Cygwin.bat
@echo off
SET HOME=/home/%USERNAME%
cd /d C:\cygwin64\bin
start "" mintty -
@mamemomonga
mamemomonga / gist:1d99d33ed012442410c8
Created Jan 21, 2015
特定ユーザで自動ログインする (Debian)
View gist:1d99d33ed012442410c8
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:abcb2c278e689656b595
Last active Aug 29, 2015
Print the IP address( from raspbian /etc/rc.local )
View gist:abcb2c278e689656b595
# 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:2d7df1c0eb99fd092a31
Last active Aug 29, 2015
Raspberry Pi(raspbian)でSSHからHDMI接続中の画面にXを使わず画像を表示する。
View gist:2d7df1c0eb99fd092a31
@mamemomonga
mamemomonga / gist:1839e1cadd6dc36f45e0
Created Jan 22, 2015
LinuxでmDNSのSSHをアナウンスする設定
View gist:1839e1cadd6dc36f45e0
View get-kernel-source.sh
#!/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 Aug 29, 2015
raspberry Piで白色Lチカ
View gist:84fbaaa926b9e1b7e951
#!/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 Jan 31, 2015
Raspberry Pi 直結したボタンが押されたときに反応する
View gist:1df143258f3928b943ef
#!/usr/bin/env perl
# Raspberry Pi
# Perl(IO::Poll)でGPIO 22に直結したボタンが押されたときに反応する
# プルアップはBCM2835の機能を使う、Device::BCM2835 を使ってこの設定をする
# 回路:
# [ GPIO 22 ] - [ 押しボタンスイッチ ] - [ GND ]
#
@mamemomonga
mamemomonga / gist:ef82d6d45088e4f7f3bb
Created Feb 5, 2015
OSXでカレントディレクトリにあるファイルのZone.Identiferを削除し、「ロック」フラグを削除し、パーミッションを644に変更する。
View gist:ef82d6d45088e4f7f3bb
#!/bin/sh -x
xattr -d Zone.Identifier *
chflags -R nouchg *
sudo chown 644 *