openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout server.key \
-new \
-out server.pem \
-subj /CN=ningzeta.com \
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
enum Currency { | |
CZK, EUR, GBP | |
} | |
abstract class Fund { | |
Currency currency; | |
BigDecimal amount; | |
public Fund() {} |
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
#!/bin/bash | |
# Installation: | |
# | |
# 1. vim /etc/ssh/sshd_config | |
# PrintMotd no | |
# | |
# 2. vim /etc/pam.d/login | |
# # session optional pam_motd.so | |
# |
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/env python | |
import argparse | |
import fnmatch | |
import os | |
import sys | |
# Recursively generate index.html files for | |
# all subdirectories in a directory tree |
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
# Downloading a single file content can be as easy as | |
wget http://example.com/abc.zip | |
# Specify filename on disk | |
wget http://example.com/abc.zip -O file.zip | |
# Download a directory | |
wget -r --no-parent http://mysite.com/xyz/ | |
# Download a directory with no index.html |
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
# Generate Private Key | |
openssl genrsa 1024 > star.example.com.key | |
# Generate Certificate Signing Request | |
openssl req -new -key ./star.example.com.key >./star.example.com.csr | |
# Self Signed the Certificate | |
openssl x509 -in star.example.com.csr -out star.example.com.crt -req -signkey star.example.com.key -days 365 | |
# Convert to PEM. |
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
#!/bin/bash | |
# | |
# Description: The script installs Oracle JDK from tar.gz file. | |
# JDK tar.gz file is supposed to be in current directory. | |
# Script relies on format of archive name, it should be | |
# jdk-<version>[u<update>]-linux-<architecture>.tar.gz, and the | |
# directory inside is supposed to be jdk1.<version>.0[_<update>]. | |
# It's a default Oracle's naming convention for JDK tar.gz files. | |
# | |
# Supported distributions: Debian, Ubuntu, CentOS. |
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 java.util.Map; | |
import javax.servlet.http.HttpServletRequest; | |
import org.springframework.util.Assert; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import org.springframework.web.context.request.RequestAttributes; | |
import org.springframework.web.context.request.ServletRequestAttributes; | |
import org.springframework.beans.factory.annotation.Autowired; |
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
package com.ningzeta; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.SerializationFeature; | |
import java.io.File; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.util.HashMap; | |
import java.util.Scanner; |
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
# IBM DB2 | |
jdbc:db2://<HOST>:<PORT>/<DB> | |
COM.ibm.db2.jdbc.app.DB2Driver | |
# JDBC-ODBC Bridge | |
jdbc:odbc:<DB> | |
sun.jdbc.odbc.JdbcOdbcDriver | |
# IDS Server | |
jdbc:ids://<HOST>:<PORT>/conn?dsn='<ODBC_DSN_NAME>' |
NewerOlder