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 getType(obj) { | |
const signature = Object.prototype.toString.call(obj); | |
return signature.slice(8,-1).toLowerCase(); | |
} | |
const cases = [ | |
// undefined | |
undefined, | |
// null |
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
// Create certificate | |
// https://www.akadia.com/services/ssh_test_certificate.html | |
// | |
// 1. Generate a Private Key | |
// openssl genrsa -des3 -out ssl.key 4096 | |
// | |
// 2. Generate a CSR (Certificate Signing Request) | |
// openssl req -new -key ssl.key -out ssl.csr | |
// | |
// 3. Remove Passphrase from Key |
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
# Create www-data account | |
useradd -s /sbin/nologin -d /var/www -r -M -U -u 777 www-data | |
# Set the ownership to www directory | |
# chown -R root:www-data /var/www | |
chown -R www-data:www-data /var/www | |
# Set permissions of child files and directories inside the www directory | |
find /var/www -type d -exec chmod 2775 {} + | |
find /var/www -type f -exec chmod 0664 {} + |
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
Vagrant.configure("2") do |config| | |
config.vm.box = "debian/jessie64" | |
config.vm.box_check_update = false | |
config.vm.provider "virtualbox" do |vb| | |
vb.name = "debian" | |
vb.cpus = 1 | |
vb.memory = 1024 | |
vb.gui = false | |
end |
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/bash | |
# This is a bash script for backend serving | |
# using the Docker | |
# | |
# Author: Yukal Alexander <[email protected]> | |
# License MIT | |
# Version: 3.0 | |
# Set variables |
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 Hash | |
# Usage: | |
# genhash | |
# genhash 64 | |
function genhash() { | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1 | |
} | |
# Get External IP | |
# External IP |
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 | |
# Bash Color and Style Demonstration | |
# Author: Yukal Alexander <[email protected]> | |
# License MIT | |
# Version: 3.0 | |
# | |
# UTF-8 encoding table and Unicode characters | |
# https://www.utf8-chartable.de/unicode-utf8-table.pl?start=9472&unicodeinhtml=dec |
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/sh | |
# Author: Yukal Alexander <[email protected]> | |
# License MIT | |
# Version: 2.0 | |
# Usage: | |
# * $ ./docker-vuejs init - Init Project (starts 'vue init webpack .') | |
# - $ ./docker-vuejs - Start Project (starts 'webpack-dev-server') | |
# $ ./docker-vuejs clean - Remove Project |
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 | |
# BACKUP | |
# Save info in text-file (parted) | |
sudo parted /dev/sdX print > sdX-partiotion.info | |
# Save info in text-file (sfdisk) | |
sudo sfdisk -d /dev/sdX > sdX-partiotion.info | |
# Save info in text-file (gdisk) | |
sudo gdisk -l /dev/sdX > sdX-partiotion.info |
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 | |
# Create Partitions | |
cgdisk /dev/sda | |
cgdisk /dev/sdb | |
# Format Partitions (SSD) | |
mkfs.fat -F32 /dev/sda1 | |
mkfs.ext4 /dev/sda2 -L root | |
mkfs.ext4 /dev/sdb5 -L home |
NewerOlder