start new:
tmux
start new with session name:
tmux new -s myname
| import uuid | |
| import timeit | |
| import lz4 | |
| import os | |
| from timeit import Timer | |
| import sys | |
| import blosc | |
| DATA = open(sys.argv[1], "rb").read() | |
| LZ4_DATA = lz4.block.compress(DATA) |
| import timeit | |
| import lz4.frame | |
| import lzf | |
| import zlib | |
| #import snappy | |
| import os | |
| from timeit import Timer | |
| DATA = open("test.py", "rb").read() | |
| DLEN = len(DATA) |
| import os | |
| import io | |
| from PIL import Image | |
| from django.core.urlresolvers import reverse | |
| from django.conf import settings | |
| from rest_framework import status | |
| from rest_framework.test import APITestCase |
| ## SETTINGS | |
| MEDIA_URL = '/media/' | |
| MEDIA_ROOT = os.path.join(BASE_DIR, 'media') | |
| ## MODEL | |
| from django.db import models | |
| from django.utils.translation import ugettext_lazy as _ | |
| class Logo(models.Model): |
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
| ''' | |
| 100 Doors Problem: | |
| There are 100 doors in a row that are all initially closed. | |
| You make 100 passes by the doors. | |
| The first time through, visit every door and toggle the door (if the door is closed, open it; if it is open, close it). | |
| The second time, only visit every 2nd door (door #2, #4, #6, ...), and toggle it. | |
| The third time, visit every 3rd door (door #3, #6, #9, ...), etc, until you only visit the 100th door. | |
| Task: | |
| Answer the question: what state are the doors in after the last pass? Which are open, which are closed? |
| ** To install Golang on Ubuntu 17.xx server ** | |
| sudo add-apt-repository ppa:gophers/archive | |
| sudo apt-get update | |
| sudo apt-get install golang-1.9-go | |
| export PATH=$PATH:/usr/lib/go-1.9/bin | |
| go version (To verify its mapped correctly, should see something like: go version go1.9.2 linux/amd64) | |
| * make a directory for your go applications, I use /home/apps/go | |
| export GOPATH=/home/apps/go | |
| (Now from inside your /home/apps/go folder you can start creating your go apps) |