- $ sudo apt-get update
- $ sudo apt-get install build-essential
- $ sudo apt-get install tcl8.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -name "*.pyc" -exec git rm {} \; | |
git commit -m "Removed compiled python files in distribution left after last commit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script author: MrVaykadji http://askubuntu.com/users/176689/mrvaykadji | |
# Changes made by Ribtoks | |
# - simulink for compass2.0 in /usr/bin/ | |
# - replaced apt commands with zypper commands | |
# Changes made by Andrew <[email protected]>: | |
# - use the NodeJS PPA to avoid build failure with grunt-cli | |
# - use the Popcorn Time icon | |
# - added check for apt, dpkg, etc. | |
# - added some checks when creating symbolic links |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Working in a Python project, it's common to have a clean-up step that deletes all the .pyc files, like this: | |
$ find . -name '*.pyc' -delete | |
This works great, but there's a slight chance of a problem: Git records information about branches in files within the .git directory. These files have the same name as the branch. | |
Try this: | |
$ git checkout -b cleaup-all-.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import django | |
django.setup() | |
from django.db.models import get_models | |
for _class in get_models(): | |
globals()[_class.__name__] = _class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
logging.basicConfig(format="%(levelname)-8s %(asctime)s %(name)s %(message)s", datefmt='%m/%d/%y %H:%M:%S', stream=sys.stdout ) | |
log = logging.getLogger("root") | |
from django.db.models import get_models | |
from django.conf import settings | |
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned | |
logging.config.dictConfig(settings.LOGGING) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys; print('Python %s on %s' % (sys.version, sys.platform)) | |
import django; print('Django %s' % django.get_version()) | |
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) | |
if 'setup' in dir(django): django.setup() | |
import django_manage_shell; django_manage_shell.run(PROJECT_ROOT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
""" | |
Some useful functions for interacting with Java web services from Python. | |
""" | |
def make_file_java_byte_array_compatible(file_obj): | |
""" | |
Reads in a file and converts it to a format accepted as Java byte array | |
:param file object |