Vim me now (edit files via SSH) so I can FTP

I recently have been migrating my hosting accounts from mediatemple [they suck, no link] to slicehost [http://www.slicehost.com] . Slicehost sets you up with any linux distro you want and you handle the rest.

In other words, I don’t know what the hell I’m doing. I’m not used to having to manage packages, etc. And I’ve found myself constantly having to rebuild my 8.04 VM. All you got is SSH, who ya gonna call?

The goal here is to FTP so open Terminal or Putty [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html]
and ssh root@ipaddress

We need to install an FTP Service

 sudo apt-get install vsftpd 

Now we want to make some changes to the FTP config

If you’re running Windows you’re going to need Cygwin [http://www.cygwin.com/setup.exe]

install Vim [http://www.vim.org/download.php#pc] or MacVim [http://code.google.com/p/macvim/]

now open Vim (not gVim)

:e scp://root@ipaddress//etc/vsftpd.conf

now we can configure the FTP settings inside Vim

The Vim command for inserting text is i

Turn anonymous access off (if you want)

anonymous_enable=NO

uncomment these lines so you can log in with server account

#local_enable=YES
#write_enable=YES

Hit the escape key to exit out of insert mode in Vim
then type :wq to save and close Vim

go back to Terminal or Putty and start the FTP service

sudo /etc/init.d/vsftpd start 

You’re done!

Kinda

Tags: , , ,

Binary Outbreak

I haven’t updated in forever.

1st things 1st: I’m in the process of making the nerd(gasm) switch from eMacs to Vim.
[see: http://code.google.com/p/macvim/]

Vim is O RLY? scary, even as an experienced eMacs user. I’ll put documentation in my docs section with hints and tricks that I’ve learned over the next few weeks. You IDE kiddies can put up or shut up.

2ndly: Dropbox [see: http://www.getdropbox.com] is the best thing to happen to me since bit-torrents. Everyone can use it. Backup your important files online, sync files across multiple computers, and even access them online (and a effing public folder)!

3rd: Last.fm [see: http://www.last.fm/user/troyxmccall] is the greatest social music site. Bump Pandora, join this, download the scrobbler and add me. Now.

Tags: , ,

Clean up your windows servers

Wrote a little VB script this AM. Try it if you like. Set a batch script to run it once a week.


Set fso = CreateObject("Scripting.FileSystemObject")
'root folder you want to delete from BE CAREFUL
Set f = fso.GetFolder("E:\foldername")
Set colSubFolders = f.SubFolders

For Each objFolder in colSubFolders
ShowFiles objFolder
Next

Sub ShowFiles(Fld)
Set k = fso.GetFolder(Fld)
Set s = k.SubFolders
Set kf = k.Files

For Each objFile In kf
'delete files older than a year
If objFile.DateLastModified < date - 365 Then
WScript.Echo objFile & " " & objFile.DateLastModified
fso.Deletefile(objFile)
End If

Next

For Each SubFolder In s
ShowFiles SubFolder
Next
End Sub

Tags: , ,