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
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-jdk |
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
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipOutputStream; | |
public class JavaZip { | |
public static void main(String[] args) throws Exception { | |
ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(args[0])); | |
for (int i = 1; i < args.length; i++) { |
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
keytool -genkey -keystore keystore -alias me | |
keytool -selfcert -keystore keystore -alias me | |
jarsigner -keystore keystore jarfile.jar me |
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
ZipInputStream zipInputStream = new ZipInputStream(new BufferedInputStream(inputStream)); | |
for (ZipEntry entry = null; (entry = zipInputStream.getNextEntry()) != null;) { | |
String name = entry.getName(); | |
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
for (int i = 0; (i = zipInputStream.read()) != -1;) { | |
out.write(i); | |
} | |
out.close(); | |
} | |
zipInputStream.close(); |
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
cat << EOF | sudo tee /etc/default/locale | |
LANGUAGE=en_US.UTF-8 | |
LC_ALL=en_US.UTF-8 | |
LANG="en_US.UTF-8" | |
EOF |
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
sudo apt-get install postfix libsasl2-2 ca-certificates libsasl2-modules | |
cat << EOF | sudo tee /etc/postfix/main.cf | |
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) | |
biff = no | |
append_dot_mydomain = no | |
readme_directory = no | |
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem | |
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key | |
smtpd_use_tls=yes | |
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache |
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
sudo dd if=/dev/zero of=/swap bs=1024 count=524288 | |
sudo chmod 600 /swap | |
sudo mkswap /swap | |
sudo swapon /swap | |
cat << EOF | sudo tee -a /etc/fstab | |
/swap none swap sw 0 0 | |
EOF |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>br.com.yanaga</groupId> | |
<artifactId>jarsigner</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>jarsigner</name> | |
<url>http://maven.apache.org</url> | |
<properties> |
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
import java.io.FileNotFoundException; | |
import javax.annotation.PostConstruct; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.util.Log4jConfigurer; | |
@Configuration | |
@Profile("development") |
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
import java.io.FileNotFoundException; | |
import javax.annotation.PostConstruct; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.util.Log4jConfigurer; | |
@Configuration | |
@Profile("production") |
OlderNewer