Pages

Sunday, December 25, 2011

Minimum interest rate on personal loans

http://www.fpanet.org/journal/BetweentheIssues/LastMonth/Articles/LowInterestRatesMakeIntrafamilyLoansAppealing/

Low Interest Rates Make Intra-family Loans Appealing
By Kristi Mathisen and Barbara Potter

The Applicable Federal Rate
The key to transferring wealth through intra-family loans is the applicable federal rate, or AFR. The AFR is the rate at which the loan will be evaluated for both income and gift tax purposes. If a note requires a child to pay a parent no interest or an interest rate that is less than the appropriate applicable federal rate, the transaction will be characterized, at least in part, as a gift from the parent to the child and the income tax effects described above will occur. The caveat is also true. If the stated interest rate is at least the AFR, there is no gift element in the transaction, unless the interest is not in fact paid.
AFRs are determined by the IRS each month.3 The rates vary depending on the term: short-term for obligations due in less than three years, long-term for those due in more than nine years,  and mid-term for everything in between.4 Applicable federal rates are by no means market rates. They are based on the rates for various treasury securities during the previous month. These rates are almost always less than commercial or retail rates and therein lies their great appeal with today's low treasury rates.

Adjustable Federal Rates (IRS)
http://www.irs.gov/app/picklist/list/federalRates.html


Other IRS references
http://www.irs.gov/publications/p550/ch01.html

http://www.irs.gov/publications/p525/ar02.html

Tuesday, May 31, 2011

ssh-keygen instructions for windows (tortise, putty, winscp, etc)

The gist of it is.  

Create a public/private key in linux using ssh-keygen

Move the private key to authorized_keys in the .ssh folder

Move the private key to windows.

Use puttygen to load the existing private key (from linux) and save the private key (in the windows key format).

Use pageant to load the keys.  Then putty, winscp, tortise will use pageant as a key proxy and not more passwords.

http://linux-sxs.org/networking/openssh.putty.html


 


Saturday, May 28, 2011

Commandline to samba mount linux to a windows share

I've had challenges with in the past getting a mount to work.  The following seems to work without any special consideration in the windows share.  This is especially good because it forces the linux folder to use the user and group so not special consideration is required in apache.

NOTE: /sbin/mount.cifs is a linux command, not a custom shell script.

This is mounting a windows shared folder named "project" to "/var/www/html/project".  The files in linux will all be 666 and the folders in linux will all be 777.  You can customize this.

/sbin/mount.cifs //{YOUR WIN IP ADDRESS}/project /var/www/html/project -o 'uid={YOUR LINUX USERNAME},gid=apache,sockopt="TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192",dir_mod=0777,file_mode=0666,noperm'

Put this in a shell script or an alias and it is quick, easy, and reliable.

Sunday, May 15, 2011

Python count files in dirs program; better ls | wc -l (word count)

#!/usr/bin/python

import os
from os.path import join, getsize
for root, dirs, files in os.walk('.'):
    print root, "consumes",
    print sum(getsize(join(root, name)) for name in files),
    print "bytes in", len(files), "non-directory files"

Wednesday, April 27, 2011

Setting up xamp environment with netbeans, mercurial, and Zend Framework

Install mercurial for windows for NetBeans integration

Add mercurial bin directory to the windows path

Add xampp php to the windows path

Add the Zend Framework bin folder to the windows path

Execute zf tool commands from the windows powershell

zf create project zend-sample

Add the following to the httpd-vhosts.conf (and uncommment the NameVirtualHost line)

<VirtualHost *:80>
ServerAdmin postmaster@dummy-host2.localhost
DocumentRoot "C:\Users\matt\Documents\NetBeansProjects\zend-sample\public"
ServerName zend-sample
ServerAlias www.zend-sample
ErrorLog "logs/zend-sample-error.log"
CustomLog "logs/zend-sample-access.log" combined
<Directory C:\Users\matt\Documents\NetBeansProjects\zend-sample\public>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Add to the hosts file:
127.0.0.1 zend-sample www.zend-sample

Add the zend framework library path to the include_path in the php.ini

Restart apache

Add the .hgignore
nbproject

In netbeans add the zend framework library to the include path

Gift Tax Limitiations


What if my spouse and I want to give away property that we own together?
You are each entitled to the annual exclusion amount on the gift. Together, you can give $22,000 to each donee (2002-2005) or $24,000 (2006-2008), $26,000 (effective on or after January 1, 2009).

Wednesday, April 13, 2011

Sunday, April 10, 2011

Magic Trackpad for Windows


Download this patch (available for Windows 32-bit and 64-bit)

7-zip and extract the contents of the exe

"BootCampUpdate32.msp" – extract the contents of this file

will have a file called "Binary.AppleWirelessTrackpad_Bin" – just add a .exe extension to this file and then double-click to run it.

Saturday, April 9, 2011

Arduino Microcontroller Relay Control Projects

ncurses on ubuntu and cygwin

By adding ncurses to cygwin you get a more robust terminal that reformats the text when you resize the rxvt terminal.  You get the clear command and it facilitates searching within a "less" command to say a few of the benefits.

Same is true for ubuntu.  I was suprised that my 10.04 installed did not include it by default.

sudo apt-get ncurses-term

Thursday, April 7, 2011

Harddrive backup

HDCLONE - windows or ext
http://www.miray.de/products/sat.hdclone.html#versions

Carbon Copy Backup
http://www.bombich.com

Block-level copies vs. file-level copies

Cloning an entire volume to another volume can be achieved in two ways: 1) Copying every file individually from one volume to the other or 2) Copying the underlying blocks from one volume to the other. These two methods are called "file-level copying" and "block-level copying", respectively. While each method produces functionally the same result, block-level copying is almost always faster than file-level copying.

To benefit from a block-level copy for a volume-to-volume clone, the following criteria must be met:

You must choose to "Delete items from the target that don't exist on the source" during the clone.
You must be able to unmount both volumes (there cannot be any open files on either volume and you cannot be booted from either volume). Do not actually unmount the volumes prior to the clone.
The target volume must be at least as large as the source volume.
If any of these criteria are not met, CCC will automatically fall back to a file-level clone. A file-level clone will yield the same result -- a bootable clone, but it will take a little longer.

While a block-level clone is rarely required to insure the fidelity of your backup, some people find comfort in the fact that, block-for-block, the resulting target is precisely like the original (this is simply impossible with a file-level clone). Don't lose sleep, though, if meeting the requirements for a block-level clone is untenable for your particular backup or cloning situation. The file-level backup engine in CCC has been tuned and honed to bring the best performance and fidelity possible among Mac OS X backup utilities.

To benefit from a block-level copy for a volume-to-disk image clone, the following criteria must be met (and note that you cannot boot Mac OS X from a disk image):

You must choose the "Backup everything" cloning method.
You must be able to unmount the source volume and the source volume must not be the startup disk. Do not actually unmount the source volume prior to the clone.
The underlying target volume must have enough capacity to accommodate the amount of space used on the source volume.

Saturday, April 2, 2011

ufw (uncomplicated firewall) is an easier iptables

ufw default deny
ufw allow ssh
ufw allow www

or you can allow/deny by port and protocol.

less /etc/services to see a list of services by name

ufw enable

The ufw command even manages the init.d process for you.

If you enable logging then it logs to /var/log/messages : grep for UFW

Saturday, March 26, 2011

NASA Soldering


I need to keep looking.  There is a NASA guide with nearly 100 different solder joint techniques.  I just can't find it.

Saw and Fence idea from 1973

The Mar 1973 Pop Mech page 150 has a cool idea for a fence.  Even cooler.  Check out the picture of the radial arm saw.  Looks familiar.


--Matt

rsync cygwin mirrors

rsync -azv --progress --stats --delete rsync://mirrors.kernel.org/release /cygdrive/n/pub/cygwin
rsync -azv --progress --stats --delete rsync://mirrors.kernel.org/set* /cygdrive/n/pub/cygwin

Need to combine this with my time machine script so I can make a diff patch of only the files that have changed since the last run.

Monday, March 21, 2011

Drupal

Good book. Beginning drupal 7 apress

Content construction kit cck
Views
Panels
Imagecache
Nicemenu
Nodequeues
Wysiwyg
Pathauto
Webform
Backup and migrate
Ubercart

Sent from my iPad

Saturday, March 12, 2011

Economic Recovery Plan


Check if you received the economic recovery payment. This needs to be claimed in the Making Work Pay.

If you do not recall if you received the payment, please contact your respective agency below to verify before resubmitting the return claiming the Making Work Pay and Government Retiree Credits. If you contact the agency and a discrepancy did occur, then the agency must provide you a letter confirming the discrepancy. You should not claim the Making Work Pay and Government Retiree Credit when filing your return, instead, you will need to first file your return, once accepted, you will need to file an amended return and you must attach a copy of the agency letter confirming the discrepancy. - Social Security Administration: Toll-free number is 800-772-1213. General ERP inquiries can be answered by the SSA Web site:http://www.ssa.gov/recovery/. - Veterans Administration: Toll-free number is 800-827-1000. General ERP inquiries can be answered by going to the VA Web site:http://www4.va.gov/recovery/. - Railroad Retirement Board: Go to the RRB Web site at http://www.rrb.gov/recovery/ for more details. To review your entries follow the below steps: 1) Log into TaxACT Online or start your TaxACT desktop return. 2) Click on the Federal Q&A tab 3) Click Other Credits, then Making work pay and government retiree credit. 4) Click YES and TaxACT will proceed with the interview questions for you to enter or review your the appropriate information. Repeat the Filing step to resubmit your return.

Sunday, February 20, 2011

tightvnc and ultra vnc for remote desktop


Start listening on 5901
tightvncserver -nolisten tcp :1

Stop listening
tightvncserver -kill  :1

Tightvnc is easily installed though the ubuntu package manager.

I choose ultra vnc for my windows client to connect.

For actually sharing the active desktop use x11vnc

x11vnc -safer -forever

The forever is required if you want to allow connection after connection. You can add this to the gnome start up programs if you like.

x11vnc did not seem snapy enough across wifi to make it worth while.

Useful for kernel headers in ubuntu (vmware tools building)

sudo apt-get install linux-headers-`uname -r`

Saturday, February 19, 2011

Using locate command on OSX 10.6 snow leopard

sudo launchctl load -wF /System/Library/LaunchDaemons/com.apple.locate.plist

If it doesn't help, try:

sudo launchctl stop com.apple.locate

sudo launchctl start com.apple.locate

other thing to try:
/usr/libexec/locate.updatedb

Sunday, January 30, 2011

Mercurial hgrc for insecure push

[web]
allow_push = *
push_ssl = false


Setting up mercurial init.d web serving

cd /usr/lib/cgi-bin
cp /usr/share/doc/mercurial-common/examples/hgweb.cgi .
chown www-data:www-data hgweb.cgi
chmod u+x hgweb.cgi

comment the last two lines of hgweb.cgi and add the following:
#application = hgweb("/data/hg/test", "repository name")
#wsgicgi.launch(application)
from mercurial.hgweb.hgweb_mod import hgweb
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication

def make_web_app():
    return hgwebdir("/usr/lib/cgi-bin/hgweb.config")

application = wsgiapplication(make_web_app)
wsgicgi.launch(application)

create: hgweb.config
[collections]
/data/hg = /data/hg

Add the following to: /etc/apache2/sites-enabled/000-default
ScriptAlias /hg "/usr/lib/cgi-bin/hgweb.cgi"

http://www.aventinesolutions.nl/mediawiki/index.php/Quick_Tip:_Getting_Started_with_Mercurial

http://mercurial.selenic.com/wiki/PublishingRepositories#single


http://mercurial.selenic.com/wiki/PublishingRepositories
(Also includes resources for digest as well as allowing no pass on clone/pull, but restricting push.

7.4.1. Restrict to known users

This configuration restricts access to a known set of users as defined in the /home/user/hg/hgusers password file:



AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile /home/user/hg/hgusers
Require valid-user


Since the AuthType directive is set to Basic, passwords are communicated as plain text, and it is therefore recommended that this only be used with a server configured for HTTPS. See the Apache SSL documentation for more information

http://mercurial.selenic.com/wiki/FAQ

4.22. How can I store my HTTP login once and for all ?

You can specify the usename and password in the URL like:

http://user:password@mydomain.org
Then add a new entry in the paths section of your hgrc file. With Mercurial 1.3 you can also add an auth section to your hgrc file:


[auth]
example.prefix = https://hg.example.net/
example.username = foo
example.password = bar


Prevent the certificate error
http://kiln.stackexchange.com/questions/2816/mercurial-certificate-warning-certificate-not-verified-web-cacerts

SSL Configuration

http://www.tc.umn.edu/~brams006/selfsign.html

http://www.tc.umn.edu/~brams006/selfsign_ubuntu.html


cd /opt/openssl
openssl genrsa -des3 -out server.key 4096
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
# Make a copy of the server key that does not require the password
openssl rsa -in server.key -out server.key.insecure
mv server.key server.key.secure
mv server.key.insecure server.key

# server.crt: The self-signed server certificate.
# server.csr: Server certificate signing request.
# server.key: The private server key, does not require a password when starting Apache.
# server.key.secure: The private server key, it does require a password when starting Apache.

cp server.key /etc/apache2/ssl
cp server.crt /etc/apache2/ssl
a2enmod ssl
a2ensite default-ssl


Then edit the default-ssl.conf to change the web root-- for instance /var/www-ssl. Also modify the keys to use your custom server.key and server.crt

Monday, January 24, 2011

.vmrc suggestions

set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent

Tuesday, January 18, 2011

Time machine backup



#!/bin/sh

S=`date +%s` && rsync -azv --exclude=.Trash --exclude=Library/Caches --link-dest=/data/macbook/current /Users/matt/ 192.168.1.88:/data/macbook/$S && ssh 192.168.1.88 "rm /data/macbook/current && ln -fs /data/macbook/$S /data/macbook/current"



better than this on below because it allows for failure recovery...



#!/bin/sh

S=`date +%s` && ssh 192.168.1.xx "mv /data/macbook/current /data/macbook/$S" && rsync -azv --exclude=Library/Caches --link-dest=/data/macbook/$S /Users/matt/ 192.168.1.xx:/data/macbook/current

Wednesday, January 5, 2011

Monday, January 3, 2011

Handy mercurial serve settings

This is required when using hg serve for simple sharing.

.hg/hgrc

[web]
push_ssl = false
allow_push = *

Saturday, January 1, 2011

Processing/Arduino Serial Communication (LED Dimmer)

http://www.arduino.cc/en/Tutorial/Dimmer

I made some modifications to the sample to play around with it.

I have a couple of problems.

1) I cannot figure out how to send a byte (numeric) through a tty emulator -- the emulator picks up the ascii values for each character.  It would be nice to be able to just send a numeric if possible.
2) You can only have one thing at a time connected to the tty port.  Makes sense, I just didn't think about it when I tried to use the Arduino serial monitor while my Processing application was attached.
3) The 64 bit Linux compatibility with processing serialrxtx (fixed in another post.)

Arduino CODE

/*
  Dimmer
 
 Demonstrates the sending data from the computer to the Arduino board,
 in this case to control the brightness of an LED.  The data is sent
 in individual bytes, each of which ranges from 0 to 255.  Arduino
 reads these bytes and uses them to set the brightness of the LED.
 
 The circuit:
 LED attached from digital pin 9 to ground.
 Serial connection to Processing, Max/MSP, or another serial application
 
 created 2006
 by David A. Mellis
 modified 14 Apr 2009
 by Tom Igoe and Scott Fitzgerald
 
 This example code is in the public domain.
 
 http://www.arduino.cc/en/Tutorial/Dimmer
 
 */

const int ledPin = 9;      // the pin that the LED is attached to
const int  ledFailPin = 13;
int ctr = 0;

void setup()
{
  // initialize the serial communication:
  Serial.begin(9600);
  // initialize the ledPin as an output:
  pinMode(ledPin, OUTPUT);
  pinMode(ledFailPin, OUTPUT);
}

void loop() {
  byte brightness;

  // check if data has been sent from the computer:
  if (Serial.available()) {

    digitalWrite(ledFailPin, LOW);
    // read the most recent byte (which will be from 0 to 255):
    brightness = Serial.read();
   
    // set the brightness of the LED:
    analogWrite(ledPin, brightness);
   
   char s[4];
   snprintf(s, 4, "%d", brightness);

   Serial.print("Success ");
   Serial.print(s);
   Serial.println();
  }else{
      if(ctr++ % 20000 == 0){
           Serial.print("Fail");
   Serial.println();
    digitalWrite(ledFailPin, HIGH);
      }
  }
 
}

Processing CODE
 // Processing code for this example
 // Dimmer - sends bytes over a serial port
 // by David A. Mellis
 //This example code is in the public domain.
 
 import processing.serial.*;
 Serial port;
 int lastSent=-1;
 
 void setup() {
 size(256, 150);
 
 println("Available serial ports:");
 println(Serial.list());
 
 // Uses the first port in this list (number 0).  Change this to
 // select the port corresponding to your Arduino board.  The last
 // parameter (e.g. 9600) is the speed of the communication.  It
 // has to correspond to the value passed to Serial.begin() in your
 // Arduino sketch.
 port = new Serial(this, Serial.list()[0], 9600); 
 
 // If you know the name of the port used by the Arduino board, you
 // can specify it directly like this.
 //port = new Serial(this, "COM1", 9600);
 }
 
 void draw() {
 // draw a gradient from black to white
 for (int i = 0; i < 256; i++) {
 stroke(i);
 line(i, 0, i, 150);
 }
 
 // write the current X-position of the mouse to the serial port as
 // a single byte
 int tmpX = mouseX;
 if(tmpX != lastSent){
   port.write(tmpX);
   lastSent = tmpX;
 }
 
   if (port.available() > 0) {
    String inBuffer = port.readString();  
    if (inBuffer != null) {
      println(inBuffer);
    }
  }

 }

Using Linux 64-bit with processing serial rxtx library

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1239099636/12

sudo apt-get install librxtx-java
ln -sf /usr/lib/librxtxSerial.so lib/librxtxSerial.so


Blog Archive