Abstract Delete metadata of an image file by using ExifTool on Ubuntu 12.04. The following command is useful to sanitize images before uploading and downloaded images. Install ExifTool $ wget http://www.sno.phy.queensu.ca/~phil/exiftool/Im…
Abstract Normalize file names on Ubuntu 12.04.The following script and command: Normalize unicode characters. E.g. image①.jpg -> image1.jpg. Make the extension of a basename lower case. E.g. image.JPG -> image.jpg Strip the root of a basen…
Abstract Delete suspicious directories and files by using the find command on Ubuntu 12.04. The following commands are useful to sanitize files which have been downloaded from a suspicious site. Commands # Set a target directory. $ TARGET_…
Code /home/shinya/py_example/mymain.py import sys def main(args): sys.stdout.write('Hello, world!\n'); if args: sys.stdout.write('{0}\n'.format(args)) /home/shinya/py_example/main.cc #include <Python.h> #include <cassert> #include <iostream> int main(int argc, char** </iostream></cassert></python.h>…
Code /home/shinya/jni_example/Main.java public class Main { public static void main(String[] args) { System.out.println("Hello, world!"); if (1 <= args.length) { System.out.println(args[0]); } } } /home/shinya/jni_example/main.cc #include <jni.h></jni.h>…
// tokenizer.cc // Copyright (c) 2013 Shinya // The MIT License (MIT) http://opensource.org/licenses/mit-license.php #include <iostream> #include <clang-c/Index.h> void DisplayTokens(const CXTranslationUnit& tu) { CXCursor cursor = clang_getTranslationUnitCursor(tu)</clang-c/index.h></iostream>…
$ grep -r $'\t' * References 逆引きUNIXコマンド/grepでタブを検索する方法 - Linuxと過ごす (Japanese)
gflags, commandline flags module for C++. Environment Ubuntu 12.04 64bit Install gflags. Download gflags-2.0.tar.gz $ tar zxvf gflags-2.0.tar.gz $ cd gflags-2.0 $ ./configure $ make $ sudo make install $ sudo ldconfig $ cd .. $ rm -rf gfla…
Wrapping a C library in Python. Environment Ubuntu 12.04 64bit Python 2.7 Install Python.h $ sudo apt-get install python2.7-dev Code // spammodule.c #include <Python.h> #ifdef __cplusplus extern "C" { #endif static PyObject* SpamError; static PyObje</python.h>…
Ubuntu 12.04 64 bits wget 'http://code.google.com/p/protobuf/downloads/detail?name=protobuf-2.4.1.tar.bz2' -O protobuf-2.4.1.tar.bz2 tar xvf protobuf-2.4.1.tar.bz2 cd protobuf-2.4.1/ ./configure make make check sudo make install cd .. rm -…
Abstract Install High Performance SSH/SCP - HPN-SSH 5.9 to Cent OS 5.4 (32bit). Procedure Install dependencies yum install -y patch rpm-build openssl-devel glibc-devel krb5-devel gcc pam-devel Download and patch openssh wget http://ftp.jai…