Skip to content

Instantly share code, notes, and snippets.

View aaronromeo's full-sized avatar
:shipit:

Aaron Romeo aaronromeo

:shipit:
View GitHub Profile
@aaronromeo
aaronromeo / gist:7969396f107ffea4e298
Last active August 29, 2015 14:04
Useful commands for initial Ubuntu server setup

Update the default editor so we aren't living in squalor

> sudo update-alternatives --config editor

Update the root password and add the hotstuff user

> passwd
> adduser hotstuff
> visudo

Keybase proof

I hereby claim:

  • I am aaronromeo on github.
  • I am aaronromeo (https://keybase.io/aaronromeo) on keybase.
  • I have a public key whose fingerprint is 7B74 D603 0775 0C76 53DC 522E 3D2C DFF9 58B0 7091

To claim this, I am signing this object:

@aaronromeo
aaronromeo / gist:3b701a02cbbd139465b6
Created June 12, 2014 14:21
New Django DB Creation
#!/bin/bash
createuser -d -A -P $DB_USER
createdb -U $DB_USER -E utf8 -O $DB_USER $DB_NAME -T template0
@aaronromeo
aaronromeo / models.py
Created May 3, 2014 13:07
Storing images on S3 with Django

You'll need these libraries

  • pip install Pillow
  • pip install django-storages
  • pip install boto
@aaronromeo
aaronromeo / gist:9892066
Created March 31, 2014 13:17
Dealing with multiple models in a Django CBVs and ModelForms
class UserProfile(models.Model):
user = models.OneToOneField(User)
avatar = models.ImageField(upload_to='profile_images', blank=True)
def __unicode__(self):
return self.user.username
class RegistrationForm(forms.Form):