Skip to content

Instantly share code, notes, and snippets.

@githubutilities
githubutilities / README.md
Created December 20, 2015 02:56
C++ Makefile
@githubutilities
githubutilities / bootstrap-ubuntu.md
Last active December 3, 2015 08:31
Bootstrap ubuntu

Bootstrap ubuntu

dotfiles

git clone https://github.com/githubutilities/dotfiles.git && cd dotfiles && git checkout ubuntu && source bootstrap.sh

append line [ -n "$PS1" ] && source ~/.bash_profile; to the end of .bashrc

@githubutilities
githubutilities / Watchdog+Mail.md
Last active November 27, 2015 07:48
Watchdog+Mail

Watchdog+Mail

install watchdog by pip install watchdog

Sending Email

@githubutilities
githubutilities / dig.md
Last active November 26, 2015 11:00
dig command

Dig

Github pages

Github pages 404 if accessed by entering ip in browser address bar

When we enter hostname in browser address bar, after resolving hostname to ip, the browser also sends the hostname in http header to the resolved ip. This will enable using one ip to serve multiple websites.

# NOTE: use `dig githubutilities.github.io` to resolve hostname to ip(`103.245.222.133`)
@githubutilities
githubutilities / cURL.md
Created November 16, 2015 13:11
cURL command brief examples

cURL command brief examples

# download and output to standard output
curl http://www.google.com

# -L: follow redirections (specified in HTTP Location Headers)
curl -L http://www.google.com

# -o <filename>: output to specific file
@githubutilities
githubutilities / ntfs-mac.md
Last active June 26, 2024 09:42
NTFS in Mac
@githubutilities
githubutilities / Django-Framework.md
Last active November 13, 2015 11:59
Django Framework Code Management

Django Framework Code Management

  1. Form. django.forms.Form
  2. View(controller in MVC sense, actually Django is a MTV(Model Template View) Framework.) process the Form with data within Model and feed Template with dictionary or response with a JsonResponse.
  3. Model. django.db.models.Model
  4. Template. Supplied with dictionary by View.

Form

@githubutilities
githubutilities / manage-imagefield.md
Last active November 26, 2015 05:19
Managing ImageField

Managing ImageField With Triggers

Models

#coding=utf8
from django.db import models
@githubutilities
githubutilities / SAE-config.md
Last active November 13, 2015 11:02
SAE config

SAE config.yaml

mind the spaces!!!

name: project-name
version: 1

libraries:
- name: "django"