Skip to content

Instantly share code, notes, and snippets.

View coldfix's full-sized avatar
:octocat:
Wrrrao!

Thomas G. coldfix

:octocat:
Wrrrao!
View GitHub Profile
@coldfix
coldfix / ZSH.md
Created October 20, 2021 10:31 — forked from YumaInaura/ZSH.md
Zsh — print command examples ( with help document )

Zsh — print command examples ( with help document )

print is zsh law layer command.

For example it probably build zle command behaviour.

If you master it you will get so beautifule zsh style.

Examples

Recovering deleted files in Ubuntu with ext4 filesystem

Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.

Important

  • this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
  • if something is not clear, you need more information, etc. check the sources below

With that out the way, let's begin.

#!/bin/ash
#ash shell for openwrt, it also works with bash
#curl -s 192.168.44.1/logout
rURL=`curl -s -I "http://192.168.44.1" | grep "Location:" | cut -d : -f 2- | cut -c 2-`
if echo $rURL | grep -q "res=notyet"; then
echo "notyet"
challenge=`echo $rURL | cut -d '&' -f 4 | cut -d= -f2`
echo "challenge=$challenge"
@coldfix
coldfix / msys2.reg
Last active August 29, 2024 02:58 — forked from magthe/msys2.reg
MSYS2 "Open Here" registry settings
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\mingw32]
@="MinGW &32 Bash Here"
"Icon"="\"C:\\msys64\\mingw32.exe\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\mingw64]
@="MinGW &64 Bash Here"
"Icon"="\"C:\\msys64\\mingw64.exe\""