Category : bash

Install VLC Enable the camera and select finish, reboot. Start streaming Add contents: Save, test it: If it works, stop it again, Control + C Create a startup script with contents: Save it. Make it executable Add it to always start up Reboot and test that it starts up Reboot and test that it starts ..

Read more

# be root sudo su # install utils apt-get install ntfs-3g root@pi2:/home/pi# blkid   /dev/mmcblk0p1: SEC_TYPE=”msdos” LABEL=”boot” UUID=”7D5C-A285″ TYPE=”vfat” /dev/mmcblk0p2: UUID=”5d18be51-3217-4679-9c72-a54e0fc53d6b” TYPE=”ext4″ /dev/sda1: LABEL=”TinyTerra1″ UUID=”C642B17842B16E35″ TYPE=”ntfs”   # create mount dir mkdir /mnt/d1 # edit fstab nano /etc/fstab # add: # drive 1 terra UUID=”C642B17842B16E35″ /mnt/d1 ntfs defaults,errors=remount,rw 0 1   # mount it mount ..

Read more

# make the dir mkdir /mnt/mount1 # list the drives ls -l /dev/disk/by-uuid/ total 0 lrwxrwxrwx 1 root root 15 May 6 2015 13d368bf-6dbf-4751-8ba1-88bed06bef77 -> ../../mmcblk0p2 lrwxrwxrwx 1 root root 15 May 6 2015 15CD-3B79 -> ../../mmcblk0p1 lrwxrwxrwx 1 root root 10 Dec 6 22:22 ba20caf8-6ef0-42e7-9e45-4187bfa8e543 -> ../../sda1 # get the ID, ex: ba20caf8-6ef0-42e7-9e45-4187bfa8e543 # ..

Read more

#!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin start() { cd /opt/tomcat/current/bin/ /bin/su pi /opt/tomcat/current/bin/startup.sh } stop() { /bin/su pi /opt/tomcat/current/bin/shutdown.sh } case $1 in start|stop) $1;; restart) ..

Read more

#!/bin/bash if [ -z “$1” ]; then echo echo usage: $0 network-interface [delay in seconds] echo echo e.g. $0 eth0 echo e.g. $0 wlan0 30 echo exit fi if [ -z “$2” ]; then DELAY=5 echo “Using default, showing bandwidth usage every $DELAY seconds” else DELAY=1 fi IF=$1 while true do R1=`cat /sys/class/net/$1/statistics/rx_bytes` T1=`cat /sys/class/net/$1/statistics/tx_bytes` ..

Read more

#!/bin/sh LOG=/tmp/syncSvn.log SOURCE=/home/svn/dev/ DESTINATION=/mnt/d3/myd3/home/svn/dev EMAIL=root@localhost START=$(date +%s) echo “” > $LOG echo “Start ” >> $LOG echo `date` >> $LOG echo “Now beginning sync $SOURCE to $DESTINATION ” >> $LOG rsync –verbose –archive –recursive –delete-during –human-readable –progress –itemize-changes $SOURCE $DESTINATION >> $LOG echo “Finished sync $SOURCE to $DESTINATION ” >> $LOG echo “Checking SOURCE $SOURCE ..

Read more