How to mirror (statically) a website?

If you want to copy a website really really fast use HTTrack with following switches:

httrack -K --sockets=50 --disable-security-limits --max-rate=0

It works on Linux (there’s a native Debian package) and Windows.

Check documentation for other options. K is very important because it affects link generation. If you want original links without html extensions use it like above.

K option cheatsheet:

−K0foo.cgi?q=45 −> foo4B54.html?q=45 (relative URI, default)
−K−> (absolute URL) (−−keep−links[=N])
−K3−> /folder/foo.cgi?q=45 (absolute URI)
−K4−> foo.cgi?q=45 (original URL)
−K5−> (transparent proxy URL)

And last but not least…

If you want to rewrite original links to html static links use this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.html
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ /$1/$2/$3.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

Use psexec to troll your work colleagues

If you’re an admin in a windows environment you can troll your friends a little bit 🙂

Install psexec and use bellow command to run Rick Astley’s famous “sweet troll of mine” on a remote computer (background, no window!).

psexec64 -s /user:domain\user -i \\ "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app="" – stands for an ip number of a trolled person.

PS. Make sure you’re using psexec64 not psexec because it may not work on modern systems (tested on Windows 10).


If you’re a fan of Firefox (mainly because it’s an awesome tool for webdevelopment) like me. You should already know that there’s an additional console for developers (I’ve did not until five minutes ago). When you press Shift + F2 it shows little input bar on the bottom of the window. For example type the following command :

screenshot --clipboard --fullpage

Press Enter and BANG! Screenshot of a entire page in your MEMORY!

Mother of God… This is so awesome!

PS. Try different commands, you can use Tab for completion and help to list them all.

Quick optimization of jpeg files in a directory (Linux bash)

Firstly install jpegoptim.

You can do this on Debian like systems using apt:

sudo apt-get update && sudo apt-get install jpegoptim

Then go to directory with jpeg files and use this command:

find . -name '*.jpg' -exec jpegoptim -m70 -o -f --strip-all {} \;

It will find all jpg files recursively and optimize with following settings:

  • m70 stands for jpeg quality (about 70 – 80 should be fine but lossy)
  • o is for overwrite
  • f is for force
  • strip-all removes all EXIF and other textual data from files

How to find network device using it’s manufacturer name?

I’ve previously posted a note about finding Raspberry Pi without knowing it’s ip address. Well, basically it’s the same… Only you need to change MAC prefix to find other manufacturer. To wrap this is up, this is a command to find device by MAC prefix:

sudo nmap -sP | awk '/^Nmap/{ip=$NF}/00:D0:23/{print ip}'

And here you can find actual MAC information (use CTRL+F).

Of course you need Nmap to do that! And sudo is necessary!

Beware that sometimes there might be many prefixes for one manufacturer. Also check company name precisely, for example HP is Hewlett Packard but it also can be ProCurve Networking by HP.