Skip to content

Instantly share code, notes, and snippets.

View edwin's full-sized avatar
🦕
We all have a dinosaur deep within us just trying to get out.

Muhammad Edwin edwin

🦕
We all have a dinosaur deep within us just trying to get out.
View GitHub Profile
@edwin
edwin / readme.md
Created April 14, 2022 06:33
Clean and Resize Docker in Windows 10

my Win10 instance have like 30GBs of file occupied by Docker Images, this is how i clean them.

First, remove the whole images docker system prune -a --filter label!=do-not-remove

Then stop Docker, and run below command from PowerShell (dont forget to run this as Administrator)

  • Mount-VHD -Path "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx" -ReadOnly
  • Optimize-VHD -Path "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx" -Mode Full
  • Dismount-VHD -Path "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx
FROM registry.access.redhat.com/ubi8/go-toolset
ENV GOPATH=$APP_ROOT
ENV GOBIN=$APP_ROOT/bin
ADD . $GOPATH/src/hello/
RUN go install hello
FROM registry.access.redhat.com/ubi8/ubi-minimal
COPY --from=0 /opt/app-root/bin/hello /usr/local/bin/hello
CMD hello
EXPOSE 8080
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", handle)
http.ListenAndServe(":8080", nil)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat.edw</groupId>
<artifactId>HelloWorldFabric8</artifactId>
<version>1.0</version>
package com.redhat.edwin.utility;
import com.redhat.edwin.annotation.Decrypt;
import com.redhat.edwin.annotation.Encrypt;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.reflect.MethodSignature;
package com.redhat.edwin.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <pre>
* com.redhat.edwin.annotation.Decrypt
package com.redhat.edwin.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <pre>
* com.redhat.edwin.annotation.Encrypt
package com.redhat.edwin.repository;
import com.redhat.edwin.model.UserProfile;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* <pre>
* com.redhat.edwin.repository.UserProfileRepository
* </pre>
*
package com.redhat.edwin.model;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* com.redhat.edwin.model.UserProfile
* </pre>
package com.redhat.edwin.controller;
import com.redhat.edwin.annotation.Decrypt;
import com.redhat.edwin.annotation.Encrypt;
import com.redhat.edwin.model.UserProfile;
import com.redhat.edwin.repository.UserProfileRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;