Iliescu despre Dancu: “Sta, suge din deget si emite fraze teoretice”.
Iliescu le-a recomandat tuturor celor care au obţinut rezultate proaste la locale „să stea cu picioarele în lighean” şi să analizeze „cu toată seriozitatea ce se întâmplă”.
For what is a man, what has he got?
If not himself, then he has naught.
To say the things he truly feels;
And not the words of one who kneels.
The record shows I took the blows -
And did it my way!
A little filter that detects if the The X-Forwarded-For (XFF) HTTP header is set.
If it’s set it means that the call arrived trough a proxy, and when the “getRemoteAddr()” method is called by the server it will return the last proxy in the IP array.
So basicly what this does is (if XFF is set) forces the “getRemoteAddr()/getRemoteHost()” methods to always return the first IP in the XFF header.
Here’s the filter class:
public final class EditHeader implements Filter {
private FilterConfig filterConfig;
public void init(FilterConfig filterConfig) throws
ServletException {
System.out.println("Filter initialized");
this.filterConfig = filterConfig;
}
public void destroy() {
System.out.println("Filter destroyed");
this.filterConfig = null;
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
chain.doFilter( new MyWrapper((HttpServletRequest) request), response);
}
}
Here you have the filter wrapper class:
public final class MyWrapper extends
HttpServletRequestWrapper {
public HttpServletRequest httpRequest = (HttpServletRequest) super.getRequest();
public String reqAddr = httpRequest.getRemoteAddr();
public String reqHost = httpRequest.getRemoteHost();
public MyWrapper(HttpServletRequest servletRequest) {
super(servletRequest);
}
public String getRemoteAddr() {
String callerChain = httpRequest.getHeader("X-Forwarded-For");
if (callerChain==null ||callerChain.equals(""))
return reqAddr+"abc";
StringTokenizer tempStringTokenizer = new StringTokenizer(callerChain, ",");
return (tempStringTokenizer.nextToken());
}
public String getRemoteHost() {
String callerChain = httpRequest.getHeader("X-Forwarded-For");
if (callerChain==null ||callerChain.equals(""))
return reqHost+"def";
StringTokenizer tempStringTokenizer = new StringTokenizer(callerChain, ",");
return (tempStringTokenizer.nextToken());
}
And here’s a little test servlet :
public class test extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("");
out.println("Test");
out.println("");
out.println("Caller Host :" +req.getRemoteAddr() + "");
out.println("Caller Addr :" + req.getRemoteHost() +"");
out.println("");
}
}
The web.xml looks like this :
EditHeaderEditHeaderEditHeadertesttesttesttest
test
M&M’s … my recent favourite 5 minute break snack! I always want more and finished quick … BUT TODAY …. after i finished up (so i tought) a little bag ( 20 candies or so)… I left it on the desk … and after 15 minutes picked it up and for my surprise there was one more m&m there …. justy laying there… a little red ball of juicy chocolate :)) That was the most tasty m&m I ever ate. THE END! (stupid post )
Between work, work, graduation paper work, work, some jogging, and all the South Park (note: I’m not watching them online since my conection at home doesn’t exceed 6 Kbps ) eppisodes that i’m re-watching, I managed to watch The bank job(2008) starring (one of my favourites actors) Jason Statham.
Based on a “true story of a heist gone wrong… in all the right ways” in 1970s, it has it all: british accent (brits do it better!), some action, some naked scenes :), ’70s ambient and a lot more.
However i think that the 107m:03s spent watching it were not a waste of time.