http://jeetworks.org/node/80


~/.bashrc 에 등록


_loghistory() {
 
# Detailed history log of shell activities, including time stamps, working directory etc.
#
# Based on 'hcmnt' by Dennis Williamson - 2009-06-05 - updated 2009-06-19
# (http://stackoverflow.com/questions/945288/saving-current-directory-to-bash-history)
#
# Add this function to your '~/.bashrc':
#
# Set the bash variable PROMPT_COMMAND to the name of this function and include
# these options:
#
# e - add the output of an extra command contained in the histentrycmdextra variable
# h - add the hostname
# y - add the terminal device (tty)
# n - don't add the directory
# t - add the from and to directories for cd commands
# l - path to the log file (default = $HOME/.bash_log)
# ext or a variable
#
# See bottom of this function for examples.
#
 
# make sure this is not changed elsewhere in '.bashrc';
# if it is, you have to update the reg-ex's below
export HISTTIMEFORMAT="[%F %T] ~~~ "
 
local script=$FUNCNAME
local histentrycmd=
local cwd=
local extra=
local text=
local logfile="$HOME/.bash_log"
local hostname=
local histentry=
local histleader=
local datetimestamp=
local histlinenum=
local options=":hyntel:"
local option=
OPTIND=1
local usage="Usage: $script [-h] [-y] [-n|-t] [-e] [text] [-l logfile]"
 
local ExtraOpt=
local NoneOpt=
local ToOpt=
local tty=
local ip=
 
# *** process options to set flags ***
 
while getopts $options option
do
case $option in
h ) hostname=$HOSTNAME;;
y ) tty=$(tty);;
n ) if [[ $ToOpt ]]
then
echo "$script: can't include both -n and -t."
echo $usage
return 1
else
NoneOpt=1 # don't include path
fi;;
t ) if [[ $NoneOpt ]]
then
echo "$script: can't include both -n and -t."
echo $usage
return 1
else
ToOpt=1 # cd shows "from -> to"
fi;;
e ) ExtraOpt=1;; # include histentrycmdextra
l ) logfile=$OPTARG;;
: ) echo "$script: missing filename: -$OPTARG."
echo $usage
return 1;;
* ) echo "$script: invalid option: -$OPTARG."
echo $usage
return 1;;
esac
done
 
text=($@) # arguments after the options are saved to add to the comment
text="${text[*]:$OPTIND - 1:${#text[*]}}"
 
# add the previous command(s) to the history file immediately
# so that the history file is in sync across multiple shell sessions
history -a
 
# grab the most recent command from the command history
histentry=$(history 1)
 
# parse it out
histleader=`expr "$histentry" : ' *\([0-9]* \[[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*\]\)'`
histlinenum=`expr "$histleader" : ' *\([0-9]* \)'`
datetimestamp=`expr "$histleader" : '.*\(\[[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*\]\)'`
histentrycmd=${histentry#*~~~ }
 
# protect against relogging previous command
# if all that was actually entered by the user
# was a (no-op) blank line
if [[ -z $__PREV_HISTLINE || -z $__PREV_HISTCMD ]]
then
# new shell; initialize variables for next command
export __PREV_HISTLINE=$histlinenum
export __PREV_HISTCMD=$histentrycmd
return
elif [[ $histlinenum == $__PREV_HISTLINE && $histentrycmd == $__PREV_HISTCMD ]]
then
# no new command was actually entered
return
else
# new command entered; store for next comparison
export __PREV_HISTLINE=$histlinenum
export __PREV_HISTCMD=$histentrycmd
fi
 
if [[ -z $NoneOpt ]] # are we adding the directory?
then
if [[ ${histentrycmd%% *} == "cd" || ${histentrycmd%% *} == "jd" ]] # if it's a cd command, we want the old directory
then # so the comment matches other commands "where *were* you when this was done?"
if [[ -z $OLDPWD ]]
then
OLDPWD="$HOME"
fi
if [[ $ToOpt ]]
then
cwd="$OLDPWD -> $PWD" # show "from -> to" for cd
else
cwd=$OLDPWD # just show "from"
fi
else
cwd=$PWD # it's not a cd, so just show where we are
fi
fi
 
if [[ $ExtraOpt && $histentrycmdextra ]] # do we want a little something extra?
then
extra=$(eval "$histentrycmdextra")
fi
 
# strip off the old ### comment if there was one so they don't accumulate
# then build the string (if text or extra aren't empty, add them with some decoration)
histentrycmd="${datetimestamp} ${text:+[$text] }${tty:+[$tty] }${ip:+[$ip] }${extra:+[$extra] }~~~ ${hostname:+$hostname:}$cwd ~~~ ${histentrycmd# * ~~~ }"
# save the entry in a logfile
echo "$histentrycmd" >> $logfile || echo "$script: file error." ; return 1
 
} # END FUNCTION _loghistory


.bashrc 가 있는 폴더에서 작업

Activating the Logger

export PROMPT_COMMAND='_loghistory'


Add Some Useful Aliases

# dump regular history log

alias h='history'
# dump enhanced history log
alias hh="cat $HOME/.bash_log"
# dump history of directories visited
alias histdirs="cat $HOME/.bash_log | awk -F ' ~~~ ' '{print $2}' | uniq"



추가로

histleader=`expr "$histentry" : ' *\([0-9]* \[[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*\]\)'`

histentrycmd=${histentry# *[0-9]* \[[0-9\-\: ]*\] }

Posted by [czar]
,

커뮤니티 포럼 개발자 게시판

개발자 게시판

[개발 tip] 솔직하게 말씀드릴까요? cxenon 등록일 2011/11/07 조회수 : 1580
제 생각엔 망할거 같습니다.

일단 html5 웹앱의 한계를 모르시군여. 차세대고 뭐고 간에 웹앱 느립니다. 게임같은 어플구현 아직 무리입니다.

또한 일반 유틸리티같은 무료앱만 즐비하겠네요. 이제 시작이라 개발자들 잔치만 벌리다 끝날거 같네요.

앱개발자 등록비 99달러/년   카카카...

정말 솔직히 말씀드릴까요? 여기가 애플인줄 아세요? 

더 심하게 말씀드릴까요?  " 미친거야냐!" 심한말 죄송합니다.

안드로이드마켓 35달러면 평생 무료

로컬마켓에서 성공한 티스토어도 현재 개발자 등록비 무료로 해주고 있습니다.

무슨배짱으로 이런 어이없는 정책을 만든건지?  제발 고민좀 해보고 정책을 만드세요. 그냥 뻬끼지나 말고...

예를 들어 개발자 등록비를 판매수수료에 일부 부과한다던지 아님 등록시에 1불씩 받는다던지 뭐 많잔아요.

이제 시작이면 개발자들을 모을수 있는 정책이 필요한데... 와 어이없다.


설마 케이앱스가 대단한 마켓이 될거라는 착각하시는거 아닌지....

여기가 정말 이용자가  많고 큰수익을  얻을수 있을거 같다고 생각하십니까?

ㅋㅋㅋㅋㅋ

아마 여기 개발자 가입하는 분들  솔직히 말해서  앱 개발 지원 사업 12억원 지원 받을수 있을까 해서 참여하는거지

여기서 매출을 올릴거라 기대도 안할껄요. 뭐 내 생각일수도 있지만...


끝으로 세계로 나갈려면 이름부터 바꾸세요. 이름은 코리아앱스 개발자등록비는 달러로 받고... ㅋㅋㅋ

이름부터 심형래꼴 날꺼 같네요. 애국이고 뭐고 코리아 빼고 가면 안되나 꼭 이런데 애국심을 넣어야되나....

더쓰고 싶지만 그냥 가입하고 몇자 적어봅니다.


비판일수도 있고 제생각이 짧을수도 있겠지만 그래도 처음 지원기사도 보고 가입해서 어떤데 있가 둘러보고 느낀 점을
그대로 적어봅니다..


Posted by [czar]
,
centos 6.4 에 titanium 을 실행하는데..
[Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]

이런 에러만 계속.. 그래서


export MOZILLA_FIVE_HOME=/usr/lib/xulrunner
export LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:$LD_LIBRARY_PATH

이것도 넣어 봤지만 역시나 같은 에러....

해결 방법..

yum install webkitgtk

이걸 설치하니 잘 되네~~~

Posted by [czar]
,

aapt tool failed warning androidmanifest.xml already defines versioncode

오류 오류.. 아..


res/layout.xml

에서

android:text=""


이런게 있으면 오류 발생.


ane에서는 string.xml 에서 참조해야함.

무조건인듯...


style 이런것도

style="@style/box_field" 

이렇게 사용.해야함.

Posted by [czar]
,




/etc/sysconfig/svnserve

파일을 생성한다.


OPTIONS="--threads --root /home/svn"


OPTIONS="--threads --root /home/svn --listen-port 3690"



참고

http://jmnote.com/wiki/SVN_%EC%84%9C%EB%B2%84_%EC%84%A4%EC%A0%95

Posted by [czar]
,

http://www.yeahbutisitflash.com/?p=4141


Flash Professional CS6 에서 AIR SDK 변경하기

Flash Professional CS6 에서 AIR SDK 3.8 사용하기 


http://www.adobe.com/devnet/air/air-sdk-download.html

air sdk 다운 받자.







Posted by [czar]
,

- svn 설치

yum install mod_dav_svn subversion -y


service httpd restart

chkconfig httpd on



- svn - apache 연동 설정

vi /etc/httpd/conf.d/subversion.conf


LoadModule dav_svn_module     modules/mod_dav_svn.so

LoadModule authz_svn_module   modules/mod_authz_svn.so

 

<Location /svn>

   DAV svn

   SVNParentPath /var/www/svn

   AuthType Basic

   AuthName "Subversion repositories"

   AuthUserFile /etc/svn-auth-users

   Require valid-user

</Location>



- svn 사용자 생성

## Create testuser ##

htpasswd -cm /etc/svn-auth-users testuser

New password: 

Re-type new password: 

Adding password for user testuser

 

## Create testuser2 ##

htpasswd -m /etc/svn-auth-users testuser2

New password: 

Re-type new password: 

Adding password for user testuser2



- svn repo create

mkdir /home/svn

cd /home/svn


svnadmin create restrepo

chown -R apache.apache testrepo


# If you have SELinux enabled (you can check it with "sestatus" command) ##

## then change SELinux security context with chcon command ##

 

chcon -R -t httpd_sys_content_t /home/svn/testrepo

 

## Following enables commits over http ##

chcon -R -t httpd_sys_rw_content_t /home/svn/testrepo


- apache restart

/etc/init.d/httpd restart

or

service httpd restart




- 접속

http://localhost/svn/testrepo




- config repo

testrepo/conf/svnserve.conf

anon-access = none

authz-db = authz



- create trunk, branches, tags 

mkdir -p /tmp/svn-structure-template/{trunk,branches,tags}


svn import -m 'Initial import' /tmp/svn-structure-template/ http://localhost/svn/testrepo/

Adding         /tmp/svn-structure-template/trunk

Adding         /tmp/svn-structure-template/branches

Adding         /tmp/svn-structure-template/tags

 

Committed revision 1.

Posted by [czar]
,

http://matthiashoys.wordpress.com/2012/04/20/automatically-start-oracle-11g-on-oracle-linux-6-2-after-server-reboot/


/etc/oratab

#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
oratst:/u01/app/oracle/product/11.2.0/db_1:Y

$ su – oracle

$ vi /home/oracle/scripts/ora_start.sh

#!/bin/bash

# script to start the Oracle database, listener and dbconsole

. ~/.bash_profile

# start the listener and the database
$ORACLE_HOME/bin/dbstart $ORACLE_HOME

# start the Enterprise Manager db console
$ORACLE_HOME/bin/emctl start dbconsole

exit 0


$ vi /home/oracle/scripts/ora_stop.sh

#!/bin/bash

# script to stop the Oracle database, listener and dbconsole

. ~/.bash_profile

# stop the Enterprise Manager db console
$ORACLE_HOME/bin/emctl stop dbconsole

# stop the listener and the database
$ORACLE_HOME/bin/dbshut $ORACLE_HOME

exit 0


$  chmod u+x ora_start.sh ora_stop.sh


- root

$ vi /etc/init.d/oracle

#!/bin/bash
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.

# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_OWNER=oracle
RETVAL=0

case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "/home/oracle/scripts/ora_start.sh"
        touch /var/lock/subsys/oracle
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "/home/oracle/scripts/ora_stop.sh"
        rm -f /var/lock/subsys/oracle
        ;;
    *)
        echo $"Usage: $0 {start|stop}"
        RETVAL=1
esac
exit $RETVAL


$ chmod 750 /etc/init.d/oracle



$ chkconfig --add oracle






Posted by [czar]
,



http://phonegapblog.blogspot.kr/2013/07/phonegap-galaxy-s4-handles-taps-as.html


https://groups.google.com/forum/#!msg/phonegap/eNd_eFpPY2o/unj_2-DXK-0J





ere's how I solved the onclick-problem. Possibly not the best way, but in my case it was easy to implement.


So. This link would be fired twice. We don't want that.

<div onClick="myFunction();">a bad button</div>


So, instead I changed all my links to this:

<div onClick="attemptClick('myFunction()');">a nice button</div>


And then I added this JavaScript to filter the clicks..

            var clickLock = false;

            

            function attemptClick(funcName) {

                if(!clickLock) {

                    clickLock = true;

                    setTimeout(funcName,0);

                    setTimeout('resetClickLock()',300);

                }else {

                    alert("Double tap prevented!"); //Only for debugging ofc, remove!

                }

            }

            

            function resetClickLock() {

                clickLock = false;

                alert("no more lock"); //Only for debugging ofc, remove!

            }


If anyone have a better solution, please let me know! :-)



Den torsdagen den 4:e juli 2013 kl. 13:55:45 UTC+2 skrev Tor Claesson:







Changed the JavaScript a bit, this works better..


var clickLock = false;

            

            function attemptClick(funcName) {

                if(!clickLock) {

                    clickLock = true;

                    setTimeout("queueClick("+funcName+")",100);

                    setTimeout('resetClickLock()',1000);

                }else {

                }

            }

            

            function queueClick(funcName) {

                if(!clickLock) {

                    setTimeout(funcName,0);

                }else {

                }

            }

            

            function resetClickLock() {

                clickLock = false;

            }


Den fredagen den 5:e juli 2013 kl. 14:56:20 UTC+2 skrev Tor Claesson:

Posted by [czar]
,

JAVA 언어에서 RSA 키를 생성하는 방법과 생성된 공개키/개인키를 이용하여서 암호화/복호화하는 방법은 아래의 소스 코드와 같다. 

 

[출처] [Java] RSA 키 생성 및 암호화/복호화 방법|작성자 까미유

package com.test;


import java.security.Key;

import java.security.KeyFactory;

import java.security.KeyPair;

import java.security.KeyPairGenerator;

import java.security.spec.RSAPrivateKeySpec;

import java.security.spec.RSAPublicKeySpec;

import javax.crypto.Cipher;


public class TestRsa {

public static void main(String[] args) {

try {

// RSA 공개키/개인키를 생성한다.

KeyPairGenerator clsKeyPairGenerator = KeyPairGenerator.getInstance("RSA");

clsKeyPairGenerator.initialize(2048);


KeyPair clsKeyPair = clsKeyPairGenerator.genKeyPair();

Key clsPublicKey = clsKeyPair.getPublic();

Key clsPrivateKey = clsKeyPair.getPrivate();

KeyFactory fact = KeyFactory.getInstance("RSA");

RSAPublicKeySpec clsPublicKeySpec = fact.getKeySpec(clsPublicKey, RSAPublicKeySpec.class);

RSAPrivateKeySpec clsPrivateKeySpec = fact.getKeySpec(clsPrivateKey, RSAPrivateKeySpec.class);

System.out.println("public key modulus(" + clsPublicKeySpec.getModulus() + ") exponent(" + clsPublicKeySpec.getPublicExponent() + ")");

System.out.println("private key modulus(" + clsPrivateKeySpec.getModulus() + ") exponent(" + clsPrivateKeySpec.getPrivateExponent() + ")");


// 암호화 한다.

String strPinNumber = "1234567890";


Cipher clsCipher = Cipher.getInstance("RSA");

clsCipher.init(Cipher.ENCRYPT_MODE, clsPublicKey);

byte[] arrCipherData = clsCipher.doFinal(strPinNumber.getBytes());

String strCipher = new String(arrCipherData);

System.out.println("cipher(" + strCipher + ")");


// 복호화 한다.

clsCipher.init(Cipher.DECRYPT_MODE, clsPrivateKey);

byte[] arrData = clsCipher.doFinal(arrCipherData);


String strResult = new String(arrData);

System.out.println("result(" + strResult + ")");

} catch (Exception e) {


}

}

}



Posted by [czar]
,