Skip to content

Instantly share code, notes, and snippets.

@thinsoldier
thinsoldier / unrar to a directory
Created Feb 15, 2022
linux bash How do you unrar to a directory with the same name as the archive.
View unrar to a directory
for i in *.rar; do mkdir "${i%%.rar}"; unrar x -r "$i" "${i%%.rar}"; done
@thinsoldier
thinsoldier / gist:5615c7a208dea94c271f2dca0a277162
Created Jan 15, 2022
reset-the-password-in-ubuntu-linux-bash-in-windows
View gist:5615c7a208dea94c271f2dca0a277162
https://askubuntu.com/questions/772050/reset-the-password-in-ubuntu-linux-bash-in-windows
Close Bash on Ubuntu if it is running (or the next command will fail).
In Windows admin command prompt (Super+X, A) change the default user to root:
ubuntu config --default-user root
If you are using Ubuntu 18.04 in WSL, the command has changed to ubuntu1804 , so
@thinsoldier
thinsoldier / gist:12d8fdcbdf4a344bd6002d858fb37ee7
Created Jan 14, 2022
Windows Powershell Extract zip files to the same location with same folder name (removed .zip)
View gist:12d8fdcbdf4a344bd6002d858fb37ee7
https://social.technet.microsoft.com/Forums/en-US/ee897671-fa3a-4e06-8cb6-0986900c032e/powershell-function-unzip-all-files-in-a-folder?forum=winserverpowershell
user rex02
#Extract zip files to the same location with same folder name (removed .zip)
gci -Recurse -Filter *.zip |ForEach-Object {$n=($_.Fullname.trimend('.zip')); Expand-Archive -Path $_.Fullname -DestinationPath $n -Force}
View gist:7dcd129e31ff46553f734f4bcd1e7148
for x in ls *.webp; do ffmpeg -i "$x" "${x%.webp}.jpg"; done
@thinsoldier
thinsoldier / index.html
Last active Nov 29, 2018
jere - css grid demo
View index.html
<div class="container-1">
<div class="box big-box" style="background-image:url(https://tech-ranking.a2hosted.com/wp-content/uploads/2018/11/Minecraft-Pillager-Outpost.jpg);">
<h2>Minecraft 1.14: Pillager Outpost seed</h2>
</div>
<div class="box" style="background-image:url(https://tech-ranking.a2hosted.com/wp-content/uploads/2018/10/Minecraft-Bamboo-Jungle-1.jpg);">
<h2>Minecraft 1.14 Bamboo Jungle Seed – The first ever bamboo forest seed for 1.14!</h2></div>
<div class="box" style="background-image:url(https://tech-ranking.a2hosted.com/wp-content/uploads/2018/09/Minecraft-1.13-Shaders-Comparison.jpg);">
<h2>Best shaders for Minecraft 1.13 Java (2018)</h2></div>
<div class="box" style="background-image:url(https://tech-ranking.a2hosted.com/wp-content/uploads/2018/09/Dimmer-Android-screen-than-minimum.jpg);">
<h2>How to make your Android screen dimmer or darker than minimum</h2></div>
@thinsoldier
thinsoldier / index.html
Last active Nov 29, 2018
jere - flexbox demo
View index.html
<div class="container-1">
<div class="box big-box" style="background-image:url(https://tech-ranking.a2hosted.com/wp-content/uploads/2018/11/Minecraft-Pillager-Outpost.jpg);">
<h2>Minecraft 1.14: Pillager Outpost seed</h2>
</div>
<div class="container-2">
<div class="section">
<div class="box" style="background-image:url(https://tech-ranking.a2hosted.com/wp-content/uploads/2018/10/Minecraft-Bamboo-Jungle-1.jpg);">
<h2>Minecraft 1.14 Bamboo Jungle Seed – The first ever bamboo forest seed for 1.14!</h2></div>
<div class="box" style="background-image:url(https://tech-ranking.a2hosted.com/wp-content/uploads/2018/09/Minecraft-1.13-Shaders-Comparison.jpg);">
<h2>Best shaders for Minecraft 1.13 Java (2018)</h2></div>
@thinsoldier
thinsoldier / gist:bf3b364c59d154af59a1ab17a0c716a8
Created Sep 8, 2018
dev.bahamasrealty.com quicksearch layout css grid idea
View gist:bf3b364c59d154af59a1ab17a0c716a8
@supports( display: grid)
{
#quicksearch form {
display: grid;
grid-template-columns: repeat(auto-fill,minmax(160px,1fr));
grid-gap: .5em;
min-height: 208px;
justify-content: center;
}
View gallery.php