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
@agusmakmun
agusmakmun / README.md
Created November 22, 2015 19:22 — forked from ndarville/README.md
From CSV to HTML table (Simple)

This code generates an HTML table based from a CSV file. This is from the tutorial by Christophe Viau.

In trying his code example, I discovered that the code doesn't work as-is, so I figured others might like to see a working d3.js example that did not rely on a pre-existing container HTML element.

The code remains the same except for some cosmetic tweaks.

The task of writing the CSS is left as an exercise for the reader.

@agusmakmun
agusmakmun / dirc
Created March 22, 2016 17:50 — forked from nullrndtx/dirc
DIRC - DracOS Irc Client
#!/bin/bash
# dirc - DracOS IRc Client
# Copyright (c) 2016 - randalltux
###################################
##### HOW TO #####
##### -h: hostname #####
##### -p: port #####
##### -n: nick #####
##### -k: password #####
##### -c: config #####
import argparse
def exist_user(string):
exist_users = ['taro','jiro','saburo','ichi','ni','san']
if string not in exist_users:
raise argparse.ArgumentTypeError("%s is not exist user"%(string))
return string
parser = argparse.ArgumentParser(prog='test command', description='this is description text.')
@agusmakmun
agusmakmun / argparse_action.py
Created April 4, 2016 19:11 — forked from Averroes/argparse_action.py
argparse action
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Show the built-in argument actions.
"""
#end_pymotw_header
import argparse
@agusmakmun
agusmakmun / iscsictl.py
Created April 4, 2016 19:11
argparse example
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Help iSCSI deployment.')
parser.add_argument('-s', '--service', choices=['target', 'initiator'],
default=None,
help='type of service deployment')
parser.add_argument('-o', '--host', default=None,
help='Host address for the machine to configure')
parser.add_argument('-t', '--target_host', default=None,
help='Host address where the initiator search the target')
parser.add_argument('-d', '--device', default='/dev/loop0',
@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 "xxx@xxx.com" # 配置邮件
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://git@192.168.53.168/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/
#