Friday, January 24, 2014

Send Text Messages (email) from a Linux Terminal

     I made the switch from Windows 7 to Linux about a year and a half ago.  Since then I've wandered through a handful of different distributions.  I started with Linux Mint and have grown very comfortable with Arch Linux over the past six months.  This isn't a post comparing and contrasting different "flavors" of Linux -- though that might be a good endeavor in the future -- but rather a nifty little process of sending text messages (via gmail) from my Linux terminal (command prompt).  The following are the steps involved; though they are distro specific to Arch, the same concept can be applied you distro of choice (Ubuntu, Mint, Fedora, etc...).

First, you'll need to download a small application called "mailx", so enter a terminal and ...
$ sudo pacman -S mailx
...then do some configuring for the application (can also use "gedit" or "vim" or your text editor of choice instead of "nano").
$ sudo nano /etc/mail.rc
Delete the contents of the file and add the following:
set sendmail="/usr/bin/mailx"
set smtp=smtp.gmail.com:587
 set smtp-use-starttls
 set ssl-verify=ignore
set ssl-auth=login
set smtp-auth-user=YourEmailAddress@gmail.com
set smtp-auth-password=YourGmailPassowrd
The basic process is something like this ...
$ mailx 10digitphonenumber@carrier.com [enter]
Enter message subject if desired [enter]
Enter message body
Press [Ctrl+d] to send
Alternatively its a bit more sleek and simple to just do...
$ echo "message contents" | mailx 10digitphonenumber@carrier.com 
There are also other arguments you can include; such as...
$ echo "message contents" | mailx -S [Message Subject] 10digitnumber@carrier.com
$ echo "message contents" | mailx -c [Carbon Copy recipient] 10digitphonenumber@carrier.com 
$ echo "message contents" | mailx -S [Message Subject] -c [CC recipient] 10digitphonenumber@carrier.com
Voila!  Your recipient will receive a text message from your Gmail address.  Here is a list of carriers and their respective message clients:
  • Verizon: 10digitphonenumber@vtext.com
  • AT&T: 10digitphonenumber@txt.att.net
  • Former AT&T customers: 10digitphonenumber@mmode.com
  • Sprint: 10digitphonenumber@messaging.sprintpcs.com
  • T-Mobile: 10digitphonenumber@tmomail.net
  • Nextel: 10digitphonenumber@messaging.nextel.com
  • Cingular: 10digitphonenumber@cingularme.com
  • Virgin Mobile: 10digitphonenumber@vmobl.com
  • Alltel: 10digitphonenumber@alltelmessage.com OR
  • 10digitphonenumber@message.alltel.com
  • CellularOne: 10digitphonenumber@mobile.celloneusa.com
  • Omnipoint: 10digitphonenumber@omnipointpcs.com
  • Qwest: 10digitphonenumber@qwestmp.com
  • Telus: 10digitphonenumber@msg.telus.com
  • Rogers Wireless: 10digitphonenumber@pcs.rogers.com
  • Fido: 10digitphonenumber@fido.ca
  • Bell Mobility: 10digitphonenumber@txt.bell.ca
  • Koodo Mobile: 10digitphonenumber@msg.koodomobile.com
  • MTS: 10digitphonenumber@text.mtsmobility.com
  • President's Choice: 10digitphonenumber@txt.bell.ca
  • Sasktel: 10digitphonenumber@sms.sasktel.com
  • Solo: 10digitphonenumber@txt.bell.ca

Saturday, January 18, 2014

Beyond Vegetarian: Part 2

     Throughout the last couple years I've gone through several stints and various incarnations of Tim Ferris's "Slow Carb Diet" (ala "The 4 Hour Body").  Recently I've been feeling the season's ripe for change and have taken another look at my notes from the book.  These days you can find a copy on Amazon for about $10 used.  If you're looking for the quick rundown of what the "fat loss" section of the book offers, a good summary cheat sheet can be found here; and the same site provides long list of other summary / cheat sheets (link here).
     This time around I've taken the most minimal approach I can while still employing the principles found in the book.  The book states that one's fitness is dictated by (varying degrees, but more or less) 60% diet, 30% exercise, and 10% drugs.  I've opted not to employ and supplements other than whey protein.  One of my favorite points of the book is the distinction between exercise and recreation.  Basically, recreation is whatever you do for fun, be that some sort of physical activity (of various degrees) or not.  On the other hand, exercise is done with the specific intent of energy consumption (calorie burning, hormone production, etc..).
     So, this incarnation involves several things for me that have some moderate changes from what is prescribed in the book (fitness and dieting should always maintain a degree of plasticity to adapt to one's intent of implementation:  goals, duration, etc...).  Below are the practices I've implemented.

Slow Carb Diet:
     This is actually easier to list foods that are not "approved":  fruit, grains, starch, sugar, and liquid calories.  This diet consists of eating a lot of legumes (beans / lentils), lean protein, eggs, and vegetables.  For more reasons as to "why"... read the book!  For me, a typical day would look something like this:

  • Breakfast - Coffee (black), 1 scoop whey protein, 1 whole jumbo egg
  • Lunch - ~200 calories worth of beans / lentils, 4oz fish or chicken, 2 servings of fresh vegetables.
  • Mid - Afternoon - ~200 calories worth of bean / lentils, 1 serving fresh vegetables
  • Dinner - ~200 calories of beans / lentils, 4oz fish / chicken, 2 servings frozen vegetables
  • Late Night - 28g nuts, 1 serving frozen vegetables
  • *Unlimited green, non-starchy (corn, peas) vegetables -> the nutritional benefits far outweigh any extra calories.
  • *The book advises that if you're truly (physically opposed to psychologically) hungry, then one more slow carb meal (See Lunch and Dinner) won't be harmful in the long run.  Indeed consistency maintainability are key to long-term success.
  • Cost:  The book has a quick grocery list for one week totaling < $40.  When I went on a grocery run the other day I found that to be pretty accurate.  You may spend a bit more to get stocked up, but you'll spare a few groceries if you eat out and on cheat day.  All in all, I'd say that things balance out as long as you're modest in your eating out and budget appropriately for your weekly binge.  One more thing, don't buy the junk food with your groceries or keep it in the house!
Cheat Day:
     The book recommends taking one day off per week to go wild; with some caveats for "damage control."
  • Keep a log of food cravings throughout the week - indulge one day / week
  • 1st meal of the day should be clean, normal slow carb meal.
  • Heavy caffeine (mild diuretic) throughout first part of day.
  • 1/2 tsp cinnamon with each "junk" meal.
  • 90 seconds of exercise before and after (w/in 90min) of each junk meal.
  • Drink plenty of fruit juice throughout the day.

Other Procedures:

  • 90 seconds of exercise each morning upon waking.
  • 30 grams of protein w/in 30 minutes of waking.
  • 30 minutes w/ ice pack on neck in the morning.
    • This is easier to deal with than cold showers / ice baths.  There has been some debate as to its effectiveness especially if someone is eating hot food / drinks and taking hot showers.  However, I look at it this way, if the temperature and duration of your showers and hot beverage consumption stay about the same, you're still getting a lower "net" body temperature throughout the day.
  • Add cinnamon (saigon preferably) to coffee.
  • Drink plenty of ice water and green tea (decaf) throughout the day.
    • The easiest way to accomplish this it to take an empty milk or fruit juice jug, fill it with hot water, add the tea bags and some lemon / lime juice, let it brew / cool, then stick it in the fridge and drink it throughout the day.
  • Add lemon / lime juice to drinking water.
  • Lots of herbs and spices (particularly garlic) with food.
  • 30 minutes w/ ice pack on neck before bed.
  • 1 gram of poppy seeds (sleep aid?) before bed.
  • Avoid artificial sweeteners.
Now, lets see if this bad boy can fly!

Friday, January 17, 2014

Diet Update: Beyond Vegetarian

     Another time, another change; variety is the spice of life, right?  Speaking from a behaviorist standpoint it takes anywhere from 10 sessions to 7 weeks to "integrate" new patterns of behavior.  Be this diet or exercise, consequently this is also the approximate time it takes the body to get used to patterns (integration) and plateau (i.e.:  no longer a stimulating challenge).  I've finally hopped off the (semi)vegetarian train and found myself seeking an old ally.  But first, a recap of my mostly-vegetarian adventures.

  • August 2013 - Begin Lacto-Ovo Vegetarian Diet
  • September 2013 - Eggs removed from diet
  • October 2013 - All dairy except Whey Protein removed from diet
  • Early November 2013 - Attempt to eat as little cooked and as much raw food as possible (within caloric limits)
  • Late November 2013 - Stop supplement intake (other than Whey)
  • December 2013 - Diet Soda (and artificial sweeteners) removed from diet
     Now, there are some finer points in here that I'll probably get into in later posts, but the bigger picture is that this was a good 5 - 6 month run and I was fairly satisfied with the results.  If I recall correctly, I lost a couple pounds in the early stages but gained them back.  My overall body composition (much to my surprise) stayed about the same was when I was eating meat.  What I did find exceptionally comfortable about this diet is that it evolved into a series of healthy preferences rather than stringent rule and lists of "thou shalt not..."  For example:
  • AVOID artificial sweetners
  • PREFER vegetables
  • PREFER not to eat meat, eggs, or dairy
    • but do on rare occasions, or social gatherings
  • PREFER to eat a lot of fruits, nuts and vegetables
    • but do eat some grains / starch (sweet potatoes, wild rice - not pasta / bread)
  • PREFER to eat mostly raw foods - (or soaked rice / lentils / bean)
    • but do cook own food on occasion or eat out
    • some processed and semi-processed foods are still good (granola, whey, nuts, salsa, hummus)
    • however there's something ironic about tofu (e.g.: super processed soy ... "stuff?")
     But all in all, I had to face the facts.  I make no attempt to hide the fact that I was a "lazy" vegetarian.  Meat still tastes(ed) good, but it was simply easier to dice some fresh vegetables than it was to scrub a George-Foreman Grill.
     My theory of small daily cheats was also a bust, but not totally.  I still had some cravings for junk food and the occasional bender but they were much fewer and far between.  When eating as described above I found that I did have garbage food cravings but they were much more mild, say a single candy bar or a single bag of chips rather than a whole pizza and a half gallon of ice cream or something ridiculous like that.  What seemed to work well was to not sweat the small stuff now and then; however, one has to be very judicious in deciding how frequent is too frequent and when "small" is no longer small.
     I also found that after I stopped drinking diet soda that I paid more attention to my physiological hunger rather than statistics and numbers.  Rather, I ate when I was hungry per the above guidelines; not when a prescribe plan said I could / couldn't.  That factor seemed to make things very sustainable.
     In case you have considered trying a vegetarian(ish) diet or even have a vendetta against them, there is some good information available here; titled "Beyond Vegetarian."


Ah yes, I mentioned an "old ally", stay tuned for Part 2.......