git command of the day: #10

git stash

This command throws all your working directory changes into a "stash", which can be later re-applied with the git stash apply command. This is nice when you're not ready to commit, but you need to get something else committed too. The example used in the documentation for this command is your big boss comes in and needs an emergency fix for something. Without git stash, the workflow to achieve the same result has more steps and can be more awkward.

So, I got up in the middle of programming working on a small, low priority project several months ago. I came back to it recently, and after reviewing what I had left, I decided I had merged something to my master branch that I didn't really want in place quite yet. I also had some changes in the working directory that hadn't been added to ...

Continue Reading

Permalink | 8 comments | Posted: Feb 03, 2010 | Tags: git

Smug Enhancements

Something I've had on my todo list for a very long time now was to get my notes from School published automatically on my website. They are already stored in ReStructured Text, and they are already stored in git repositories, so my use of smug already had me 95% of the way there. (I have a write-up about my note taking method: here)

I spent my day off, and finally found some better approaches to the problems I had, and I now have automatic sharing of my notes on my website.

The thing that was holding me back was the fact that smug couldn't do everything I wanted it to. I also store other things, such as homework, papers, and other assignments in the same git repository. Also, the way that I would organize a website is different than I would organize my personal files.

Here is an ...

Continue Reading

Permalink | 1 comment | Posted: Jun 13, 2009 | Tags: Django Open Source git Smug Python School Servers

Surpassing Mailing Limits

Bluehost enforces a maximum outgoing email per limit on their service. Most tasks, such as personal email, and mass mailings can easily be routed through other mail servers. As long as the process sending the mail does not reside on the server, then it's as simple as changing the settings to use another mail service.

If your application has to run on the server, such as a web application, forum, business contact tracker, or cms, then you are out of luck. There is no way to send email to an outside server from Bluehost. Port 25 is blocked, because that would be open season for spammers. Any sane shared hosting company would enforce the same policy. The only way to get an email out to the rest of the world is to use either the sendmail binary, or connect to port 25 on localhost to send a message.

There ...

Continue Reading

Permalink | Posted: Jun 10, 2009 | Tags: Bluehost Hosting email PHP SSH

Stumpy Burger

So, I've mostly kept to computers and programming on my blog, but I've decided that I'll blog about food, at least this once.

Stumpy Burger is a small Burger place that opened up about a week ago in Provo. I noticed its sign about a month and a half ago, but looking in the window revealed that it surely wasn't open yet.

I went to drop off my car for a long repair, and I pulled my bike out of the trunk. On the way home I decided to check to see if Stumpy Burger was open yet. It was, but I had to wait a little before they opened for the day.

When I went in, I was met by a friendly staff. I ordered a Cheezie Burger, which is basically a Stumpy Burger with cheese. I got pickles and grilled onions, which are both ...

Continue Reading

Permalink | Posted: Jun 05, 2009 | Tags: Virtualization Food Provo, Utah

Python for Unix and Linux System Administration

Python for Unix and Linux System Administration First Edition

This is an O'reilly book that focuses on using Python in a niche that has long been filled with shell scripting languages like bash, along with perl. Python's scripting capabilities are very nice. I like Python, and I'm a System Administrator.

The Introduction explains the authors' reasoning why Python is a good choice. They explain why Python can be a good choice. For the casual reader that may have picked up this book in a bookstore, this is a good thing. I've already been sold on Python, which is why I got the book in the first place.

The book's chapters each focus on a specific type of task that a System Administrator might need to do. Some chapters covered topics that I could have written about. They covered creating a few small Django apps in ...

Continue Reading

Permalink | Posted: Apr 17, 2009 | Tags: books reviews Python Administration

FastCGI for mod_userdir

So, I want to move away from mod_php for the obvious security reasons.

FastCGI is a good alternative. I want to make the transition as easy as possible for my users. The transition on my Bluehost account from the regular PHP handler to the fastcgi handler is quite easy. All I do is add AddHandler fcgid-script .php to my .htaccess. Here are the requirements that I am looking for in transitioning to fastcgi for php:

1) Easy Transition - little or no user intervention required. I'd prefer that no intervention is required. 2) fastcgi scripts should be run using suexec for security and potential tracking purposes. 3) No scripts should be run when adding/removing users from the system. I want this to "just work" with the mod_userdir setup that we have.

Ideally, this change could be made during scheduled maintenance, and everyone could be automatically using the new fastcgi ...

Continue Reading

Permalink | Posted: Mar 24, 2009 | Tags: Open Source Servers Hosting PHP FastCGI

New CSS

I never thought that my personal blog would be useful to anyone except myself. I've not put a lot of effort into attracting traffic, but it's been trickling my way.

I never really finished the templates and CSS for programmerq.net, so I spent a little time here and there over the past few days and added some CSS, and updated the templates to make the blog experience a bit nicer.

I haven't added the template tags to turn on the calendar view in the sidebar, but I don't know how useful it would be anyway.

I really enjoy the Django templating language. I was able to add the gravitar functionality to the comment system without modifying the source of the blog app that I use. All I did was create an app that had the template tag snippet, and a template for rendering. To get ...

Continue Reading

Permalink | 6 comments | Posted: Mar 10, 2009 | Tags: Django Open Source

Accessing git through a Firewall

A decent number of things are blocked where I work. SSH is not. I usually use git via SSH. I did want to clone someone's repo that was shared over the git protocol, so I typed in the git-clone command, and waited. It timed out. The quick fix would be to clone it to my home machine, and then clone it over ssh. I never like doing that though, I like origin being the actual origin. I decided that it shouldn't be too hard to get a clone to work, so I did a bit of googling. I figured that if git had any support for a proxy server, it'd be possible one way or another.

I figured that I could use a combination of the "netcat" utility and ssh to get the desired result. I found the following article: http://twopenguins.org/tips/git-through-proxy.php that ...

Continue Reading

Permalink | Posted: Mar 10, 2009 | Tags: git OCD Censorship

Slow Django Requests

So I've had a slice with slicehost for about a year and a half now. I love all the things I can do with my very own relatively cheap server on the Internet. I started out with a 256 slice, and then I talked my wife into upgrading to a 512. I kept putting more things on my server because it was so convenient, and fun to have a 100% static IP on the internet. I've started running my own mail server, and slowly I've been moving all my personal sites to Django. I even host a website on my slice for a small fee.

After a little while, I was curious as to why all my Django apps seemed to run so slowly. I don't use my own website very often, so I didn't notice the slowness creeping in. Running top revealed that I ...

Continue Reading

Permalink | 15 comments | Posted: Mar 08, 2009 | Tags: Django Satchmo Python Servers Hosting

Storage Unit as a Mini Datacenter

So, I was talking with a friend. Using a storage unit as a workbench is something common. A climate-controlled storage unit with electricity can be had for quite cheap. Many people use storage units as a place to work on their cars, trucks, projects, and much more. I've even heard of garage bands practicing in their very own storage unit.

We got on the idea of making a storage unit into a mini datacenter. If one limits the number of servers that are in a normal climate-controlled room, chillers are not even necessary. There are a few questions that need to be answered before I will go out and rent any old storage unit.

Connectivity

The idea of a mini datacenter is completely pointless if you can't get an Internet connection to a storage unit. Since we're talking about a mini storage unit, we'll say that ...

Continue Reading

Permalink | Posted: Mar 08, 2009 | Tags: Hardware Servers

git command of the day: #9

git-mv

Git mv is a wonderful command. Here's how I've been using it.

I'm converting a mediawiki instance to a git repository with all the documents in RST. I used fuse-wikipediafs to grab each article. I added the text of each mediawiki article into a git repository under a subdirectory "wiki_markup". I am converting and verifying each document by hand. My workflow is like this:

git mv wiki_markup/Article.mw article.rst
gvim article.rst
git add article.rst
git commit -m "converted article"

This makes for a clean git commit history. The mediawiki markup is tied to the history of the restructuredtext file. When I do a git log on article.rst, I'll see that in its first commit it was renamed/updated in the same commit. This leaves a trail from the old mediawiki incarnation of this particular document that leads into the current ...

Continue Reading

Permalink | Posted: Feb 26, 2009 | Tags: git

git command of the day: #8

git update-server-info

I haven't forgotten about doing the git command of the day, I just haven't done it in a while.

While trying to clone a git repsitory on my bluehost account, I found that I couldn't use ssh nor the git protocol. I decided that it shouldn't be too unreasonable to expect to be able to clone a git repository over http. It is very much possible, but the http protocol isn't a very friendly place to try to implement the git protocol. The git protocol involves pack generation. A client requesting a file over http can't request that the pack be generated in the same way it would over the native git protocol. git update-server-info stores enough information in the repository to get the ball rolling for the client. It must be run any time the bare repo is updated. When the ...

Continue Reading

Permalink | Posted: Feb 11, 2009 | Tags: git

Git at Bluehost

Soon after I enabled SSH access at bluehost, I wanted to play with some Django projects that I had. I mainly use git as my revision control software, so I tried typing git clone jefferya@programmerq.net:path/to/repo.git. The command wasn't found, so I decided to install it.

In environments where I feel like I need to install software into my home directory, I usually create a ~/local directory, and add appropriate entries to my $PATH. I just did a wget to download the git source package, and when I configured the build, I used ./configure --prefix=$HOME/local. This installed beautifully.

I tried my command again, only to find that it times out. Outgoing SSH is blocked from the slicehost shell account. I understand that SSH access is powerful, and is only available for me to administer my site. Even so, it was a bit ...

Continue Reading

Permalink | Posted: Feb 11, 2009 | Tags: git Bluehost

YouTube at BYU

I don't believe in blocking anything on the Internet. It only creates problems. Anyone with a technical know-how can easily get past any filtration system. Most would be surprised how easy some filters are to bypass. I'm not writing this blog post to condone nor endorse filtering, nor getting around a filter that is in place wherever you have access to the Internet. I am only interested in making the necessary knowledge available to those inclined to seek it out.

When getting around an Internet filter, you need to know the type of filter that is in place. Some firewalls block all traffic to a specified computer or network on the Internet. Some only block web traffic. Some block only IRC traffic. Know what you are trying to get access to, and know how it is being blocked.

The block that prompted this blog post is BYU's ...

Continue Reading

Permalink | 8 comments | Posted: Feb 11, 2009 | Tags: School Censorship BYU

Spamassassin on Bluehost

Turning off the annoying spamassassin message encapsulation on BlueHost's servers.

Spamassassin is a great spam killing tool. BlueHost offers it as one of the spam protection options on their e-mail accounts. The cPanel configuration interface for spamassassin is a bit lacking. It only has some common, bare minimum options available.

One thing that spamassassin does that is a bit annoying is it encapsulates all suspected spam messages in a new message, and attaches the original message. This is nice for some things, but can be quite annoying when a legitimate message is crippled in this way.

Spamassassin is highly configurable, and you can do this easily. You just have to do it "manually" and not use the cPanel interface.

If you have SSH enabled, the SSH way is probably the easiest.

$ ssh username@example.com
username@example.com's password:
Last login: Wed Feb 11 11:10:07 2009 ...

Continue Reading

Permalink | Posted: Feb 11, 2009 | Tags: Servers Bluehost Spam email