Batch download using wget

To get a clean download, if you knows the file format you want, you can do this:

wget -nd -r -l1 --no-parent -A.mp3 -A.wma http://www.foo.com/mp3/

To explain briefly the options speficied;

  • -nd no directory, by default wget creates a dir
  • -r recursively download
  • -l1 (L one) level 1, download only of that particular folder, don’t go in depth on it.
  • –no-parent I definately don’t want the parent’s files
  • -A The -A option allows you to specify which types of accepted files should be downloaded. In this case, all files with the .wma and .mp3 file extension will be downloaded.
  • Block hotlinking images

    Using the .htaccess code below will essentially block the image from being server and pull an image an existing image located on imgurl or some other image hosting site.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?g33kinfo\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://imgur.com/tSEqO [L]

    Graylog2

    From graylog2.org

    Graylog2 is an open source log management solution that stores your logs in MongoDB. It consists of a server written in Java that accepts your syslog messages via TCP, UDP or AMQP and stores it in the database. The second part is a web interface that allows you to manage the log messages from your web browser. Take a look at the screenshots or the latest release info page to get a feeling of what you can do with Graylog2.

    The web interface
    All data sent to Graylog2 will appear in the web interface. Use the web interface to search and filter your data. A core part of the web interface are streams: They basically are saved searches that allow you to quickly access an overview that is already pre-filtered to match for example specific parts of your application. You can also run monitoring and alerting on single streams or directly forward all messages that are matched into a stream to other endpoints.

    How do I send my log data?
    The Graylog2 server accepts standard syslog via TCP/UDP and GELF via UDP. You can also send in both formats via AMQP (AMQP Docs). You can configure your syslog daemons to send their data to Graylog2 or log directly from within your applications. Continue reading “Graylog2”

    CSF Messenger

    CSF Messenger offers a TEXT and HTML page to be displayed when a person is blocked in the firewall as well as an image to be displayed. Those can be found at /etc/csf/messenger and can be changed, but CSF will need to be restarted when changed.

  • Upgrade CSF in the server to the latest version from your WHM if available.
  • In command line or WHM CSF plug-in open /etc/csf/csf.conf
  • Search for “MESSENGER” and change it to MESSENGER = “1”
  • In command line add a user using the command useradd csf -s /bin/false
  • Restart CSF and lfd.
  • Confirm this is working by having someone give their IP, block them, restart the CSF and have them go to a page on the server.
  • Files to edit are located here;
    /etc/csf/messenger/index.html
    /etc/csf/messenger/index.text

    README documentation is here: http://www.configserver.com/free/csf/readme.txt

    What’s an inode?

    From linux-mag.com

    In the electronic pages of Linux Magazine, file systems are commonly discussed. It’s a fact! In these discussions you might see the term “inode” used in reference to a file system. Fairly often people ask the question, “what is an inode?” so that they can understand the discussion (remember, there is no such thing as a bad question – at least for the most part).

    To many people who read these storage articles this might seem like an elementary question but for many people just starting in Linux this concept may not be understood. Plus it’s always good to review the concept but let’s keep any comments civil and constructive (especially if they are directed at the author). Let me also state that I’m not a file system expert so please correct any misstatements but also please give references so people reading the comments can explore the topic.

    File systems in general have two parts:

    (1) the metadata or the “data” about the data, and

    (2) the data itself. The first part, the metadata, may sound funny because it’s data about the data, but this is a very key component to file systems. It consists of information about the data. More precisely it includes information such as the name of the file, the date the file was modified, file owner, file permissions, etc. This type of information is key to a file system otherwise we just have a bunch of bits on the storage media that don’t mean much. Inodes store this metadata information and typically they also store information about where the data is located on the storage media. Continue reading “What’s an inode?”