Skip to content

Instantly share code, notes, and snippets.

View agusmakmun's full-sized avatar
🏠
Working from home

agusmakmun

🏠
Working from home
View GitHub Profile
user@dev:~$ sudo pip install virtualenv
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 215, in main
    locale.setlocale(locale.LC_ALL, '')
 File "/usr/lib/python2.7/locale.py", line 579, in setlocale
@agusmakmun
agusmakmun / install.md
Last active April 18, 2016 16:57
Installing PIP, Virtualenv, Django in Raspbian
$ sudo apt-get install python-pip python-dev build-essential
$ sudo pip install virtualenv

Usage

$ virtualenv --python=/usr/bin/python2.7 --no-site-packages test_myenv
> OR
@agusmakmun
agusmakmun / Install Ruby.md
Last active April 19, 2016 06:12
This because in Ubuntu 14.04 stopply to Ruby 1.9.*
  1. Create the tag version
$ git tag -a v1.4 -m "my version 1.4"
$ git tag
v0.1
v1.3
v1.4
@agusmakmun
agusmakmun / git_toturial
Created April 22, 2016 03:23 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "[email protected]" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://[email protected]/VT.git # clone远程仓库
@agusmakmun
agusmakmun / yupyupnope.conf
Created April 22, 2016 03:28 — forked from yosemitebandit/yupyupnope.conf
nginx config file for flask app (behind gunicorn) with ssl
server {
listen 80;
server_name www.yupyupnope.com;
rewrite ^/(.*) https://yupyupnope.com/$1 permanent;
}
server {
listen 80;
server_name yupyupnope.com;
rewrite ^/(.*) https://yupyupnope.com/$1 permanent;
@agusmakmun
agusmakmun / web-servers.md
Created April 22, 2016 03:35 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@agusmakmun
agusmakmun / serve.py
Created April 22, 2016 03:55 — forked from meyer/serve.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mimetypes, sys
import datetime
from os import curdir, sep
from os.path import splitext
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import codecs
try:
@agusmakmun
agusmakmun / jinja2_file_less.py
Created April 22, 2016 04:30 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
#!/usr/bin/env python
# Email validator, {summonagus}
import re
input_email = raw_input("Masukkan email: ")
if not re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$", input_email):
print "Email `{}` tidak valid!".format(input_email)
else: