Skip to content

Instantly share code, notes, and snippets.

View glekner's full-sized avatar

Gilad Lekner glekner

  • Wiz
  • Tel Aviv
View GitHub Profile
# Start SSH Service.
wsl sudo service ssh start
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
$taskName = "WSL2_PORTS"
$task = Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
if ($null -ne $task) {
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false
}
# TODO: Enter Path to script, change delay if you will.
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-File "C:\Path\To\Script.ps1"'
$trigger = New-ScheduledTaskTrigger -AtStartup -RandomDelay 00:00:30
$settings = New-ScheduledTaskSettingsSet -Compatibility Win8
@glekner
glekner / testing-prs.md
Last active March 19, 2020 13:01
Testing Pull Requests

Testing Pull Requests Easily!

IMPORTANT! First connect to the Red Hat VPN before the following steps.

  1. Open the Console!
  2. Open a Terminal
  3. Login to our VM - ssh tlv-cnv@tlv-cnv-gilad.usersys.redhat.com (Password is in coreos slack)
  4. Navigate to the Console directory - cd coding/matthewcarleton/console
  5. Lets update the pull requests list - git fetch upstream
  6. Fetch a Pull request - git fetch upstream pull/ID/head:BRANCHNAME
@glekner
glekner / crc-cnv.md
Last active December 7, 2020 11:57
Local Openshift Console + CNV with CodeReady Containers

Openshift Console + CNV | CodeReady Containers

Motive

Running Openshift Console locally with CodeReady Containers is really nice and fast! It is very useful for developers/designers looking to test and create new components.

Prerequisites

  1. Openshift Console - Theres a good chance you already have it! :)
  2. Red Hat Account, Sudo rights
@glekner
glekner / cnv-native.md
Last active January 28, 2020 12:15
OKD + CNV w/Native K8s

Openshift Console + CNV w/Native K8s

Motive

Running Openshift Console along side a native local K8s is really nice and fast! Very useful for developers looking to test and create new components, and for users looking to take advantage of the console UI with their own cluster. There are a couple things that are missing: Metrics and Templates (Kubernetes doesn't support Templates kind, and there is no Prometheus)

Prerequisites

  1. A local K8s cluster (Minikube, Docker Desktop etc..)
  2. Openshift Console
@glekner
glekner / Foreman HTTP2 Dev.md
Last active January 5, 2019 14:44
Foreman HTTP/2 Dev

Steps

  1. Add --early-hints to Puma, and --https to webpack-dev-server to .env e.g.
RAILS_STARTUP="puma -w 5 -p $PORT --preload --early-hints"
WEBPACK_OPTS="--https"
@glekner
glekner / Pagination.js
Last active November 8, 2018 14:15
Pagination
import React from 'react';
import Proptypes from 'prop-types';
import { isEmpty } from 'lodash';
import { Paginator } from 'patternfly-react';
import {
getURI,
getURIpage,
getURIperPage,
changeQuery,
translatePagination,

Rebase Fork

Add Upstream

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git

Fetch Upstream

git fetch upstream

Check out to local Master

git checkout master