Skip to content

Instantly share code, notes, and snippets.

View kuzmicheff's full-sized avatar

Andre Kuzmicheff kuzmicheff

View GitHub Profile
@kuzmicheff
kuzmicheff / windows-10-usb-installer-high-sierra.md
Last active July 19, 2018 17:31
Create Windows 10 installer on USB drive in macOS 10.13 High Sierra

Prerequisites

  1. An empty USB drive with 8Gb or greater capacity. The drive must be formatted in the FAT32 (MS-DOS) file system. A non-empty drive will be formatted as part of the process and existing data will be lost.
  2. Windows 10 creation tool. When on a Mac computer, the tool is downloadable as an .iso disk image from the Microsoft's website.
  3. Terminal. The application is located in Macintosh HD > Applications > Utilities > Terminal.app

Process

  1. Mount the disk image containing the creation tool by double clicking on it.
  2. Run diskutil list which lists all connected internal and external drives.
  3. Run diskutil eraseDisk MS-DOS "WINDOWS10" MBR disk2. The disk2 is the name of the USB drive from the results of diskutil list and is dependent on the number of drives connected to the system.
  4. Run cp -rp /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS10 to copy the contents of the .iso disk image to the USB
@kuzmicheff
kuzmicheff / docker-commands.sh
Created March 21, 2018 16:44
Docker intro: notes and commands
## List Docker CLI commands
docker
docker container --help
## Display Docker version and info
docker --version
docker version
docker info
## Execute Docker image
@kuzmicheff
kuzmicheff / openssl-self-signed-cert.md
Created November 6, 2017 21:27
How to generate a self-signed TLS (SSL) certificate on Amazon Linux

Execute the following commands from the folder in which the certificate files need to be stored.

  1. openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
  2. openssl rsa -passin pass:x -in server.pass.key -out server.key
  3. rm server.pass.key
  4. openssl req -new -key server.key -out server.csr
  5. openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
@kuzmicheff
kuzmicheff / array-intersection.js
Created September 16, 2017 16:24
Array intersection in JavaScript
var arrayIntersection = function(firstArray, secondArray) {
var outputArray = [];
firstArray.forEach(function(firstArrayItem) {
secondArray.forEach(function(secondArrayItem) {
if (secondArrayItem === firstArrayItem) {
if (outputArray.length !== 0) {
if (outputArray.indexOf(secondArrayItem) === -1) {
outputArray.push(secondArrayItem);
}
@kuzmicheff
kuzmicheff / greeter.html
Created September 16, 2017 16:23
Simple greeter in TypeScript
<html>
<head>
<title>TypeScript Greeter</title>
</head>
<body>
<script src="greeter.js"></script>
</body>
</html>
@kuzmicheff
kuzmicheff / clockCtrl.js
Created September 16, 2017 16:19
Simple clock in AngularJS
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope, $interval) {
$scope.theTime = new Date().toLocaleTimeString();
$interval(function() {
$scope.theTime = new Date().toLocaleTimeString();
}, 1000);
});
@kuzmicheff
kuzmicheff / observer.js
Created September 16, 2017 16:16
Observer pattern implementation in JavaScript
function Click() {
this.handlers = []; // observers
}
Click.prototype = {
subscribe: function(fn) {
this.handlers.push(fn);
},