- Connect through SSH
ssh -l <user name> -i <pem file> <server ip>
- Copy file
scp -i @:
{ | |
"greeting": "おはようございます", | |
"name": "先生" | |
} |
ssh -l <user name> -i <pem file> <server ip>
scp -i @:
public static void main(String[] args) { | |
String text = "<a href=\"http://www.google.com\">google</a>"; | |
Pattern p = Pattern.compile("<a href=\"(.*?)\">"); | |
Matcher m = p.matcher(text); | |
if (m.find()) { // use find(), don't use matches() | |
System.out.println(m.group(1)); | |
} | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:p="http://www.springframework.org/schema/p" | |
xmlns:sec="http://www.springframework.org/schema/security" | |
xmlns:cas="http://unicon.net/schema/cas" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://www.springframework.org/schema/security | |
http://www.springframework.org/schema/security/spring-security-3.1.xsd |
// Some browsers do not support Object.create | |
if (typeof Object.create === 'undefined') { | |
Object.create = function(prototype) { | |
function C() {} | |
C.prototype = prototype; | |
return new C(); | |
} | |
} | |
function Actor(name) { |
package com.franzwong.codepiece.java.ehcache; | |
import net.sf.ehcache.Cache; | |
import net.sf.ehcache.CacheManager; | |
import net.sf.ehcache.Element; | |
public class MainApplication { | |
public static void main(String[] args) { | |
CacheManager manager = CacheManager.create(); | |
manager.addCache("myCache"); |
mkdir ~/src ~/src/java ~/src/javascript ~/src/docker | |
mkdir ~/dev | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update | |
brew tap caskroom/cask | |
brew tap caskroom/versions | |
brew cask install sublime-text3 | |
brew cask install virtualbox | |
brew cask install java |
AmazonS3 s3 = new AmazonS3Client(new BasicAWSCredentials("userName", "password")); | |
s3.setEndpoint("s3-ap-southeast-1.amazonaws.com"); | |
ObjectMetadata metadata = new ObjectMetadata(); | |
metadata.setContentType("image/jpeg"); | |
PutObjectRequest req = new PutObjectRequest("my-bucket", "test.jpg", new FileInputStream("/Users/user/images/test.jpg"), metadata); | |
req.withCannedAcl(CannedAccessControlList.PublicRead); | |
req.withStorageClass(StorageClass.ReducedRedundancy); | |
PutObjectResult res = s3.putObject(req); | |
System.out.println(res.getContentMd5()); |
// sudo docker run -it --rm -p 3000 -v /var/run/docker.sock:/var/run/docker.sock rwwa/test_service | |
var http = require('http'); | |
var hostname = process.env['HOSTNAME']; | |
console.log('hostname: ' + hostname); | |
function getContainerInfo() { | |
var options = { | |
socketPath: '/var/run/docker.sock', |