This file contains hidden or 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
#Recommended minimum configuration: | |
acl manager proto cache_object | |
acl localhost src 127.0.0.1/32 | |
acl to_localhost dst 127.0.0.0/8 | |
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24 | |
acl SSL_ports port 443 | |
acl Safe_ports port 80 # http | |
acl Safe_ports port 21 # ftp | |
acl Safe_ports port 443 # https | |
acl Safe_ports port 70 # gopher |
This file contains hidden or 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 org.lema.notasapp.infra.filter; | |
import java.io.BufferedReader; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.Scanner; |
This file contains hidden or 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 br.com.caelum.financas.util; | |
import javax.persistence.EntityManager; | |
import br.com.caelum.financas.modelo.Conta; | |
public class PopulaConta { | |
public static void main(String[] args) { |
This file contains hidden or 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
public class ClassMetadataLeakSimulator { | |
private static Map<String, ClassA> classLeakingMap = new HashMap<String, ClassA>(); | |
private final static int NB_ITERATIONS_DEFAULT = 50000; | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { |
This file contains hidden or 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 br.com.caelum.financas.util; | |
import java.math.BigDecimal; | |
import java.util.Calendar; | |
import javax.persistence.EntityManager; | |
import br.com.caelum.financas.modelo.Conta; | |
import br.com.caelum.financas.modelo.Movimentacao; | |
import br.com.caelum.financas.modelo.TipoMovimentacao; |
This file contains hidden or 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
@Path("/mobile") | |
public void service() throws Exception { | |
BufferedReader reader = request.getReader(); | |
StringBuilder sb = new StringBuilder(); | |
String json; | |
while((json = reader.readLine()) != null) { | |
sb.append(json); | |
} |
This file contains hidden or 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
String nome = "Leonardo"; | |
String senha = "' or 1=1 #"; | |
Connection cnn = DriverManager.getConnection("jdbc:mysql://localhost/sql_injection", "root", ""); | |
PreparedStatement statement = cnn.prepareStatement("select * from Usuario where nome = '" + nome + "' and senha='" + senha + "';"); | |
ResultSet resultSet = statement.executeQuery(); | |
while(resultSet.next()) | |
System.out.println(resultSet.getString("nome")); |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<pluginGroups> | |
</pluginGroups> | |
<proxies> | |
<proxy> |
This file contains hidden or 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 br.com.caelum.gcm; | |
import java.io.IOException; | |
import com.google.android.gcm.server.Message; | |
import com.google.android.gcm.server.Sender; | |
public class EnviarMensagem { | |
private static final String API_KEY = ""; | |
private static final String DEVICE_ID = ""; |
This file contains hidden or 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
class AlertUtils { | |
private AlertDialog build(Context ctx, String title, String text){ | |
return new AlertDialog.Builder(ctx) | |
.setCancelable(true) | |
.setTitle(title) | |
.setMessage(text) | |
.create(); | |
} | |
public void show(Context ctx, String title, String text) { | |
AlertDialog dialog = build(ctx, title, text); |
NewerOlder