Skip to content

Instantly share code, notes, and snippets.

View crafter999's full-sized avatar

Drakos crafter999

View GitHub Profile
PS C:\Users\user\Desktop> kubectl.exe get -f .\recommended.yaml.txt
NAME STATUS AGE
namespace/kubernetes-dashboard Active 2m10s
NAME SECRETS AGE
serviceaccount/kubernetes-dashboard 1 2m10s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes-dashboard ClusterIP 10.97.3.127 <none> 443/TCP 2m9s
PS C:\Windows\system32> Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
FeatureName : Microsoft-Hyper-V
DisplayName : Hyper-V Platform
Description : Provides the services that you can use to create and manage virtual machines and their resources.
RestartRequired : Possible
State : Enabled
@crafter999
crafter999 / launch.json
Created October 17, 2019 13:41
Debug Node.js + Typescript on VSCODE (linux)
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Node.js",
"program": "${workspaceFolder}/main.ts", // <--- typescript debug file
"outFiles": ["${workspaceFolder}/dist/**/*.js"], // <--- dist js files
"sourceMaps": true,
@crafter999
crafter999 / index.js
Created July 4, 2019 12:36
Simple AWS lambda quote app
exports.handler = (event, context, callback) => {
const quotes = [{
author: "Oscar Wilde",
quote: "Be yourself; everyone else is already taken."
}, {
author: "Mahatma Gandhi",
quote: "Be the change that you wish to see in the world."
}, {
author: "Friedrich Nietzsche",
quote: "Without music, life would be a mistake"
@crafter999
crafter999 / cpu-stress.txt
Last active July 2, 2019 16:45
One line linux CPU stress (linux)
[start]
for i in 1 2 3 4; do while : ; do : ; done & done
[stop]
for i in 1 2 3 4; do kill %$i; done
@crafter999
crafter999 / certbot-generator.sh
Last active July 2, 2019 16:43
Certbot Generator (linux)
#!/bin/bash
# check for null arguments
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: ./certbox-generator mysite.com [email protected]"
exit 0
fi
domain="$1"
mail="$2"
@crafter999
crafter999 / meta-tags.md
Last active July 2, 2019 22:49 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
Index: src/polyfills.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/polyfills.ts (date 1530460613000)
+++ src/polyfills.ts (date 1530461121814)
@@ -78,3 +78,9 @@
/***************************************************************************************************
* APPLICATION IMPORTS
@crafter999
crafter999 / mysql-noTimeout.sh
Last active July 2, 2019 22:51
Disable mysql timeout after 8 hours (mysql)
#!/bin/bash
# Needed variables: host and username
if [ -z "$1" ] || [ -z "$2" ] ; then
echo "Usage: ./mysql-noTimeout.sh 127.0.0.1 myDatabaseUsername"
else
mysql -h "$1" -u "$2" -e '
SET wait_timeout=31536000;
SET interactive_timeout=31536000;
SET GLOBAL wait_timeout=31536000;
@crafter999
crafter999 / unzip.sh
Last active March 30, 2020 22:20
Unzipping popular archive files (linux)
#!/bin/bash
if [ -z "$1" ] ; then
echo "Usage: ./unzip.sh myfile.tar.gz"
echo -n "Supported Files: tar.gz, bz2 rar"
echo "gz, tar, tbz2, tgz, zip, Z, 7z"
else
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;