- Install CUPS - Print Server
sudo apt-get install cups
- Go http://localhost:631/admin
- Click Add printer.
- Log-in with as your system account.
- Select Internet Printing Protocol (ipp).
- Type
ipp://10.93.5.160/ipp
. (find IP usingnmap -p 631 10.93.5.* --open
) +[click continue] - Type printer name i.e.
myprinter
. +[click continue] - Select Generic. +[click continue]
Lets download SDK to /tmp. I assume that Virtualenv is already installed.
- Unpack
unzip /tmp/google_appengine_<VERSION>.zip -d /usr/local
- Create Virtualenv
virtualenv ~/demo
This file contains 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
""" | |
Indexes of most common value in array of integers. | |
Without importing any library. | |
@author: avalanchy | |
Python 2.7 | |
""" | |
# random 1 million | |
from random import randint | |
array = [randint(1, 100) for _ in xrange(1, 10**6)] |
This file contains 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
class A(Exception): | |
pass | |
class B(A): | |
pass | |
try: | |
raise B | |
except A: |
This file contains 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 | |
C = 80 # console width | |
def cen(text): | |
return text.center(C) | |
if len(sys.argv) == 3: |
This file contains 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
In [1]: run = 1 | |
In [2]: event = 17 | |
In [3]: def a(): | |
...: if event == 17: | |
...: run = 0 | |
...: | |
In [4]: def b(): |
http://cmd.fm/82103122 Stone Sour - Do me favor
http://cmd.fm/83134845 Zep 27
http://cmd.fm/82045895 Rue de mémoire
This file contains 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
#!python | |
"""Bootstrap distribute installation | |
If you want to use setuptools in your package's setup.py, just include this | |
file in the same directory with it, and add this to the top of your setup.py:: | |
from distribute_setup import use_setuptools | |
use_setuptools() | |
If you want to require a specific version of setuptools, set a download |
This file contains 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
[user] | |
email = yourname@example.com | |
name = Joe Smith | |
[alias] | |
d = diff HEAD | |
dn = diff --name-only | |
co = checkout | |
b = branch | |
ci = commit | |
st = status |
This file contains 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
def prepend(path, text) | |
with open(path, 'r+') as f: | |
body = f.read() | |
f.seek(0) | |
f.write(text + body) |
OlderNewer