忘れがちなものをメモ
tar 圧縮
tar -cvf file_B.tar dir_A
tar -cvzf file_B.tar.gz dir_A
スワップ 無効・有効切り替え(mac)
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int sum = 0; | |
| for(int i = 1; i < 1000; i++){ | |
| if(i % 3 == 0 || | |
| i % 5 == 0) | |
| sum += i; |
| #! /usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Encode; | |
| use Data::Dumper; | |
| use XML::FeedPP; | |
| use File::Copy; | |
| use File::Spec; | |
| use diagnostics; |
| in a project directory,,, | |
| >> virtualenv venv | |
| >> . venv/bin/activate | |
| >> pip install ... | |
| >> ... | |
| >> ... | |
| >> pip freeze > requirements.txt | |
| in any other project directory,,, | |
| >> virtualenv venv |
| //Original | |
| func substr(s string,pos,length int) string{ | |
| bytes:=[]byte(s) | |
| l := pos+length | |
| if l > len(bytes) { | |
| l = len(bytes) | |
| } | |
| return string(bytes[pos:l]) | |
| } |
| #! /usr/bin/env python | |
| #-*- coding:utf-8 -*- | |
| import os | |
| import hashlib | |
| from datetime import * | |
| remote_addr = os.environ["REMOTEHOST"] | |
| current_time = datetime.now() | |
| ct = current_time.strftime("%y%m%d%H%M%S") |
| #! /usr/bin/env perl | |
| =head | |
| 半角カタカナ→全角カタカナ変換を調べたのでメモ | |
| =cut | |
| use strict; | |
| use warnings; | |
| use Encode; | |
| use Encode::JP::H2Z; |
| #! /bin/sh | |
| # | |
| # Make arbitrary directries, and execute this scripts. | |
| # that's all. write your HTML5 Application! | |
| # | |
| { | |
| cat <<EOF | |
| <!DOCTYPE html> | |
| <html lang="ja"> |
| /* | |
| git clone git://gist.github.com/1300263.git | |
| ./commondotfiles | |
| */ | |
| #! /bin/sh | |
| INSTALLDIR=$HOME | |
| for FILE in `find $PWD/dotfiles/ -name ".*" | grep -v "bak"` ; do |