<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Posts on Robert Rumpf</title>
        <link>/posts/</link>
        <description>Recent content in Posts on Robert Rumpf</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Wed, 23 Jun 2021 21:21:00 +0200</lastBuildDate>
        <atom:link href="/posts/index.xml" rel="self" type="application/rss+xml" />
        
        <item>
            <title>escalate UAC in Powershell with sudo</title>
            <link>/posts/2021/06/escalate-uac-in-powershell-with-sudo/</link>
            <pubDate>Wed, 23 Jun 2021 21:21:00 +0200</pubDate>
            
            <guid>/posts/2021/06/escalate-uac-in-powershell-with-sudo/</guid>
            <description>For a while now, I have been working professionally with Intune software deployment. I often have to test various scripts for customers. These often require admin rights. Since I&amp;rsquo;m tired of starting the Powershell as admin every time, I started looking for a way around the problem. I found something on Github.
https://github.com/gerardog/gsudo
(G)sudo
&amp;hellip;is probably known from the Linux universe and that&amp;rsquo;s exactly how it works. Just type sudo or gsudo in front of the command that needs extended privileges and an admin prompt appears without having to open a new shell.</description>
            <content type="html"><![CDATA[<p>For a while now, I have been working professionally with Intune software deployment. I often have to test various scripts for customers. These often require admin rights. Since I&rsquo;m tired of starting the Powershell as admin every time, I started looking for a way around the problem. I found something on Github.</p>
<p><a href="https://github.com/gerardog/gsudo">https://github.com/gerardog/gsudo</a></p>
<p><strong>(G)sudo</strong></p>
<p>&hellip;is probably known from the Linux universe and that&rsquo;s exactly how it works. Just type sudo or gsudo in front of the command that needs extended privileges and an admin prompt appears without having to open a new shell.</p>
<p>The whole thing can be installed with Powershell (as admin ;-))</p>
<pre><code>PowerShell -Command &quot;Set-ExecutionPolicy RemoteSigned -scope Process; iwr -useb https://raw.githubusercontent.com/gerardog/gsudo/master/installgsudo.ps1 | iex&quot;
</code></pre>]]></content>
        </item>
        
        <item>
            <title>Improve WSL2 ressource management for windows</title>
            <link>/posts/2021/06/improve-wsl2-ressource-management-for-windows/</link>
            <pubDate>Wed, 23 Jun 2021 19:22:47 +0200</pubDate>
            
            <guid>/posts/2021/06/improve-wsl2-ressource-management-for-windows/</guid>
            <description>Shutdown your running wsl.
wsl --shutdown Going to c:\users*your your profile name* and creating a .wslconfig file or do it via powershell ;-)
notepad &amp;quot;$env:USERPROFILE/.wslconfig&amp;quot; [wsl2] memory=4GB # Limits VM memory in WSL 2 to 4 GB processors=5 # Makes the WSL 2 VM use two virtual processors swap=0 localhostForwarding=true After that start Powershell with admin permissions, restart WSL2 by typing:
Restart-Service LxssManager  Drop Cache variable for WSL
create this alias at the end of your ~/.</description>
            <content type="html"><![CDATA[<p>Shutdown your running wsl.</p>
<pre><code>wsl --shutdown
</code></pre><p>Going to c:\users*your your profile name* and creating a .wslconfig file or do it via powershell ;-)</p>
<pre><code>notepad &quot;$env:USERPROFILE/.wslconfig&quot;
</code></pre><pre><code>[wsl2]
memory=4GB # Limits VM memory in WSL 2 to 4 GB
processors=5 # Makes the WSL 2 VM use two virtual processors
swap=0
localhostForwarding=true
</code></pre><p>After that start Powershell with admin permissions, restart WSL2 by typing:</p>
<pre><code>Restart-Service LxssManager
</code></pre><hr>
<p><strong>Drop Cache variable for WSL</strong></p>
<p>create this alias at the end of your ~/.bashrc file</p>
<pre><code>alias drop_cache=&quot;sudo sh -c \&quot;echo 3 &gt;'/proc/sys/vm/drop_caches' &amp;&amp; swapoff -a &amp;&amp; swapon -a &amp;&amp; printf '\n%s\n' 'Ram-cache and Swap Cleared'\&quot;&quot;
</code></pre><p>and run the following in your shell to setup the alias</p>
<pre><code>source ~/.bashrc
</code></pre><p>then you can run the drop_cache command when you need it.</p>
<p>You can run it manually when you notice high memory usage or you can try to create a crontab job.</p>
]]></content>
        </item>
        
    </channel>
</rss>
