Skip to content

Instantly share code, notes, and snippets.

@synaptiko
Last active May 1, 2019 20:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save synaptiko/5638721 to your computer and use it in GitHub Desktop.
Save synaptiko/5638721 to your computer and use it in GitHub Desktop.
Useful links related to "hard" linux things when I was experimenting with Raspberry Pi, cross-compilation, emulation etc.

Mounting a hard disk image including partitions using Linux

$ parted hda.img
(parted) print
...
dd if=hda.img of=hda3.img bs=512 skip=2313360 count=17719695

Raspberry Pi under QEMU

RPi Easy SD Card Setup

Cross compiling Node.js v0.8

How to fix unsuccessful login loop

$ file ~/qemu_vms/2013-02-09-wheezy-raspbian.img
From the output of the file command, take the partition 2 'startsector' value an multiply by 512, and use this figure as the offset value in the mount command below.
$ sudo mount ~/qemu_vms/2013-02-09-wheezy-raspbian.img -o offset=62914560 /mnt
$ sudo nano /mnt/etc/ld.so.preload
Comment out the line in the file (use a # as the first character of the line) and save the file (CTRL+X, then "Y" for yes).
$ sudo umount ~/qemu_vms/2013-02-09-wheezy-raspbian.img /mnt
$ cd ~/qemu_vms/
$ qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda ~/qemu_vms/2013-02-09-wheezy-raspbian.img -redir tcp:5022::22
Qemu gives you a root shell, run:
$ fsck /dev/sda2
$ shutdown -r now

Node.js pre-compiled packages for RPi

Debian source lists

(I need sid because of libzmq3-dev package)

Recommended SD Card type

Class 6 SD card of 2GB or greater capacity. Note: for optimal performance, a Class 10 SD card is recommended. If you are storing Thumbnails on your device an 8GB capacity or greater is recommended.

How to check SD Card integrity

Take the SD card out, salvage whatever you want/can off it using another computer, then umount it there but leave it plugged in and try:

e2fsck -y -c /dev/[sdXN]

Where 'sdXN' is the second partition. That might fix things. If not, give up and replace the image on it -- it's wrecked.

After you replace the image, run the same slow fsck (with -c to check for bad blocks) on the 2nd partition while the card is in another computer. This is to make sure the card is not faulty or worn out.

GLSL on Raspberri - nice visualization through GPU

How to build home automation system

Install xbmc-send command + documentation for XBMC commands

apt-get install xbmc-eventclients-xbmc-send

Seemless loop for OMXPlayer

QEMU links

How to enable/disable service at boot

sudo update-rc.d -f nginx defaults
sudo update-rc.d -f nginx remove

WiFi

Driver for TP-LINK TL-WN725N v.2.0:

SSH Tunneling

Temperature sensor

epeg & libjpeg

libjpeg: http://arcoleo.org/dsawiki/Wiki.jsp?page=How%20to%20Install%20Libjpeg%20on%20Mac

$ curl -O http://www.ijg.org/files/jpegsrc.v8c.tar.gz
$ tar zxvf jpegsrc.v8c.tar.gz
$ cd jpeg-8c/
$ ./configure
$ make
$ sudo make install

epeg: https://github.com/mattes/epeg

git clone https://github.com/mattes/epeg.git
cd epeg && ./configure && make && sudo make install

troubleshoot:

ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment