Skip to main content

Author: Anthony James Founder/CEO

Conditions in bash scripting (if statements)

Conditions in bash scripting (if statements)

If you use bash for scripting you will undoubtedly have to use conditions a lot, for example for an if ... then construct or a while loop. The syntax of these conditions can seem a bit daunting to learn and use. This tutorial aims to help the reader understanding conditions in bash, and provides a comprehensive list of the possibilities. A small amount of general shell knowledge is assumed. Difficulty: Basic - Medium

Read Post
How to clear Varnish cache for a url

How to clear Varnish cache for a url

Varnish made some changes in how you clear the cache in Varnish 3. Hence the confusing title. However, it's simple to clear the cache now, by using the "ban" command. [:$] varnishadm -T 127.0.0.1:6089 ban.url /index.html There are a few things you should be aware of. Varnish can run on different ports than 6089, so if you receive the following error:

Read Post
Grep Tutorial: Searching File Contents

Grep Tutorial: Searching File Contents

The grep command allows searching the contents of a file from the command line. It's a very useful tool to find a particular line in, say, a log file or a conf file. And because it's a command line program, you can combine it with other commands in various ways to produce powerful results. In this tutorial, you will learn both the basics and some more advanced applications of grep.

Read Post
VI Shortcuts & Commands For Newbies

VI Shortcuts & Commands For Newbies

This is a collection of some of the basic VI commands and shortcuts for newbies. You'll find yourself needing this if you are coding or scripting inside of the unix/linux command line using VI. Command Mode: Accepts commands, which are usually in the form of individual letters. Example, a and i. You can use h, j, k and I to navigate in similar ways as the up and down arrow. Not needed if you have an up and down arrow on your keyboard. Yank – Term used to copy files. Use YY to yank text. Navigate to the line you wish to yank and type yy make sure you are in command mode. 2yy will yank 2 lines, 4yy will yank 4 lines. Precede the YY command with the number of lines you would like to yank.

Read Post
Introduction: FLAC, the Free Lossless Audio Codec

Introduction: FLAC, the Free Lossless Audio Codec

This article tells about FLAC: what is it, why use it and how to use it? Note: in this article, you will encounter both FLAC and flac. The uppercase version is used to refer to the format, the lowercase version is used to refer to a flac file and the flac command. What is FLAC? As you might have guessed from the title of this article, FLAC is an abbreviation of Free Lossless Audio Codec. The first word ("free") should be pretty clear (it's an open-source project), but what is a "lossless audio codec"? Well, the well-known MP3 format is an audio codec. It is used to compress raw audio data. MP3 is a so-called "lossy" codec, meaning that, for example, if you would convert a wav file to an mp3, and then convert the mp3 file back to wav, you won't end up with the same audio data. MP3 reduces the quality of the audio while encoding. On the other hand, FLAC is "lossless". If you would convert a wav file to a flac, and then convert the flac file back to wav, you will end up with exactly the same wav file. Nevertheless, a flac file is a lot smaller than a wav file.

Read Post
Introduction: Using diff and patch

Introduction: Using diff and patch

The commands diff and patch form a powerful combination. They are widely used to get differences between original files and updated files in such a way that other people who only have the original files can turn them into the updated files with just a single patch file that contains only the differences. This tutorial explains the basics of how to use these great commands. Difficulty: Medium

Read Post
Previous 1 6 7 8 9 10 11 12 20 Next