This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# us-east-1 ami-42916c2b canonical ebs/ubuntu-natty-daily-i386-desktop-20110327 | |
# ec2-run-instances --instance-type t1.micro --user-data-file /home/smoser/t/nx-setup.ud ami-42916c2b | |
{ | |
set -x | |
iusername="nxtest" | |
ipasswd="foo.bar-NX" | |
lp_auth="smoser" # auth the user '${lp_auth}' to 'ubuntu' with ssh-import-id | |
[ -z "${lp_auth}" ] || sudo -Hu ubuntu ssh-import-id ${lp_auth} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insertClosureStack(obj, name, variable) { | |
var old = obj[name]; | |
obj[name] = function (n) { | |
if ( typeof n == 'number' ) { // 인자가 있는 경우 검색 시작 | |
if ( variable == n ) { // 클로저 꼭대기 환경변수 variable 값과 주어진 인자를 비교 | |
console.log('found ' + variable); // 맞으면 출력 | |
} else { // 아니면 | |
if ( typeof old == 'function' ) { // 직전 환경을 갖고있는 클로저(function)가 정의되어 있는지 확인 후 | |
old(n); // 있으면 호출하며 양파껍질 하나를 벗김 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Management; | |
namespace memoryUsage | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package docs.oracle.com.Thread; | |
public class HelloRunnable implements Runnable { | |
@Override | |
public void run() { | |
// TODO Auto-generated method stub | |
System.out.println("Hello from a thread!"); | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Convert date time string is in the following format 06/12/2012 07:21:22. How can I conver it to UNIX timestamp? | |
#우리말 : 시간포맷을 일반시간형태에서 유닉스값으로 변경하는 법 | |
#What you're looking for is date --date='06/12/2012 07:21:22' +"%s". | |
#당신으 찾는 날짜는 셀에서 다음과 같이 실행하면 됨 | |
date --date='06/12/2012 07:21:22' +"%s" | |
#$ date --date='11/10/2013 07:21:22' +"%s" | |
#결과값 : 1384068082 | |
#reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#df – displays disk usage information based on file system (ie: entire drives, attached media, etc ) | |
#The -h flag is for ‘human readable form’ meaning return results in the familiar megabyte/gigabyte format. You should see #something like this: | |
df -h | |
#du – displays disk usage information for each file and directory (ie: home directories, folders, etc ) | |
du -sh ~ | |
du -sh * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: kangnaru | |
* Date: 13. 10. 12. | |
* Time: 오전 10:14 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
$arr = array(1, 3, 6, 9); | |
print_r($arr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: kangnaru | |
* Date: 13. 10. 12. | |
* Time: 오전 10:18 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
$arr = array(1, 3, 9, 2); | |
array_push($arr,10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: kangnaru | |
* Date: 13. 10. 12. | |
* Time: 오후 12:56 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
$arr = array("foo"=>"bar", 12 => true); | |
echo $arr["foo"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: kangnaru | |
* Date: 13. 10. 12. | |
* Time: 오후 1:21 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
//http://php.net/manual/en/language.types.array.php |
OlderNewer