Skip to content

Instantly share code, notes, and snippets.

View carlostse's full-sized avatar

Carlos Tse carlostse

View GitHub Profile
@carlostse
carlostse / Tor Dockerfile
Last active May 25, 2020 16:30
Tor Dockerfile
FROM debian:buster
RUN apt-get update; apt-get install -y gzip curl make gcc libevent-dev libssl-dev zlib1g-dev
RUN curl -L https://dist.torproject.org/tor-0.4.3.5.tar.gz | gzip -dc | tar x -C ~/
RUN cd ~/tor-0.4.3.5; ./configure --prefix=/opt/tor; make; make install; chmod +x /opt/tor/bin/*; cd ~
RUN apt-get purge -y curl make gcc zlib1g-dev; apt-get autoremove --purge -y; rm -rf /var/lib/apt/lists; rm -rf ~/tor-0.4.3.5
COPY torrc /opt/tor/etc/
ENTRYPOINT ["/opt/tor/bin/tor"]
/**
* Check if the object is null or empty
*
* @param obj - the test object
* @return true if the value is missing
*/
public static boolean isMissing(Object obj) {
if (obj == null) return true;
if (obj instanceof CharSequence) return (obj).toString().trim().length() < 1;
if (obj instanceof Collection) return ((Collection) obj).size() < 1;