Welcome to the new c mehner . com

BaylorBearBlog


Backing up files - Windows to Linux

2008-03-27 22:58:56

I noticed the other day that the frequency of my data backups was statistically 0%, and thusly realized, and rightly so, that this was appalling. If my building caught fire or if my hard drive took a hard dive, I would be out of data and out of luck. Therefore, I with a slight prod from sir, Aaron Kelley I began to research how to best backup my computer. Being as there really is no true stable storage, I decided to go for as close as I really needed to it. I would backup the files on my computer at Baylor to the files on my Linux server at home. Having the data in two different places allowed one location or one computer to fail and still have the data recoverable in a statistically reliable way. In addition, I wanted the ability to "set and forget", to have the backup util run from a script and consequently have to ability to backup whilst away or at night when the internet tubes are less clogged. So, with much further adieu... I give you my solution. (Windows 5 and higher (win + R; winver))

(Note: Skip this step if you have cygwin installed) First, download cwrsync (cygwin rsync) from here. Then, install that in the default place (XP) or in c:\cwrsync (vista).

Next, make sure you have plink and putty get these from searching google for putty plink, download them to you "C:\Program Files" directory and add:

; C:\Program Files\

To the end of your path (google "edit windows path" + version of windows your running). After that, read and set up a public key for your Linux server (see previous blog) log onto your Linux server and make a rsync config file (mine is at /etc/rsyncd.conf) it should look like:

use chroot = no
[rsyncModuleName]
   path = /home
   read only = no
   comment = carl backup area

Save and logoff or logout (your choice)

Replace c:\cwrsync\cwrsync.cmd with this (edited accordingly) Now just run the following commands in separate cmd windows (this assumes that you installed cwrsync in c:\cwrsync):

plink -v user@server.com -i "C:\location\of\private\key.ppk" "rsync --daemon --port=1873 --config=/etc/rsyncd.conf </dev/null"
plink -v -N -L 873:localhost:1873 user@server.com -i " C:\location\of\private\key.ppk "
"C:\cwRsync\cwrsync.cmd"

Now, if you have cygwin installed already instead of running cwrsync.cmd you should just run:

rsync.exe -av "/cygdrive/c/location/to/bkup" localhost::rsyncModuleName/userName/bkupFolder

to make it run at once put into a batch file (plink_rsync.bat)

plink -v user@server.com -i "C:\location\of\private\key.ppk" "rsync --daemon --port=1873 --config=/etc/rsyncd.conf </dev/null"
plink -v -N -L 873:localhost:1873 user@server.com -i " C:\location\of\private\key.ppk "

and put the rest into another batch file (backmeup.bat):

START /MIN "PLINK_FOR_RSYNC" "C:\dev\cwRsync\plink_rsync.bat"
REM Sleep for 15 seconds to give plink enough time to finish
REM xp - download server tools to get sleep
REM sleep 15
REM Vista
timeout /T 15 > nul
REM Run the cwrsync.cmd
"C:\dev\cwRsync\cwrsync.cmd"

Then you can just run (win+r) "c:\cwrsync\backmeup.bat" and have yourself all sung and backed up. You can fiddle around with these ideas born from here and here Remember, because this is being transferred through an SSH tunnel everything is encrypted in transport so you can (fairly) safely back up important documents.



Using Putty

2008-03-05 12:40:10

Today, I will be talking about how I use putty, I use putty to connect to any Linux box I need access to from windows. To get started using putty search Google for "putty". Just download putty.exe along with puttygen.exe (we will use this one later). Put-y both exe's in your "Program Files" directory. Press WindowsKey-pause/break or open up "system" from the control panel. (Note: WindowsKey hereafter just "win" refers to the button on the keyboard with a windows logo on it. Also, a dash between two keys means to hold down the first, strike the second, and then release both). Go to advanced tab (XP) or Advanced system settings (Vista). At the bottom of this tab, click the button labeled "Environment Variables" on the BOTTOM of the new window (labeled "System Variables") scroll down to the variable labeled "Path" and select it. Click Edit (or press alt-I) and append to the end of "Variable Value:" the following line:

;C:Program Files

Click ok, ok, ok.

Now, type win-R, type putty, and press enter. bham! Putty opens. Now, we will change the default settings to be useful. On the left menus, click (under terminal) "Bell", click "none (bell disabled)" unless you like hearing a ding every time you scroll down and try to go past the end of a doc. On the left menus, click "Window". Change lines of scroll back to 400 if you think you may cat a large file and want to look at a lot of lines, if not, don't. On the left again, click Appearance. If you are in vista change the default font to "Consolas", it's more prettier. Change any other settings you think would look cool. Slide down (On the left again click) to Behavior. Check "Window closes on ALT-F4", "System menu appears on ALT-Space", "Full screen on Alt-Enter", and, if you like, add something in the title text box. Slide down to colors and change any background, foreground, or text colors you like. I prefer black background and green text, but that is specified in my bash profile, so I leave things to default. Slide on down to Data. This box called "login details" is changeable now if you have the same username for every Linux box you log on to. I don't so I.m leaving it alone for now.

Run back up to the top of the categories box and click session, click the save button (halfway down on right)

Now, we're ready to set up for connecting to a specific box, say... fire. In Host Name (top right) type in:

fire.ecs.baylor.edu

Make sure the port is 22 and the connection type is SSH. In the saved sessions type fire (or something simple)

Now, slide down to Connection-Data (remember over there on the left) click in the auto-login username box and type your UNIX username (you last name, or a variation of normally). Run back up to the top of category and click session again. Click "Save" over on the right. Now click open!

You should have a box brought up that automagiclly puts in your name and just asks for a password. Crazy cool. (leave this connected window open)

But... what if we could make our passwords really complex, so complex that we didn't really remember them ever, or need to. It would keep the thousands of people that try to break into our Linux systems less likely to gain entry, and just increase general security. Sounds good to me! Thus, steps in the public/private key system and puttygen. Press win-R type puttygen. Click the generate button, and wiggle your mouse over the blank area on the top half of the screen. Great, you've got a public and private key, what do they do? Ask wiki about Public-key_cryptography, it's a good article. Now if you're lazy and have a physically secure computer you don't really need to enter a passphrase for your key, which means that you'll never have to type a password to connect to the Linux server (pretty awesome!) just make sure your computer has a password on it... If it's a laptop or something go ahead and passphrase it. Save both keys, and save them to a directory that's unlikely to be found by a quick 5 minute search of your file tree (to help prevent people from trying to steal them if they have a few minutes access to your computer. (Just you remember where you put them). Alright, up on the top of that window there's a bunch of random letters, highlight all of that text and copy it to the clip board. Alt-tab on over to your connected putty window. type:

cd

vim .ssh/authorized_keys

Then, press 'i' and move the mouse anywhere on the putty screen and click the right mouse button. Next, press Escape and then type :wq then enter. you my now type exit to quit this putty session. Now, go ahead and win-R, putty, and click fire in your saved sessions and then load. Slide down to SSH and expand it so that you can click "Auth", here's where the magic happens. Click browse under the "Private key file for authentication:" label and locate your private key, it ends in ".ppk". Now run back up and click Session then save. Now, just to show you have neat this is, close putty. Press win-R and type:

putty -load fire

Press Enter, and if you didn't have a passphrase, in a few seconds you'll be connected to the Linux server without a password, and with a fully functioning and useful putty window. If you want to see a lot of your text just press alt-enter. You prolly have to use the alt key on the left, Linux likes distinguishing between left and right, or just doesn't know that the right sided one exists.

Rinse and repeat for any other Linux machines you have.



Turkish Coffee

2008-01-30 16:58:12

I recently received by way of eBay a Turkish coffee grinder. Today I ground up some coffee using the conical burr grinding goodness of the antique style hand cranked wood and brass grinder. I still need an ibrik, the special small brass pot used to make Turkish coffee, but for now, the smallest pot in the kitchen will do. The most delightful aspect of the Turkish coffee is its full-bodied flavor and robust taste that fills the air and body with its thick mellow liquor. The minute cup holding the deep warm mixture sited upon the lips of the partaker is a salute to the ancient tradition of coffee making.

Heart Coffee

Coffee in my new Fiesta Ware espresso cups. Thank You AMBER!



Wedding :)

2008-01-17 18:15:02

I'm engaged! Wow... It's just wonderful, I deeply love my fiance and am very happy to be marrying her soon! You can see all about it on http://wedding.cmehner.com This wedding website was done in Adobe's Flex web 2.0 "programming language". It?s fun to program in, I learned it in order to do my senior design project last semester. You'll notice that the comics web page has the comics pane done in Flex as well. I just applied to Baylor's graduate school and am excited about (possibly) getting to go there. I should hear back fairly soon about the decision. This semester look like it'll be a good one, I'm taking harp lessons again and am getting excited about the opportunity to widen my harp skills again. Remember, you can hear some of my harp here. I've been thinking about this whole Apple thing, doesn't really strike me as to special, I told people to start selling apple stock after the iPhone was released. If you haven't sold it yet, hold on for a bit longer, it just went down because of the unexciting keynote, but I think it'll go up again before it plummets next year. Microsoft will release its next OS soon, and I believe that will be very good for the company al la the 1999 jump in price. I've got a blog, so, I'm an expert. Believe me.



Merry Mountain Dulcimer

2007-12-25 13:13:31

I just yesterday finished building my second wooden string instrument.

My first was a guitar that I made in shop class in 8th grade. Well... I tried to make a guitar. It sort of worked. The action was too high, the original bridge was measured in inches while the the guitar I copied had it's measurements in centimeters, the sound hole that I made first was too far down the body and when I made the plug for it, it rattled.

This second attempt at creating an instrument was much more effective. I couldn't find the correct wood from anywhere in town so I had to order a kit that had the correct types amount and thickness of wood along with the hardware that goes into making the tuning heads and tail pins (the things that hold the ends of the strings). I really like the look and the sound of the finished product, see the included pictures for action shots.

My friend Joel has a hammered dulcimer, a cousin (twice removed) from the mountain dulcimer. Let's get together and jam in the key of 'D' Joel!

Now I've got a mandolin, banjo, jew's harp, and a mountain dulcimer the makings of my very own Appalachian band. I can even use my new mixing board that I received for Christmas to spluce it all together into a one man band recording of awesomeness.

Stop by my room in the North Village to see my new dulcimer Christmas present from myself, to myself, and by myself.

dulcimer



Coffee!!!

2007-09-14 14:30:16

Folgers Gourmet Selections. Get A Free Sample


All Content Copyright © 2007-2010 Carl Mehner