Skip to content

Instantly share code, notes, and snippets.

View htcholdingsvn's full-sized avatar

HTC Holdings Việt Nam htcholdingsvn

View GitHub Profile
@htcholdingsvn
htcholdingsvn / PowerShell Customization.md
Created June 6, 2019 11:18 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@htcholdingsvn
htcholdingsvn / download.sh
Created April 23, 2019 03:10
Create WAS liberty local-repositories
./installUtility find
while read in; do ./installUtility download "$in" --acceptLicense --location=./local-repositories; done < local-repositories.txt
@htcholdingsvn
htcholdingsvn / Win10-64bit-npm.md
Created December 21, 2018 09:05 — forked from jtrefry/Win10-64bit-npm.md
Configuring Windows 10 (64-bit) for npm and node-gyp
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse
@htcholdingsvn
htcholdingsvn / IntelIJTrialReset.bat
Created December 21, 2018 07:33
How to Reset InteIIiJ IDEA Evaluation Key in Windows
cd "C:%HOMEPATH%\.IntelliJIdea*\config"
rmdir "eval" /s /q
del "options\options.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
:: It is Highly Advised to Purchase the JetBrain Softwares
:: This is only for the case You just want to Extend the
:: Trial Period and Evaluate the IDE for some more Time
@htcholdingsvn
htcholdingsvn / gen_ssl.sh
Last active June 8, 2018 06:25 — forked from fitzix/gen_ssl.sh
gen ssl
#!/bin/sh
# create self-signed server certificate:
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -des3 -out $DOMAIN.key 1024
@htcholdingsvn
htcholdingsvn / Nginx-Proxy.md
Created June 8, 2018 06:22 — forked from hardikns/Nginx-Proxy.md
How to enable HTTPS on servers using Nginx

How to enable HTTPS on servers using Nginx

This document talks about securing your web application or api using nginx proxy.

    -------------          ----------------           -------------
    |           |          |              |           | Web App   |
    |  Client   +--------->+ nginx server +---------->+    or     |

| | https | | http | Web API |

@htcholdingsvn
htcholdingsvn / Docker_Deploy.md
Created June 8, 2018 06:22 — forked from bradbergeron-us/Docker_Deploy.md
Deploying a Docker Registry

Deploying a registry server

This section explains how to deploy a Docker Registry either privately for your own company or publicly for other users. For example, your company may require a private registry to support your continuous integration (CI) system as it builds new releases or test servers. Alternatively, your company may have a large number of products or services with images you wish to serve in a branded manner.

Docker's public registry maintains a default registry image to assist you in the deployment process. This registry image is sufficient for running local tests but is insufficient for production. For production you should configure and build your own custom registry image from the docker/distribution code.

Note: The examples on this page were written and tested using Ubuntu 14.04. If you are running Docker in a different OS, you may need to "translate" the commands to meet the requirements of your own environment.

###Simple example with the official image In this section, you cre

@htcholdingsvn
htcholdingsvn / OpenSSL.md
Created June 8, 2018 06:21 — forked from mohanpedala/OpenSSL.md
OpenSSL Working with SSL Certificates, Private Keys and CSRs

Genereating a private key and a CSR(Certificate Signing Request )

Use this method if you want to use HTTPS (HTTP over TLS) to secure your Apache HTTP or Nginx web server, and you want to use a Certificate Authority (CA) to issue the SSL certificate. The CSR that is generated can be sent to a CA to request the issuance of a CA-signed SSL certificate. If your CA supports SHA-2, add the -sha256 option to sign the CSR with SHA-2.

Creating a 2048-bit private key (domain.key) and a CSR (domain.csr) from scratch:

openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr

Command Explanation:

  1. -newkey rsa: 2048 option specifies that the key should be 2048-bit, generated using the RSA algorithm.
  2. -nodes option specifies that the private key should not be encrypted with a pass phrase.
version: '3'
services:
deluge:
image: linuxserver/deluge
container_name: deluge
volumes:
- ./download:/downloads
- ./config:/config
environment:
- PGID=1001
sudo mkdir -p /opt/bin
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /opt/bin/docker-compose
sudo chmod +x /opt/bin/docker-compose
sudo curl -L https://gist.github.com/YannRobert/3824d0079a1da84173850339334ba24e/raw/d29b79f775fd7ad2cb157fe63e8b1d1e1de2a55d/save-load-docker-images.sh -o /opt/bin/save-load-docker-images
sudo chmod +x /opt/bin/save-load-docker-images
docker pull lordmike/nginx-directorybrowse
docker run --name nginx -p 80:80 -v ~:/usr/share/nginx/html:ro -d lordmike/nginx-directorybrowse