sdoro Blog

A blogging framework for hackers.

Testing Octopress

how to detect cdrom device

1
2
3
4
5
$ wodim --devices
wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
0  dev='/dev/sg1'      rwrw-- : 'TSSTcorp' 'DVD+-RW TS-H653B'
-------------------------------------------------------------------------

gist embedding

Include Code Snippets

(bigG.sh) download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

APK=../apk

# start emulator
# emulator -avd am -partition-size 1000

# wait until emulator is ready:
adb -s emulator-5554 wait-for-device

# now the loading of the apks
adb -s emulator-5554 shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
adb shell chmod 777 /system/app
adb push $APK/GoogleLoginService.apk      /system/app/
adb push $APK/GoogleServicesFramework.apk /system/app/
adb push $APK/Phonesky.apk                /system/app/
adb shell rm /system/app/SdkSetup*

# maps:
#adb push $APK/com.google.android.apps.maps-1.apk /system/app/
#adb push $APK/com.google.android.gms-2.apk /system/app/

# bot
(Nodo.java) download
1
2
3
4
5
6
7
8
9
public class Nodo {
  char info;
  Nodo next;

  public Nodo (char c) {
    info = c;
    next = null;
  }
}
(dhcprelay.startup) download
1
2
3
4
5
6
7
8
ip link set eth0 up
ip address add 10.2.0.2/16 brd + dev eth0

ip route add default via 10.2.0.1

#DEBIAN_FRONTEND=noninteractive dpkg -i /root/*.deb
debconf-set-selections /root/sel.txt
dpkg -i /root/dh*.deb
(lab.conf) download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
machines="router2 dhcprelay pc3 pc1 router1 pc2"

router1[0]=A
router1[1]=B
router1[mem]=64

router2[0]=C
router2[1]=A
router2[mem]=64

dhcprelay[0]=C
dhcprelay[mem]=64

pc1[0]=A
pc2[0]=B
pc3[0]=C
(pc1.startup) download
1
dhclient eth0
(router1.startup) download
1
2
3
4
5
6
7
8
9
10
ip link set eth0 up
ip link set eth1 up
ip address add 10.0.0.1/16 broadcast 10.0.255.255 dev eth0
ip address add 10.1.0.1/16 brd       +            dev eth1

ip route add 10.2.0.0/16 via 10.0.0.2

/etc/init.d/dhcp3-server start

echo 1 > /proc/sys/net/ipv4/ip_forward

Image tag (android)

Image tag (puppetDB)

Image tag (netkit)

end