How to post on identi.ca from Vim with TwitVim

I recently discovered the TwitVim Twitter/Identi.ca Vim plugin created by Po Shan Cheah, so I thought i’d share it with you all.

Prerequisites: Vim (obviously), Curl and the twitvim.vba

1. Download the latest twitVim plugin from here (Currently version 0.5.5): http://www.vim.org/scripts/download_script.php?src_id=13653

2. Open Vim and issue these commands (version 0.5.5)

Open the vba file with Vim:

vim twitvim.vbatwitvim-0.5.5.vba

Now install the vba:

:source %

3. Configure your vimrc to use identi.ca

vim .vimrc

And at the bottom add:

let twitvim_api_root = “http://identi.ca/api”
let twitvim_cert_insecure = 1
let twitvim_login = “yourusername:yourpassword”
4. Send a test post:
:PosttoTwitter
Hit Enter (you’ll be prompted to enter a message), Type your message, and hit Enter again, that’s it. You have now sent your first identi.ca message from Vim !! ;-)
This is a basic install and post guide, but I recommend you read the documentation as TwitVim has a whole heap of features and options, especially regarding security and secure authentication.

AuthorPo Shan Cheah
Shared on identi.ca by –  tante
DocumentationVim.org, Google Code

How to redirect old website url to new url including page links

The situation is that you have an old domain with a website or even various websites and sub-domains. You have moved all your files to another server or web address but you don’t want to lose the traffic from all the people who have bookmarked or link to you.

You want http://myoldcrapsite.com/a_post_about_monkeys.html to lead to http://mylovelynewsite.com/a_post_about_nicer_monkeys.html

In fact, you want ALL old links to go to the exact same place on the new server. This is how you redirect everything all in one go permanently with the htaccess file.

Creat a .htaccess file (don’t forget the DOT before it, it’s hidden from public view)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^myoldcrapsite.com [nc]
rewriterule ^(.*)$ http://mylovelynewsite.com/$1 [r=301,nc]

Upload it to the root of your website, usually where your index.html or index.php files are and you are all set. Google some of your old links and see where they take you. It should be to the same page on the new website.

One thing to remember is this will only work on a Linux Apache webserver which allows the Mod Rewrite function.

PS: If you are on a Windows Server, try Googling the html redirect method.

That’s it, now all incoming links from any of the old posts/pages will be forwarded to the new site :-)

How to Linux quick, easy, file sharing server with one command

Don’t install a server, just issue one command!

So, you want to share a file with a friend. It could be a document, a song, a directory of photos, anything.

Do you want to install and set up a server? NO!

Do you want to go to a directory and issue one command? YES!

Open your terminal and cd to the directory where you want to share the file(s) from:

cd /home/rich/shared

Now start the Python Simple HTTP Server:

python -m SimpleHTTPServer

That’s it! Open your browser and go to this url:

http://localhost:8000 or http://127.0.0.1:8000

Now you will see the files that you want to share. All you need to do is send a message to your friend with your IP address and port :8000 and he/she can download anything from your /shared directory.

You can get your external IP address by going to:

http://www.whatsmyip.org/

Once you have finished, go back to your terminal and hit Ctrl+C and the server will stop.