Git Product home page Git Product logo

toortools's Introduction

toortools

Collection of small tools and classes I regularly use in my projects. I also created wrappers for lots and lots of small snippets of code that I find my self googling all the time.

I created this library based on my needs and my programming style. I have tried to create it as parameterizable and static as possible.

The project is build as a maven project. That means that you must install it in your local repository before you use it, or build it as a jar.

.idea folder is included, this is not related to Java, but its the intellij files a cloned repository is ready for development.

If you have any suggestions please let me know.

Some things included:

  • Solid Customized HTTP Library to create a request (Cookies, headers, parameters, timeouts, POST/GET methods etc).
  • Quick helper classes to do various things like:
    • Quickly download a URL with Cookie,
    • Disable https protections in java.
  • Lightning fast LevelDB Key-Value Database Implementation.
  • Define common datatypes along projects (ProxyInfo)
  • OsHelper:
    • Quick and easy Os Detector (Windows/Linux).
    • Print with Colors for console Helper.
  • Logger
  • 2 implementations of FTP
  • File download helper
  • Simple POST request helper
  • Basic String manipulation
  • String to MD5
  • Get External Ip
  • Torify traffic (Pass all traffic of running java program through TOR for Windows and Linux)
  • Simple Send email using linux command line - similar to php's mail()
  • Run Remote ssh commands using private key and get output and error code (Similar to local commands)
  • One method call that detects if process already runs, useful for crons so that 2 processes don't run on top of each other. (RecurringProcessHelper.checkAndRun())
  • Easy automatic exit after x seconds.
  • Cyta SMS Api wrapper.

Code Samples:

Some code samples can be found at the wiki

Installation

There are 2 ways to use this repository:

  • As a maven repository

  • As a jar file added to your project's classpath.

  • Install Maven:

Windows:

- Download maven binaries from: https://maven.apache.org/download.cgi (apache-maven-3.3.9-bin.zip or similar should be ok)
- Extract somewhere and add the bin/ directory to the systems PATH.
- You know when maven is installed when you run mvn and you don't get a not exists error.

Linux:

sudo apt-get install maven
  • Create a single jar with all dependencies packed:

    mvn clean compile assembly:single

Jar is created in target/ subfolder in the directory (toortools-1.0.2-jar-with-dependencies.jar)

At this point you can use the jar as any other jar.

If you want to use it in a maven project you will have to install the jar in the local maven repository (install.sh):

mvn install:install-file  -DgroupId=com.object0r -DartifactId=toortools -Dversion=1.0.2 -Dpackaging=jar -Dfile=target/toortools-1.0.2-jar-with-dependencies.jar

To use it add below in your pom.xml:

Dependency:

            <dependency>
                <groupId>com.object0r.toortools</groupId>
                <artifactId>toortools</artifactId>
                <version>1.0.2</version>
            </dependency>

Install maven 3 ubuntu:

http://sysads.co.uk/2014/05/install-apache-maven-3-2-1-ubuntu-14-04/

sudo apt-get install gdebi

wget http://ppa.launchpad.net/natecarlson/maven3/ubuntu/pool/main/m/maven3/maven3_3.2.1-0~ppa1_all.deb

sudo gdebi maven3_3.2.1-0~ppa1_all.deb

sudo ln -s /usr/share/maven3/bin/mvn /usr/bin/maven

toortools's People

Contributors

nikos-glikis avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Forkers

yrachidi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.