09/3/13

Rsync shell script with ssh

Alright so I got my dose of hard knocks today. I was running rsync directly from crontab but I decided it was time to make a script to keep it all in one place instead of having some crazy cryptic rsync mumbo jumbo in my crontab. Anyways what I had running was working well but it didn’t exactly translate over to a script very well. This is what I tried at first……..looks good but it wasn’t.

#!/bin/sh

rsync -avz --delete -e ssh /srv/daily/test/ [email protected]:/srv/test/ > /var/log/rsync.biweekly.log 2>&1
#copy from daily bkup to remote server
/bin/echo $(/bin/date +%b_%d_%Y_%H.%M.%S) >> /var/log/rsync.biweekly.log
#put date on rsync log

This basically kept giving me a failed password. I had to check the remote server /var/log/auth.log to see what was going on. Eventually I figured out that the shell script would need to be explicitly pointed to my ssh keys. I changed the ssh to “ssh -i /dir/where/your/sshkeys/are” And that did the trick.

#!/bin/sh
rsync -avz --delete -e "ssh -i /home/test/.ssh/id_rsa" /srv/daily/test/ [email protected]:/srv/test/ > /var/log/rsync.biweekly.log 2>&1
#copy from daily bkup to remote server
/bin/echo $(/bin/date +%b_%d_%Y_%H.%M.%S) >> /var/log/rsync.biweekly.log
#put date on rsync log
08/8/13

Raspberry Pi VCHIQ Beatdown

Wow so I finally got a Raspberry Pi (I know where have I been). First thing I did was slap some Arch linux happiness upon the Pi. It set up easy as…….Pi. Well I didn’t get any accessories with my Rpi because I figured I’d print or machine my own at some point down the road. Soooo that means I have some naked Raspberries hanging out there so I had to do something to cover up. So I cut a hole in the back of the ESD bag that it came in and ran the power wire through there and ran my cat-6 in the other side and I’m kinda covered at this point.

I was a little concerned about the heat caused by running the thing in a plastic bag so my first order of business was to be able to take a look at the operating temps of the thing. Luckily they have built in all kinds of monitoring goodies in the Rpi. I was trying to run the measure_temp function but I kept getting some fun errors.

[example@alarmpi bin]$ /opt/vc/bin/vcgencmd measure_temp
VCHI initialization failed

After searching around for awhile I found that the user needed to be in the video group to access VCHI. So I added the user to the video group. And I got the same error. So then I thought well maybe I need to run as sudo.

[example@alarmpi bin]$ sudo /opt/vc/bin/vcgencmd measure_temp
temp=49.8'C

BINGO! Kinda. Well that works for now but what if I need to run it from something that doesn’t have sudo. I’ll be beagleboned. After even more searching around I finally find something that may work.

echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules

Is specifically what I was looking at. After adding that to my udev rules I’m able to run measure_temp without being root or sudo.

[example@alarmpi bin]$ /opt/vc/bin/vcgencmd measure_temp
temp=49.8'C
08/3/13

Morgan 3d printer construction

We got a bunch of work done on the Morgan 3d printer. These are just some of my pics. I’ll try and keep a good log of the whole construction process. We plan on having classes at makelab on building and printing with one of these.

RepRap Morgan Construction

[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-37-01.jpg]2550
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-37-16.jpg]100
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-37-23.jpg]80
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-37-25.jpg]110
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-37-32.jpg]70
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-37-37.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-37-41.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-38-18.jpg]80
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-38-21.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-38-24.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-38-26.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-38-56.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-39-01.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-39-03.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-39-08.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-30-22-39-10.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-16-57-55.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-16-57-58.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-16-58-13.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-16-58-30.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-16-58-45.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-17-22-46.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-17-22-50.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-17-22-56.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-07-31-17-23-13.jpg]60
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-02-20-06-40.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-02-20-06-45.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-02-20-06-50.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-02-20-07-09.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-02-20-07-16.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-02-20-07-19.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-03-15-07-20.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-03-15-07-26.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-03-15-07-32.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-03-15-07-42.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-03-15-07-43.jpg]20
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-03-15-07-44.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-03-15-07-51.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-04-09-31-52.jpg]60
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-04-09-32-02.jpg]80
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-04-09-35-22.jpg]60
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-17-53-46.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-17-53-54.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-04-09-50-14.jpg]120
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-17-53-38.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-04-09-58-11.jpg]60
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-04-09-58-16.jpg]90
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-17-53-30.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-04-10-31-31.jpg]90
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-17-56-08.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-17-56-16.jpg]60
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-17-56-22.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-18-43-57.jpg]60
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-18-44-07.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-19-37-20.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-19-38-41.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-19-38-49.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-19-38-57.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-19-39-00.jpg]50
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-19-39-05.jpg]60
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-19-39-08.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-45-37.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-45-44.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-45-52.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-45-59.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-46-08.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-52-47.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-52-56.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-52-58.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-52-59.jpg]40
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-53-08.jpg]30
[img src=http://llancaster.com/wp/wp-content/flagallery/reprap-morgan-construction/thumbs/thumbs_2013-08-16-21-53-12.jpg]40