Just A Small Guideline

Feel free to browse the site. Don't be afraid to leave comments, they're supportive.
Please follow me on Twitter @ehldmnt and retweet my posts.

Saturday, May 25, 2013

Friday, May 24, 2013

Why Use Dropbox? -- Why I Made the Switch From Mediafire.

There's been a question floating around in my head the past few months about the cloud service that I used. I've been using mediafire for quite some time now, without much thought about using a cloud service. When I first switched to linux, it was only after my Vista Machine had "bluescreened". The second time I had thought to use a different cloud service was when media fire complained of the size of the files that I was storing. The third time was on my brand new Ubuntu machine, when I screwed myself over trying to install Arch with only basic command line tools under my belt.

Now, I'm switching harddrives and I don't want to spend 25 dollars, hoping and waiting for my friend down the street to get it done within this month...

So I tried dropbox and what I've discovered is that it is extremely fast, and efficient. And here's why.

  • When you use dropbox, no matter where you are or what device you're using with it, all of your information is instantly shared between devices. 
  • Drop box can be set up to start syncing right when your computer starts up, or only when your computer is loading. 
  • Drop box simplified my file management, and made it so that in order to send a picture from my iphone to my laptop, I didn't have to email myself.
  • Drop box begins with 2G free, but for only 9 dollars a month, will boost that to a whopping 100Gs. That's a deal, considering my flashdrive costs 30 dollars for 16Gs [and has a higher chance of being destroyed]
  • My worries and my fear of a loss of data have actually been minimalized, I'm confident in the dropbox servers.
  • I can program Dropbox to sync specific folders as well.

Follow me on Twitter @ehldmnt

How to use Vim [Navigation and Text Editing]

Remember when you first started to type and everything was slow? Of course you looked down at the keys here and there to make sure you were pressing the right letter, but after that, you were good, right? Well, what's stopping you from learning Vim? I mean, yeah sure, to initially begin outside of input mode seems a bit odd, but to be honest, it really isn't that big of a deal. Vim is fast because it keeps you from reaching down for the mouse, or arrow keys every two seconds just to change your position, therefore, reducing the amount of movement your hands have to do, and also not forcing you to shift from your comfortable position [yes, Vim is for the lazy].


When you initially begin using Vim, you're probably a bit flustered that you can't just "start typing in text" right from the get go. Well, that's okay, just press the "i" key and you should be all set. Take note of the table below that tells of all the basics of moving and editing in Vim and give them a shot in the editor itself.



    i     Allows you to insert text where the cursor is.
I Allows you to insert text at the beginning of a line without whitespace
a Allows you to insert text at the end of a line.
oAllows you to insert text below the current line
OAllows you to insert text above the current line
Esc
Exit insert mode
j<n> Move the cursor down< A certain number of lines>
k<n>
Move the cursor up < A certain number of lines>
dd
Delete line
d<n>d
Delete a number of lines [including the one currently selected]
ggGo to the first line
GGo to the last line
g<n>gGo to a specific numbered line
x
Delete Character after cursor
X
Delete Character before cursor
w
Move an entire word ahead, ignoring spaces [white space]
b
Move an entire word back, ignoring spaces [white space]
dwdelete the next word
dbdelete the last word
d<n>wdelete the next <amount> words
d<n>bdelete the last <amount> words

Follow me on twitter! @ehldmnt

Sunday, May 19, 2013

How to transfer files and directories over an SSH connection.

This is a long unanswered question that I had actually scowered the inernet for, never realizing that the answer was staring at me in the man pages. This guide assumes that you have a LAN ssh connection, and doesn't explain how to achieve one over the internet First things first, introducing the scp command.
[SYNTAX]

scp [OPTIONS] [FILE] [DESTINATION]

To copy a single regular text file called "important.txt" from the user "bob" on the present computer "maxie" to the remove computer user "mark"'s documents on a computer named "sandbox":

 scp important.txt mark@sandbox:~/Documents

 The only downside to this is that you have to know the exact directories, but this guide assumes that you already know where they are.

To copy an entire directory, maybe the "water_pictures" directory from "mark" on "sandbox" to "bob" on "maxie":

scp -r water_pictures bob@maxie

This will recursively [explicitly] show you everything that is being transfered, but it'll get the job done.

Sunday, May 12, 2013

Organizing Your Python Scripts: A Guide For All Who Want to have neater code

When organizing your python scripts, it is good to have certain layout when you're programming, as to reduce the amount of stress about the order of things later. I'll define here some rules for functions, classes, and variables, and some tips for how you'd probably code your scripts. I'll be updating this list as things come to mind.

Tips and Tricks


  • Always write your imports at the top of your script.
  • Always define your functions at the beginning of your scripts and call the functions that are called by others before them.
  • Always make sure that you call your variables before you call your functions.
  • Always make sure to comment your code if you don't think you'll remember what it's doing.
  • Always use docstrings to explain what any piece of your code is doing.
  • Always define proprietorship at the top of every script that you write, the name of the script, and the license. 
  • Always use consistent indentation, not matter what, or expect indentation errors.