NLinker

Runner, loading config from cmd line

Nov 18th, 2013
7,462
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 2.06 KB | None | 0 0
  1. //import com.tapad.dfe.config.{Configuration, ClasspathConfigResolver}
  2. //import com.typesafe.config.{ConfigValueFactory, ConfigFactory, Config}
  3. import com.typesafe.scalalogging.slf4j.Logging
  4. //import java.io.File
  5. //import org.rogach.scallop.ScallopConf
  6. //import scala.util.{Failure, Success, Try}
  7.  
  8. object Runner extends Logging {
  9.  
  10.   def main(args: Array[String]) = {
  11.     // parse command line args
  12.     val opts = new ScallopConf(List("-h")) {
  13.       version("1.0")
  14.       banner("""
  15. Delivery File Uploader runner
  16.  
  17. Example: java -jar dfe.jar [--config path/to/config/file]
  18.         java -jar dfe.jar [-c path/to/config/file]
  19.         java -Dcom.tapad.dfe.env=test -jar dfe.jar
  20.  
  21. For options see below:
  22.             """)
  23.       val config = opt[String]("config", descr = """ Provide the path to the configuration file, if the option is omitted, then
  24.          | the configuration will be loaded from the classpath, depending on your
  25.          | environment, hence the file 'dfe-${ENV}.conf' will be used.
  26.          |
  27.          |To define environment (in priority order)
  28.          | * "default"  (lowest priority)
  29.          | * TAPAD_ENV environment variable
  30.          | * the first file with *.env in the current dir (it's content doesn't matter)
  31.          | * "com.tapad.dfe.env" system property
  32.          | """.stripMargin)
  33.       val version = opt[Boolean]("version", descr = "Print version")
  34.       val help = opt[Boolean]("help", descr = "Show this message")
  35.     }
  36.     try {
  37.       // try to load the config, and assign it to the Configuration
  38.       println(Configuration.conf)
  39.       val config = opts.config
  40.       val path = config.apply()
  41.       val file = new File(path)
  42.       if (!file.exists()) {
  43.         throw new Exception(s"The configuration file $path does not exist")
  44.       }
  45.       val ref = ConfigValueFactory.fromAnyRef(file.getAbsolutePath)
  46.       Configuration.conf = Configuration.loadConf(
  47.         ConfigFactory.parseFile(file).withValue("source", ref)
  48.       )
  49.     } catch {
  50.       case err: Throwable => logger.error(err.getMessage)
  51.     }
  52.  
  53.   }
  54. }
Advertisement
Comments
  • Vartotir
    225 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment