Mastering the skill most used
If you are reading this, chances are, you browse the Internet.
That's great; the Internet is fantastic! But it is also so vast… The Internet contains almost the entirety of human knowledge, serves as a medium for communication across the planet, has some pretty neat cat pictures. (Most importantly, of course.)
But with the internet being so massive, the way we usually seek out information can be described as inefficient at best–and painful at worst.
I'm going to try to fix that with a few tips that will let you just rocket through the web. The neat part about them, is that they are all pretty simple to pick up.
Okay! On to the first tip:
Keyword searches are absolutely incredible. If there was only one thing that you take away from this blog, I would be happy if it was keyword searching.
It is built into most browsers, and can quadruple the speed that you get things done (At its worst).
Yeah, yeah, that's nice. What are they?
Keyword searches are a way to quickly add something to a saved URL… That probably sounds a bit underwhelming after I hyped it so much last section, right? Hell–when put that way, it sounds practically useless, but that couldn't be farther from the truth.
Whenever you visit a page that does something (For example, Google, which searches the internet), more often than not, anything you type into the page gets shoved into the URL of the page.
This is because the URL is often used to pass things called "parameters" to the server of that site, and this is the information servers use to perform their respective actions.
So what, right?
Well, with keywords, you can put whatever you want into these "parameters". That means you can control how servers act at a whim.
For example, Wikipedia has a text box to search for an article, so if I add a keyword for "
w" on the search field, I can do something not dissimilar to the following:
I typed "
w firefox" into the URL bar, hit
[Enter], and was instantly brought to Firefox's Wikipedia article. That is much faster than Googling "
firefox wiki" and clicking the link.
The good news is that a lot of these keywords don't require manual creation, you can often create them by right clicking a search field and clicking "Add search" (Or whatever your browser says) and picking a keyword. You can activate this keyword by typing it into your address bar and hitting
[Space]. Anything after that will be passed into the keyword when you hit
You get used to using keywords like this very quickly…
w Emacs, etc…
You can probably see how this speeds up browsing, but searching isn't the only thing a server can do, oh no. Servers can do all sorts of absolutely gnarly things, and with the right set of keywords, you can control them with mere movements.
If bookmarks can be seen as a way of saving a page for later, keywords can be seen as a way for saving functionality for later.
We're just scratching the surface here.
How they work
At a basic level, keywords are bookmarks that have a "
%s" in their address, and are assigned a word or letter. When you type this word followed by some text, the "
%s" gets replaced with whatever you typed.
This can be used with any URL that has some form of pattern, or accepts some form of information. For example, 4chan, an image board, is split into a number of individual boards that are organized in a pattern like this:
Board Topic URL g Technology
Notice the pattern for those URLs?
They all begin with the same thing. (
That means, if we create a search with the URL "
https://boards.4chan.org/%s" and the keyword "
4c", we can visit any board by typing "
4c <boardname>" into the address bar:
Suddenly, you can visit any board almost instantly.
Of course, not all sites have such exploitable patterns. But guess what? They don't actually need to!
Remember how, when you type text into some pages, it will get shoved into the URL bar? Keywords can do something useful here too!
With that in mind, here are a few examples of keywords that I sometimes use:
Keyword URL Use y
Looks up a YouTube User wa
Ask a complex AI something gd
Temporary E-Mail maps
Look up address ud
Dictionary for acronyms and slang gt
Translates a word from any language
See how the URL for each of these will change when the
%sgets replaced? It may not be in some obvious URL pattern like 4chan, but the fact that the text we type shows up in a predictable place when we visit certain pages makes these URLs very, uh, "keywordable".
Now, this is where things start to get really, really cool. There are some pretty sweet servers out there that work with URLs. That means you can make keywords that can accept URLs!
Why would you want this? Because it lets you do weird and wacky things with anything you can find on the Internet! See an image you like? Reverse search it! See a page in German? Translate it! Find a page that ceased to exist? Look at what it looked like before it died!
For example, here is me using a URL keyword to reverse search an image:
In this example, I used a site called SauceNAO to "reverse search" an image I liked to find the artist.
It may look fancy, but it's still nothing more than URL substitution… You can make these quite easily yourself if you notice a site does something useful if you give it a URL to chew on.
For example, a site called "Reddit" has duplicate detection for submitting links. When it detects a duplicate, it redirects you to the place it was last posted.
Reddit is a pretty gigantic site where people post URLs and discuss them, so creating a keyword for Reddit like this can be a good way to get more information about news, images, or anything that has been submitted to it.
Some other keywords I have set up that accept URLs are:
Keyword URL Use gc
Looking up dead pages a
Looking up old versions of pages gir
Find image sources bmn
Get temporary logins for sites gd
Open document files in your browser gl
Finds pages that links to the current one gt
Translates the page at a URL
Putting a URL in a keyword probably sounds cumbersome, huh? Good news is that there are motions that make it (And any other keyword usage) ridiculously fast.
Even though clicking the address bar and typing a keyword is much more efficient than going through Google, it is still a much slower process than it could be… If we use the keyboard, we can actually cut the time it takes to use a keyword into less than half of what it would take normally.
Now that might not seem like a lot of time–until you are used to using keywords almost instantly…
The two most basic shortcuts for using keywords are
[Ctrl] + [L]and
[Ctrl] + [T], the first one highlights the address bar, and the second opens a new tab and highlights the address bar. The important part about these shortcuts are that they highlight the entire address in the address bar. Give them a try!
When the entire address is highlighted, typing anything replaces the contents of the bar, so you can type a keyword search without needing to worry about deleting what's there. That means that instead of clicking the address bar, highlighting it, backspacing it, then typing a keyword, you can just hit
[Ctrl] + [L]or
[Ctrl] + [T]and do the same thing instantly.
I generally use
[Ctrl] + [L]when I don't care about the current page, or I'm going to use a URL keyword on the current page's URL.
[Ctrl] + [T]on the other hand, I use for looking up something in a way that I don't lose my spot, because hitting
[Ctrl] + [W]will bring me back to where I started before I hit
[Ctrl] + [T].
If you want to use a URL keyword on the current page, hit
[Left]before typing the keyword, and hit
[Left]deselects the URL so you don't replace it, and the
[Space]separates the URL from the keyword. So, looking up an old version of the page you are on might have the following steps:
[Ctrl] + [L].
- Type "
a". (For Archive.org)
That might look a little intimidating, but I can guarantee that it becomes second nature (And incredibly fast) if you practice a little bit.
Building your own
So, I might have given you a few neat keywords, and you might know how to make them for sites with reasonably obvious patterns, but what about those more complex cases? Sometimes the autodetection of search fields fails you, and sometimes what you type doesn't get shoved into the URL. What do you do then?
You can use the web inspector to figure this out more often than not…
For example, what happens if our usual methods don't work for Google?
The first step is to inspect the field we want to turn into a search! We can do that by right clicking the search field and clicking "Inspect Element" (Or similar)
You should see something similar to the following:
This is an HTML "
input" element, it generally has a "
name"–that is what we want to look for.
In this example, we can see the name here:
Take note of that somewhere, because when you put text into this text field, the name of the parameter is this name.
That means if this field were called "hargleblargle" or something, and you typed "
words" into it, the resulting "query string" would look something like "
hargleblargle=words"… Nothing too scary, right? Just the name, an equals sign, and what is inside of the field.
Next step is to find the
inputis a part of… We can do that from the breadcrumb at the top of the inspector:
Keep looking from right to left until you find something that says "
form". (In my case here, I had to scroll a bit to the left)
After locating the form, you can click it to highlight the element.
form, the value we are looking for is the "
action", which we can see here:
This is the place the parameter will be sent to.
If this value starts with anything other than a slash, we just replace everything from the first "
?" to the end with the action, but in this case, since it starts with "
/" we want to replace everything to the root of the server with the action. That means we delete the stuff highlighted below:
And we can replace it with the action, a "
?", and then our parameter.
And then test it!
Since this works, we can just replace our query with a "
%s" and assign it to a keyword. In this case, our URL would be
And that's that!
It is kinda tricky to start out with, and it won't work 100% of the time, (Since some keywords can only be sent with
POST) but it becomes easier with practice.
With enough practice, eventually your keyword list could become a language you use to masterfully navigate your browser to the farthest reaches of the web!
Now that you can make your own searches, you can get a little creative with your default search. Since your default search is no longer something you will always need to rely on, you can bless it with some intelligent functionality.
I personally like to set it to Google's "I'm feeling lucky" button, since that means typing something into the bar on its own can skip the middleman and go to the most relevant result.
Default searches are good for more than just typing too… They work with dragging and dropping too!
That means you can pick any single search you've made, and give it the ability to work with anything you drag onto the tab bar!
This works as a super-fast way to do a
[Ctrl] + [T]keyword search and switch to it.
Hopefully that didn't melt your brains too much… Browser searches are a powerful tool, and the ability to use them effectively is a way you can browse the Internet in ways that the uninitiated could only describe as "wizardry".
Browser searches aren't only convenient, they can genuinely help you accomplish more! Being able to browse the Internet fast means that you can access information faster, research. If you can research faster, you can find relevant information faster, solve problems faster, and learn faster. That is a boon not to be taken lightly.
Hopefully I helped you find out just how useful a well set-up browser can be.
Now, go make some searches!Archenoth, 2015
Can you figure it out?
There is something wrong with this image: Original image courtesy of ねっつー on Pixiv.
Can you tell me what's wrong though? Go ahead, download it, inspect it, try to figure it out.
Give up yet?
Let me tell you what's wrong with it. It isn't just a PNG file, it's a ZIP archive too. Or rather, there is a ZIP file hidden inside of it, and some compression programs can understand it. No, really! Try to open it with 7-Zip or some similar program. You can really open it!
About now, I imagine you are thinking "What is this wizardry?" or "How can that even work?"... It's actually really quite simple. PNG is a format can ignore garbage at the end of a file, and ZIP programs can often ignore garbage at the beginning of ZIP archives. Why is this true? It's all in the formats.
PNG files contain image data, followed by an "End of image" token, a small string of characters that tells any program reading the PNG file that it is finished reading all that it should be interested in. ZIP files on the other hand, have a token at the beginning of their format. So, if we were to put a ZIP file at the end of a PNG file, we can assume that any program that understands to look beyond the beginning of the file for a ZIP archive can find any hidden archive no problem inside of a PNG without affecting the image.
Pretty nifty, huh?
Now that I've described what's happening in abstract, lets take a closer look at this Pichu Faux Pas by opening the file in Emacs...
As you can see at the bottom, I can look at this image as text by hitting "C-c C-c" (Or Ctrl + C, Ctrl + C for you non-Emacs folks.) That gives you a textual view of the binary data like you would expect:
According to Wikipedia, the header of a PNG file is as follows:
Bytes Purpose 89 Has the high bit set to detect transmission systems that do not support 8 bit data and to reduce the chance that a text file is mistakenly interpreted as a PNG, or vice versa. 50 4E 47 In ASCII, the letters PNG, allowing a person to identify the format easily if it is viewed in a text editor. 0D 0A A DOS-style line ending (CRLF) to detect DOS-Unix line ending conversion of the data. 1A A byte that stops display of the file under DOS when the command type has been used—the end-of-file character 0A A Unix-style line ending (LF) to detect Unix-DOS line ending conversion.
Now you can clearly see the "
\211PNG" followed by a DOS-style line-ending... But this mode isn't terribly good at looking at binary data, so switching over to hexl-mode we see the following:
Now we can follow along with the format easily, I highlighted the "
89" to show that the "
\211" that we saw earlier is the character described by the Wikipedia table. You can even follow along the file with the header description. We see the "
89" to start out with, followed by the "
50 4E 47", which corresponds to the "
PNG" text on the right of the hexl-mode window. You can continue doing this for the entire header... But why is this important?
Well, as it turns out, a little lower on the PNG Wikipedia article, it describes "Critical Chunks", things like the palette, dimenstions, bit depth, and most importantly, the image end. Below is a table of the critical chunks from Wikipedia.
must be the first chunk; it contains the image's width, height, and bit depth.
contains the palette; list of colors.
contains the image, which may be split among mtabletiple IDAT chunks. Such splitting increases filesize slightly, but makes it possible to generate a PNG in a streaming manner. The IDAT chunk contains the actual image data, which is the output stream of the compression algorithm.
marks the image end.
There is a string in every PNG file to tell the program to stop reading the image file, and that string is "
IEND". So, if we search for this string, we should have the end of the file, right?
One thing Wikipedia doesn't mention is that there are actually four bytes following the "
IEND" before a PNG file ends. Those bytes are the "
ae42 6082" bytes you see right after the "
But wait! Something's amiss here. Do you see it? There is more to the file after the PNG supposedly ended. Lets first isolate that data into another file so we can work with it.
That header looks familiar, but lucky for us, we don't need to memorize arbitrary header values when we have commands like "
file" at our disposal. Lets see if it can tell us what kind of data we are working with...
Turns out, this is a ZIP file... The header for a ZIP file according to PKWare (The guys who made PKZIP) is "
PK" (Section 4.2.1). It all seems to check out. So lets save it as a zip file.
And open it...
What's this now?
Looks like we have a text file! Yes, a text file with text we could totally see in hexl-mode... But that's not the point.
The point is that we managed to utilize the specification for two different file formats to sneak one file into the other without damaging the original. You can mix lots of formats and get this result. Windows
.exefiles commonly have ZIP data inside of them. (Installers in particular utilize this one.) The result is that you have a valid executable that you can open in 7-Zip.
Now that you know about this spifftacular little hack, you are likely wondering how you can do it yourself. Good news! It's dead simple to mix different file formats if one can be placed right after the other like PNG and ZIP. You can do it on any platform too! You just need to know how to open a terminal or the Windows Command Prompt and use "
cat" or "
On Linux and Mac OSX, you can open a terminal and just put two files into the same file, one after the other with "
cat"... You can do this by typing:
cat image.png zipfile.zip > hax0rus.png
Windows has a slightly different method:
copy image.png + zipfile.zip hax0rus.png
Of course you'll need to replace the .png and .zip filenames with the files you wanna mix.
By the way, you aren't limited to only putting one file after another. If you want to, you could possibly make valid files of a certain type with files in the middle of another. This technique is used more commonly than a lot of people think, so go ahead... Dig around files, look at specifications, and let your imagination wander with possible combinations.Archenoth, 2013