unzip 6.0 で Shift_JIS などの日本語ファイル名を含む zipファイルを展開する為の patch です。
Ubuntu に入っていた unzip 5.52 用のpatchを移植、改変したものです。オリジナルの patch はこちら:
http://archive.ubuntulinux.jp/ubuntu-ja/intrepid-ja/unzip_5.52-11ubuntu1.1ja1.diff.gz
unzip 6.0 で Shift_JIS などの日本語ファイル名を含む zipファイルを展開する為の patch です。
Ubuntu に入っていた unzip 5.52 用のpatchを移植、改変したものです。オリジナルの patch はこちら:
http://archive.ubuntulinux.jp/ubuntu-ja/intrepid-ja/unzip_5.52-11ubuntu1.1ja1.diff.gz
| """Usage: python matchcolors.py good.jpg bad.jpg save-corrected-as.jpg""" | |
| from scipy.misc import imread, imsave | |
| from scipy import mean, interp, ravel, array | |
| from itertools import izip | |
| import sys | |
| def mkcurve(chan1,chan2): | |
| "Calculate channel curve by averaging target values." | |
| fst = lambda p: p[0] |
| #!/usr/local/bin/python | |
| """Replacement for htpasswd""" | |
| # Original author: Eli Carter | |
| import os | |
| import sys | |
| import random | |
| from optparse import OptionParser | |
| # We need a crypt module, but Windows doesn't have one by default. Try to find |
| bin | |
| include | |
| lib | |
| local | |
| *.swp | |
| *.pyc | |
| #!/bin/bash | |
| # Script to backup git repo to S3 | |
| # Set bucket, dir, password and account to use for the backup. I keep mine in local env vars | |
| # These are set by localrc which lives on an encrypted home directory and is executed by my bashrc | |
| bucket=$GITHUB_BACKUP_BUCKET | |
| dir=$GITHUB_BACKUP_DIR | |
| password=$GITHUB_BACKUP_PASSWORD | |
| account=$GITHUB_ACCOUNT |
| function updateElementIndex(el, prefix, ndx) { | |
| var id_regex = new RegExp('(' + prefix + '-\\d+)'); | |
| var replacement = prefix + '-' + ndx; | |
| if ($(el).attr("for")) $(el).attr("for", $(el).attr("for").replace(id_regex, replacement)); | |
| if (el.id) el.id = el.id.replace(id_regex, replacement); | |
| if (el.name) el.name = el.name.replace(id_regex, replacement); | |
| } | |
| function addForm(btn, prefix) { | |
| var formCount = parseInt($('#id_' + prefix + '-TOTAL_FORMS').val()); |
| #! /usr/bin/python | |
| # coding: utf-8 | |
| """Copy table from mysql to sqlite. | |
| Require: | |
| * SQLAlchemy | |
| * MySQLdb or PyMySQL | |
| Usage: |
This Gist contains instructions to setup Ubuntu server with Nginx, uWSGI & Node.js with that can serve for any Python apps (Django for instance) and will allow it's automatized deployment.
The content is as follows:
01-ubuntu.md – A basic Ubuntu server setup.02-nginx-uwsgi-nodejs.md – Nginx, uWSGI and Node.js installation and setup.03-deployment.md – A server setup for automatized deployment.04-mariadb.md – Mariadb installation and setup.| #!/bin/bash | |
| ### VARIABLES ### \ | |
| EMAIL="" | |
| SERVER=$(hostname) | |
| MYSQL_CHECK=$(mysql -e "SHOW VARIABLES LIKE '%version%';" || echo 1) | |
| LAST_ERRNO=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Last_Errno" | awk '{ print $2 }') | |
| SECONDS_BEHIND_MASTER=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G"| grep "Seconds_Behind_Master" | awk '{ print $2 }') | |
| IO_IS_RUNNING=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Slave_IO_Running" | awk '{ print $2 }') | |
| SQL_IS_RUNNING=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Slave_SQL_Running" | awk '{ print $2 }') |
| import ctypes, sys | |
| from ctypes import windll, wintypes | |
| from uuid import UUID | |
| class GUID(ctypes.Structure): # [1] | |
| _fields_ = [ | |
| ("Data1", wintypes.DWORD), | |
| ("Data2", wintypes.WORD), | |
| ("Data3", wintypes.WORD), | |
| ("Data4", wintypes.BYTE * 8) |