Social security for getting on a large amount Beat The Cycle Of Debt Beat The Cycle Of Debt for an approved in addition questions.

Safe1405 – Automated or Interactive Asterisk backup solution -with auto FTP upload

Posted: April 27th, 2009 | Author: | Filed under: Asterisk VoIP, Linux, Tech, Uncategorized | Tags: , , , , , , , , , , , , , , , , , , , , , , , , , | 6 Comments »

Summary:

Safe1405 is a bash script that will backup the popular Asterisk directories and place them in a tar.gz file. The script can be used in 1 of 2 modes.
The first mode is interactive, with a menu to choose:

  • Backup Everything (/etc/asterisk, Voicemail, Recordings, Sounds)
  • Just VM
  • Just Recordings
  • Just Sounds

After the file is created, it will prompt to upload to a remote FTP server.

The second mode is silent, and is best suited for automated execution via cron or at.
Just enable the UNATTENDED and PUT_FTP variables by setting them to “1″.  You can directly edit the paths to each directory if yours are non-standard.

The script can be directly downloaded here: Safe1405 Download Link

Code:

#!/bin/bash
# Safe1405
# Author: Gregg Hansen - www.thiscoolsite.com
# Safely tar and gzip Asterisk files

# Version 1.0 20090427
#-Backs up all important Asterisk files - Tar/Gz
#-Choose the file name, or Date by default
#-GUI-like. Able to be silent for cron, or interactive

#EDIT the below ABSOLUTE paths to match your directory structure:
VAR_LIB="/var/lib/asterisk"
ETC_AST="/etc/asterisk"
VM="/var/spool/asterisk/voicemail"
MON="/var/spool/asterisk/monitor"

#Date Var
FILEDATE="$(date +%Y%m%d)"
#Your ServerName
#Filename is FILEDATE-SERVERNAME.tar.gz
SERVERNAME="Chicago-Ast01"

#Enable unattended mode/Remote FTP put (useful for Cron):
# Backup of /etc/asterisk ONLY (default)
# 1 = On, 0 = Off
UNATTENDED="0"
PUT_FTP="0"

#FTP Credentials
FTP_IP="127.0.0.1"
FTP_USER="admin"
FTP_PASS="secret"

###--START CODE---###

### Interactive Mode Functions ###
prompt()
{
cat <<EOF

Safe1405 Backup

1) Everything
2) /etc/asterisk
3) Voicemail
4) Recordings
5) Sounds
Q) Quit

EOF

echo -n "Prompt> "
read INPUT
case $INPUT in
1) everything;;
2) etc-ast;;
3) vm;;
4) recordings;;
5) sounds;;
q) exit;;
Q) exit;;
esac

}
everything()
{
FILENAME="$FILEDATE-$SERVERNAME-FULL.tar.gz"
tar cfvz $FILENAME $ETC_AST $VM $MON $VAR_LIB
ftpprompt
}
etc-ast()
{
FILENAME="$FILEDATE-$SERVERNAME-ETC_AST.tar.gz"
tar cfvz $FILENAME $ETC_AST
ftpprompt
}
vm()
{
FILENAME="$FILEDATE-$SERVERNAME-VM.tar.gz"
tar cfvz $FILENAME $VM
ftpprompt
}
recordings()
{
FILENAME="$FILEDATE-$SERVERNAME-REC.tar.gz"
tar cfvz $FILENAME $MON
ftpprompt
}
sounds()
{
FILENAME="$FILEDATE-$SERVERNAME-SOUNDS.tar.gz"
tar cfvz $FILENAME $VAR_LIB
ftpprompt
}
ftpprompt()
{
echo -en "Upload $FILENAME to FTP? (y or n) "
read INPUT
if [ "$INPUT" == "y" ]; then
quietftp
fi
}

### Unattended Mode Functions ###
silent()
{
tar cfvz $FILEDATE-$SERVERNAME-ETC-AST.tar.gz $ETC_AST ##Uncomment##$VM #$MON #$VAR_LIB
FILENAME="$FILEDATE-$SERVERNAME-ETC-AST.tar.gz"
}

quietftp()
{
ftp -ivn <<EOF
open $FTP_IP

user $FTP_USER $FTP_PASS
binary
put $FILENAME
bye
EOF
}
#### Start Program Flow ###
clear
#Unattended Function Call(s)
if [ "$UNATTENDED" == "1" ]; then
silent
if [ "$PUT_FTP" == "1" ]; then
quietftp
exit
fi
exit
fi
#Interactive Function Calls
prompt
exit

###–END CODE—###
Leave a comment if you have questions/suggestions or would like help setting up the script.
-Gregg


MAME – The build, the legend, and I finally documented some work!

Posted: September 5th, 2008 | Author: | Filed under: Uncategorized | Tags: , , , , , | No Comments »

Januaryish 2008 I picked up 2 arcade machine cabinets.  Vindicators and Dig Dug (both for $70ish total).  I happily gave the Vindicators machine to my friend Matt and began gutting the dig dug machine as soon as it was in my garage.  I remember Matt telling me to take pictures and document my work because it is really interesting to read about peoples’ builds online.  But no, my obsession with getting it done in less than a week made me forget about taking any fabrication/build pictures.

Not this time though!  I decided to redo my machine after moving to Illinois because my Dad has a bitchin’ wood shop.  I took pictures, time lapse videos, and I used Cherry for the control panel! Cherry switches…why not have Cherry wood to go along with it??

Here is an original Dig Dug cabinet picture for reference:

Here is what it looked like after my 5-day gut/mod fiasco:

Not too bad right? Wrong! Most of my favorite games use the 4-way joysticks.  This is a big problem if you have 8-way joysticks installed.  The new version has selectable restrictor plates that can limit the joysticks to 4-way and 8-way, that is going to significantly increase my Donkey Kong score.

I’m surprised how much interest an old arcade machine sparks, my entire family and a few friends have helped out so far.
Here is a pic of my brother cutting the Cherry directly out of the shelf! We couldn’t get it out any other way.

My Dad’s saw blades are kind of dull, we smoked out the house twice cutting the hard cherry.

Here is the wood all angled and ready for hole-drilling. The trackball fits perfect!

Cherry is a hardwood.  I’m really glad we have a drill press.

Here is a picture of the control panel with all of the controls mounted and ready to rock!
If you are curious, I am leaving the control panel woodgrain.  Why? Because according to my Dad, “It is a sin to paint Cherry”.  And I am not a sinner.

Just for reference, check out the old pine control panel that will never be used again.

The sweet wiring job I did on the new panel!

The 19″ LCD that I used to make fun of every time I went to Matt’s house.  Thanks again Matt!
I wont be making fun of it now.

Catfish? They speak like the french.  wee wee yuaa yuaaaa

Wow I have A.D.D.
The only things I have left to do on the arcade machine are:

-Setup fluorescent bulb behind marquee and mount switch on top-behind cabinet
-Mount motherboard and computer peripherals inside the cabinet (mimicking the original ROM board location)
-Paint the cabinet
-make surrounding trim below the control panel
-make trim for monitor (not cardboard this time!)

Here’s a time-lapse video of everyone working on the machine, it looks like I didn’t do much work, but I did 80% of the build so far.

I’ll append to this post when I have another update.

—APPENDED SECTION—

I finished the machine!
Here are the updated pictures.
I also worked for 6 hours or so on a DJ stand this Saturday.
ENJOY!




Sweet Guitar Hero Guitar Holder…Frets on Fire

Here is the DJ Stand pic


The Cheesesteak and Filming Extravaganza

Posted: August 31st, 2008 | Author: | Filed under: Uncategorized | Tags: , , , , , , , , | No Comments »

Just one week ago, I went to Philadelphia to participate in an all-weekend cheesesteak-eating guerilla-filming extravaganza, it was awesome.

I know the fanfilm movie is going to turn out great for two reasons.  The first being that I have worked with Matt over at Neozaz on many projects, and every one of them has the professional look.  The second reason is that everyone involved in the movie wanted to be there, and you can tell in the scenes.

One thing I was very excited about was the authentic Philly-CheeseSteaks.  OMG
Here is my first Philly Cheese Steak ever (with Sauce, onions, and mushrooms):

The birch beer I had along with it was incredible as well.  If you don’t know what birch beer is and like root beer buy some online here. I just bought some btw, I love getting root beer in the mail.

So, Matt and I got to his parents house early Friday morning and laid out all of the filming gear:

Shortly after that, Matt’s sister Karen arrived with a ton of beverages! (Note the succulent birch beer).

I have had to recently cut back on the energy drinks though.  I get really jittery and Monster makes my heart try to jump out of my chest a little.

Moving on….
One of my favorite scenes of the movie was Chris’ shrine interview.  This guy had the most impressive Star Wars collection I have ever seen!

The scene was completely unscripted and it was naturally hilarious!  Matt and Dave couldn’t stop laughing.

I also got to work the camera a few times (which was fun) and the boom pole.

Lets see, what else.  Oh yeah, lightsaber fights mid-day.

And then we had pizza!

Then another cheesesteak!

And another.

Jedi Hitchhikers?


All in all, a fun and exhausting weekend.


The most Epic Mix

Posted: July 20th, 2008 | Author: | Filed under: Tech, Uncategorized | Tags: , , , , , , , , | 1 Comment »

Ok, Ok, I know this is blatant self-advertisement/gloating, but I am proud of my work. I try to DJ every Sunday from my house and broadcast it live via a Shoutcast relay server. Well on July 20th, 2008 I believe that I have recorded my most favorite mix ever. It starts out with Progressive, then moves to Electro, then moves into Electro-Tech, then pure Tech goodness. If you want to download any of my mixes (they are all available > 20) please check it out at www.djg-regg.com

This is a tech blog, so a bit about how to broadcast your (Podcast, DJ Session, Rap, etc.) show over the internet in case you were interested. Head on over to shoutcast.com get winamp and the shoutcast relay plugin. Set your input to the PC running winamp with the relay program, click connect, and you are good to go. If you have uber-upload speed, you can possibly host the main relay server too, but it is complicated to setup (PM me if you need help). I use http://serverroom.us for my relay. They offer 30-Simultaneous channels at 128kbps Stereo for $11.99 a month! Not too shabby.

So yeah, check out www.djg-regg.com and if you want help setting up your own internet-radio station, I can help.


First blog ever, and there’s a few things on my mind.

Posted: July 10th, 2008 | Author: | Filed under: Uncategorized | Tags: , , , , , , | No Comments »

I went in to have an operation on my foot today, and they gave me full-on anesthesia. So as I type this, I have the common haziness that is associated with prescribed drugs (oxycodone too). My foot is throbbing though. O yeah, the purpose of this blog is so I can A) speak my mind and B) write detailed instructions/findings about Linux/Asterisk/VoIP/MySQL/PHP projects I have been involved in. So I look forward sharing everything I can with the Open-Source community in the near future.