Some Random Code Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.net.ssl.*; | |
import java.io.*; | |
import java.security.KeyStore; | |
import java.security.MessageDigest; | |
import java.security.cert.CertificateException; | |
import java.security.cert.X509Certificate; | |
public class Test { | |
private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) { | |
PROXY = "SOCKS5 127.0.0.1:9743; SOCKS 127.0.0.1:9743" | |
// PROXY = "PROXY 127.0.0.1:9743" | |
// "PROXY 127.0.0.1:23870"; | |
alert("ABCXY request for (" + url+ " with host: " + host + ")"); | |
if(shExpMatch(url, "http://10.182.70.240*")) | |
return PROXY; | |
} |
|--- Strings |--- Char
*** String is immutable so they do not have method like reverse.
- .toCharArray()
- .split()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.boot.web.servlet.ServletRegistrationBean; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.ws.config.annotation.EnableWs; | |
import org.springframework.ws.transport.http.MessageDispatcherServlet; | |
@SpringBootApplication | |
@EnableWs |
- She bang line, location of shell
which bash
- Store arguments from bash in array
args=("$@")
- Number of arguments
count=("$#")
- Date
NOW=$(date +"%m-%d-%Y")
- Print a random file
files=(./*); printf "%s\n" "${files[RANDOM % ${#files[@]}]}"
- Create empty dir
[ -d "./data" ] && mkdir data || rm -rf ./data/*
Moves selected files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/java --source 12 --class-path /Users/dhval/project/jar/poi-3.16/lib/* | |
import java.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.math.BigDecimal; | |
import java.util.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ubuntu | |
MAINTAINER Dhval Mudawal | |
RUN apt-get update && apt-get --ignore-missing install -y \ | |
build-essential \ | |
lsof \ | |
git \ | |
wget \ | |
software-properties-common \ | |
&& apt-get clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
NewerOlder