Skip to content

Instantly share code, notes, and snippets.

View Molter's full-sized avatar

Gabriel Molter Molter

View GitHub Profile
@Molter
Molter / iterateOverCFOrgsSpaces.sh
Created June 19, 2023 18:14 — forked from brianoflan/iterateOverCFOrgsSpaces.sh
How to iterate over all orgs and spaces on a Cloud Foundry endpoint (cf, cf routes, cf orgs, cf spaces, CloudFoundry)
#!/bin/bash
timeout=gtimeout
action() {
echo "cf_routes $1 $2" 1>&2 ;
local x=`cf_routes $1 $2 | egrep -v '^( *$|space *|name *|Getting routes|FAILED|No space targeted|No routes found)' | egrep '.' | perl -ne 'print " $_"'` ;
[[ -z $x ]] || echo -e " Found it:\n$x." ;
echo "" 1>&2 ;
}
main() {
@Molter
Molter / wsl.md
Created May 3, 2022 13:06 — forked from alyleite/wsl.md
Failed to connect to bus: Host is down - WSL 2

» sudo systemctl daemon-reload

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

just try:

sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig

sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target

@Molter
Molter / molter.omp.json
Last active April 29, 2022 02:41
Oh-My-Posh theme - forked from unicorn.omp.json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#003543",
"foreground": "#fff",
"powerline_symbol": "\ue0b0",
@Molter
Molter / MakePowerShellRememberSSHPassphrase.md
Last active May 3, 2022 04:46 — forked from danieldogeanu/MakePowerShellRememberSSHPassphrase.md
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
@Molter
Molter / ohmyposhv3-v2.json
Created April 13, 2022 16:43 — forked from shanselman/ohmyposhv3-v2.json
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@Molter
Molter / profile.ps1
Last active April 29, 2022 02:45
Powershell profile
if ($host.Name -eq 'ConsoleHost')
{
Import-Module -Name Terminal-Icons
#Invoke-WebRequest -Uri https://gist.githubusercontent.com/Molter/107328f90968f2634b0a2f2c8dff3ea9/raw/87d6e24bfec03c81cc90ae6605c9d73d63cfaffa/molter.omp.json -OutFile $env:POSH_THEMES_PATH\molter.omp.json
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\molter.omp.json" | Invoke-Expression
}
New-Alias which get-command
@Molter
Molter / material.module.ts
Created March 8, 2020 16:20
Angular Material Imports in a specific module
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatInputModule } from '@angular/material/input';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatRadioModule } from '@angular/material/radio';
import { MatCardModule } from '@angular/material/card';
import { LayoutModule } from '@angular/cdk/layout';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatSidenavModule } from '@angular/material/sidenav';