Web commands

  • Download a web page an all its requisites:
    wget -r -p -nc -nH --level=1 http://pypi.python.org/simple/python-ldap/
    
  • Create a PNG image of a rendered html page:
    kwebdesktop 1024 768 capture.png http://slashdot.org/
    
  • Search in all files malformed HTML entities (in this case non-breakable spaces that doesn’t end with a semicolon):
    grep -RIi --extended-regexp '&nbsp[^;]' ./
    
  • Here is a one-liner I use to ping some pages on internet to force our corporate proxy to refresh its internal cache:
    for EGG in BeautifulSoup PIL Plone; do wget --server-response -O /dev/null http://pypi.python.org/simple/$EGG/; done
    
  • Create a minimal self-signed unencrypted SSL certificate without issuer information and a validity period of 10 years:
    openssl req -x509 -nodes -subj '/' -days 3650 -newkey rsa:2048 -keyout self-signed.pem -out self-signed.pem
    
  • Create a pair of SSL self-signed certificate and (unencrypted) private key (source):
    openssl genrsa -out private.key 2048
    openssl req -new -subj '/' -key private.key -out certreq.csr
    openssl x509 -req -days 3650 -in certreq.csr -signkey private.key -out self-signed.pem
    rm certreq.csr
    
  • View certificate details:
    openssl x509 -noout -text -in self-signed.pem
    

How-to Block Ads in Konqueror

Starting from version 3.5, Konqueror feature an ad blocker mechanism based on regular expressions. Here is a little how-to to help you install an efficient filter set.

  1. Dowload the latest Filterset.G regexp set. The file which contain all rules is located at http://www.pierceive.com/filtersetg/ under the name YYYY-MM-DD.txt.
  2. Go to Settings > Configure Konqueror... menu.
  3. Then go to AdBlock Filters panel (the one on the screenshot).
  4. Check both Enable filters and Hide filtered images options.
  5. Use the Import... button to load the “Filterset.G” file you previoulsy downloaded
  6. Enjoy ad-free web sites !

By the way, I hope to see the feature suggested by Andreas Frische to get some attention by the Konqueror community: it would be nice to have an integrated auto-updater of filter set in Konqueror (and make this how-to deprecated).

Konqueror config file: disable menu bar

To disable the menu bar in konqueror, you have a specific action in menus. If you want to do this by hand, just add the following directive in your ~/.kde/share/config/konquerorrc file:

[KonqMainWindow]
MenuBar=Disabled

This tip is interresting because you can also apply it for any KDE application that doesn’t support this feature.

For exemple, in kmail, you can add the “MenuBar=Disabled” statement in “[Main Window]” section: this will have the same effect as in konqueror.