Saturday, November 27, 2010

Dealing with mail

This man not be 100% accurate, but its a starting point for folks trying to deal with mail issues.

Yahoo RBL
http://help.yahoo.com/l/us/yahoo/mail/postmaster/isp.html
http://help.yahoo.com/l/us/yahoo/mail/postmaster/bulk.html
Call Yahoo! Small Business Technical Support: (800) 318-0783

MSN RBL
https://support.msn.com/eform.aspx?productKey=edfsmsbl&ct=eformts&scrx=1

Comcast RBL
http://www.comcastsupport.com/Forms/NET/blockedprovider.asp

Verizon RBL
http://www2.verizon.net/micro/whitelist/

Charter.net
http://www.charter.com/postmaster

AOL RBL
http://postmaster.aol.com/tools/whitelist_guides.html
Postmaster hotline at 888-212-5537
http://postmaster.aol.com/trouble/

AT&T RBL
Contact rbl@abuse-att.net
Non-Members: 800-967-5363
Members: 800-400-1447

Sender Score
https://www.senderscore.org/lookup.php?lookup=206.54.148.24 Sender Score Check]

Other DNS/Blacklist tools
http://cbl.abuseat.org/lookup.cgi?ip=75.173.59.133
http://www.rulesemporium.com/cgi-bin/uribl.cgi
http://remote.12dt.com/
http://postmaster.aol.com/tools/rdns.html
http://www.spamcannibal.org/cannibal.cgi?page=lookup&lookup=69.6.11.39
http://unblock.secureserver.net/
http://www.ahbl.org/lookup
http://www.iptools.com

Tuesday, October 26, 2010

Set an AUTO_INCREMENT in MySQL

Nothing too hard, but not something you do every day...


alter table tablename AUTO_INCREMENT = xxx;

Sunday, June 6, 2010

Java Hot Deploy Alternative

I have been working with Apache Wicket for the past 9 months or so and I started to tire of the time I was losing. For lack of a better process, I had been making java or html edits and then running "mvn package" at which point I had to sit and wait for a hot deploy on Tomcat. Thats a good 3 or so minutes, and I was tired of losing those 3 minutes.

I discovered something those guys using wicket for some time have known, but I just didn't see the answer until today. With Jetty, you can run an instance with just a few lines of code. With the magic of the Eclipse java debugger, and those few lines of java code, you can start an instance of Jetty and see all of your .java changes in real time. This is NOT hot deploy. No. This is edit java, save java, Eclipse builds automatically, you see the changes.

For this to work, I had to make a few modifications to my Eclipse project. These may or may not be required, its just what worked for me.

* In Project > Properties > Java Build Path : Default output folder = target/MY_APPLICATION/WEB-INF/classes
* In Project > Properties > Java Build Path : Inclusion patterns, I added **/*.html (wicket specific)
* In Run -> Configurations -> Classpath : Added target/MY_APPLICATION/WEB-INF/classes to my classpath
* I use Maven, added pom dependencies:


<properties>
<jetty.version>6.1.4</jetty.version>
</properties>
<!--  JETTY DEPENDENCIES FOR TESTING  -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-management</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>



That is it. If you don't use maven, then you will have to get the required jetty jars some other way.

Here is the source:
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.bio.SocketConnector;
import org.mortbay.jetty.webapp.WebAppContext;
import org.mortbay.jetty.webapp.WebInfConfiguration;
import org.mortbay.jetty.webapp.WebXmlConfiguration;

/**
 * This is a very simple, but very nice way to test out a web app. Using
 * Create a runtime configuration. When I did this, I had to add
 * the maven output folder to the classpath:
 * 
 * target/MY_APPLICATION/WEB-INF/classes
 * 
 * Then, whe you have it running, you can hit enter to kill it.
 * The REAL MAGIC - run the config in DEBUG mode. Any changes to your 
 * java files will be picked up and you can test WITHOUT RESTARTS!!
 * 
 * Of note, in my project properties, I added all the HTML files to the source 
 * location, which has the effect of getting Eclipse to copy over the
 * the HTML files in src/main/java. It doesn't try to compile them, but it does
 * move them to the target/MY_APPLICATION/WEB-INF/classes dir where they 
 * belong.
 * 
 * Now, I don't think this will have any impact at all on Spring configs,
 * but since this starts up SOOOOO much faster than tomcat does, its a 
 * very big win. Even BIGGER - You can see your java changes WITHOUT a restart
 * 
 * @author Russell Simpkins
 */
public class Start {

 public static void main(String[] args) throws Exception {
  Server server = new Server();
  SocketConnector connector = new SocketConnector();
  
  // Set some timeout options to make debugging easier.
  connector.setMaxIdleTime(1000 * 60 * 60);
  connector.setSoLingerTime(-1);
  connector.setPort(8080);
  server.setConnectors(new Connector[] { connector });

  WebAppContext bb = new WebAppContext();
  bb.setServer(server);
  bb.setContextPath("/");
  bb.setWar("target/MY_APPLICATION");
  bb.setConfigurationClasses(new String[] { WebInfConfiguration.class.getName(), WebXmlConfiguration.class.getName() });
        bb.setParentLoaderPriority(true);

  // START JMX SERVER
  // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
  // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
  // server.getContainer().addEventListener(mBeanContainer);
  // mBeanContainer.start();
  
  server.addHandler(bb);

  try {
   System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS [ENTER] TO STOP");
   server.start();
   System.in.read();
   System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); 
   server.stop();
   server.join();
  } catch (Exception e) {
   e.printStackTrace();
   System.exit(100);
  }
 }
}

Of Note I found this article helpful http://www.draconianoverlord.com/2009/01/10/war-less-dev-with-jetty.html when digging around.

Wednesday, April 7, 2010

How to get Tramp to stop automatically attempting to connect

I admit it, I tried out Tramp in emacs, and it was cool. However, after you open something in Tramp, it decides that it always wants to connect. Very annoying. It took me a while, but I think I figured out where this was happening, it was because of a recently used list or something in .ido.last

rm -f ~/.ido.last

and emacs will boot without trying to connect. I suppose you could always edit that file or learn more about the ido feature.

Tuesday, April 6, 2010

Making your shell scripts executable under subversion

Here's something I don't do often, but it does happen; you need to mark a shell script as executable in svn so that it comes out of svn as executable:

svn propset svn:executable +x myscript.sh

That's it.

Friday, January 29, 2010

Redirecting output to syslog

I don't know why I never looked into this before, but oh well. If you have a script and you would really like to have the output go to syslog rather than redirecting to a file that will get huge, you can do this:

2>&1 | logger -p daemon.notice -t ${0##*/}[$$]

e.g.

#!/bin/bash
/usr/local/bin/something 2>&1 | logger -p daemon.notice -t ${0##*/}[$$]

This will result in stderr and stdout going to /var/log/messages on standard linux distro like Centos.

Very handy indeed!