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 ..
Category : bash
Description: ASUS USB-N10 Wireless Adapter IEEE 802.11b/g/n USB 2.0 Up to 150Mbps Wireless Data Rates 64/128-bit WEP, TKIP, AES, WPA-PSK, WPA2-PSK Plug it in: Turn on hub: Test the connection by downloading large files. endlessdownload.sh: Examp..
..
..
..
Example script call: Shell script: Samp..
How to mount a remote directory onto the local pi computer: Install SSH file system tools: # Add user pi to the fuse group: sudo gpasswd -a pi fuse Log out from the system. Reconnect as user pi. # make dir sudo mkdir /mnt/pimount # change ownership sudo chown pi:pi /mnt/pimount # mount ..
# 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 ..
..
# 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 # ..
install samba sudo apt-get install samba # below, replace johnsmith with your user id that you want to connect to samba (i.e. not “pi”) # create a new group called samba sudo groupadd samba # create a system user who should have samba access, set all default info, and a password sudo adduser –no-create-home –disabled-password –disabled-login ..
#!/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) ..
#!/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` ..
#!/bin/bash # SET THIS! This is the URL to your large file that # you’re downloading over and over again URL=http://192.168.0.10/test/a # use wget to grab the file, redirect to dev null: COUNTER=0 TOTAL=0 while true; do GB=$((TOTAL >> 30)) MB=$((TOTAL >> 20)) echo “Run #$COUNTER at `date` Total downloaded $MB MB, $GB GB” wget ..
systemctl restart system..
#!/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 ..
In this example, we have a directory with a lot of files which have no extension. We need to add “.jpg” at the end of each file name. We’re using Git Bash in Windows because we can do it in 1 line. First, do this so that files with spaces in the name are not ..
Add this section at ..
..
cd /my/directory # remove files that are older than 7 days find . -maxdepth 1 -mtime +7 -exec rm..