Quick tip when using vagrant+django

I started to use vagrant to hold my development environment, it helps to keep the development environment isolated, since the app will run on a Linux server, with a specific database engine and probably some other specific modules, I don’t want to clutter my OS with all that stuff. More if I plan to work on another project that maybe, have a dependency on other versions of the same base (legacy Django perhaps?)

So, finally discover how to set the default blog in WordPress

I have multiple blogs, one personal and others for projects that I have, I trust in WordPress because it’s pretty flexible and since version 3.5 the improvements are awesome, making the writing a lot easier.

Still I had a problem, I’m used to the WordPress app for iOS and Mac to avoid having to load the whole page. It is kind of limited (not all plugins are available in the App) but for a quick post it works. Well, the problem I had is that I post mostly to my personal blog, but one of my projects blog was the default and I didn’t knew how to set a default. I event asked for help. read more

Python: Simple HTTP Server on python.

(Repost from old blog)

Python have several modules that help you to achieve your goals. This week, on my spare time that is getting every day more scarce I spend time figuring out how to create a Python Web Server, I was planing to use it over an application that I’m developing on ICT Consulting. At the end I didn’t use it because I didn’t want a “passive” communication, but probably I will use this code on the CRM Desktop application that we use here.

Anyway, this code may be helpful for you too. I found that creating a small web server is really simple, It starts getting bigger as you add functions to that web server, but the basis is quite simple.

import os import cgi import sys from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class customHTTPServer(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write('<HTML><body>Get!</body></HTML>') return def do_POST(self): global rootnode ctype,pdict = cgi.parse_header(self.headers.getheader('Content-type')) if ctype == 'multipart/form-data': query = cgi.parse_multipart(self.rfile, pdict) self.send_response(301) self.end_headers() self.wfile.write('Post!') def main(): try: server = HTTPServer(('',8080),customHTTPServer) print 'server started at port 8080' server.serve_forever() except KeyboardInterrupt: server.socket.close() if __name__=='__main__': main() read more

Option-arrow navigation in iTerm2 – BrettTerpstra.com

useful way to map “Option+left”/”Option+right” keys in iTerm2 to do by word jump (left and right). Although sending ^[b and ^[f seems to be cleaner.

I’ve been trying to get Option-arrow keys to move by word in iTerm2. I figured out a solution, but it’s weird. If anyone has an explanation or a better way to do this, let me know.

Source: Option-arrow navigation in iTerm2 – BrettTerpstra.com

1,825 total views, 4 views today

Site Footer

Skip to toolbar