Is it possible to send custom HTML messages to users when they first start a
session through a squid proxy server?
I want to be able to redirect a users first request to the "message of the
Day".... then the rest of their browsing requests for the remainder of the
session go without being redirected.....
Detailed Steps:
User o...
I'm trying to programatically create beautiful thumbnail images of a large number of web pages that are hosted on my own ruby/rails-based website.
I want to be able to code a stand-alone bit of ruby that looks something like this:
require 'awesome-screenshot-maker'
items.each do |id|
url = "http://foo.com/bar/#{id}"
shooter = Awes...
There is a plethora of questions where people talk about common tricks, notably "Vim+ctags tips and tricks".
However, I don't refer to commonly used shortcuts that someone new to Vim would find cool. I am talking about a seasoned Unix user (be she/he a developer, administrator, both, etc.), who thinks (s)he knows something 99% of us ne...
I was reading this article today on two different regular expression algorithms.
According to the article old Unix tools like ed, sed, grep, egrep, awk, and lex, all use what's called the Thompson NFA algorithm in their regular expresssions...
However newer tools like Java, Perl, PHP, and Python all use a different algorithm for thei...
Update2:
Thanks for the input. I have implemented the algorithm and it is available for download at SourceForge. It is my first open source project so be merciful.
Update:
I am not sure I was clear enough or everyone responding to this understands how shells consume #! type of input. A great book to look at is Advanced Unix Program...
Existing Server = BIND version 9.1.3
new Server = BIND version 9.3.4
How can i move all zones records to new server? I tried moving them by coping the files and changing configuration file on new to match and it didn't work.
Is there an smooth way to just transfer all zones to this new server?
...
Amazon's official tools for interacting with EC2 are kind of clunky and a pain to deal with. I have to set up a bunch of environment variables, store separate private keys just for EC2, add extra items to my PATH, and so on. They all output tab delimited lines that are hundreds of characters long with no headings, so it's a bit of a pain...
Is there an idiomatic way to simulate Perl's diamond operator in bash? With the diamond operator,
script.sh | ...
reads stdin for its input and
script.sh file1 file2 | ...
reads file1 and file2 for its input.
One other constraint is that I want to use the stdin in script.sh for something else other than input to my own script. Th...
Hey, I've been writing a program (a sort of e-Book viewing type thing) and it loads text files from a folder within the folder of which the executable is located. This gives me a bit of a problem since if I run the program from another directory with the command "./folder/folder/program" for example, my program will not find the text, be...
I'm reading from a line that's about 500 characters. How can I get sed to, instead of replacing that string with something, replace the rest of the line with something?
In short, I want to remove all the text around a specified string. Deleting columns with awk won't work, because there is an indeterminate amount of characters before and...
I'd like to reverse the lines in a text file (or stdin), preserving the contents of each line.
So, ie, starting with:
foo
bar
baz
I'd like to end up with
baz
bar
foo
Is there a standard unix commandline utility for this?
...
I have a tool that generates tests and predicts the output. The idea is that if I have a failure I can compare the prediction to the actual output and see where they diverged. The problem is the actual output contains some lines twice, which confuses diff. I want to remove the duplicates, so that I can compare them easily. Basically,...
We have a web service that uses COM to talk to some DLLs. The data files that the DLL functions rely on are on a unix share, and we must specify the data file location when initializing the COM calls. We have installed SFU 3.5 on our Windows Server 2003 server. We can't use a mapped drive because IIS is running as a service (or can we?)....
We have a large, multi-platform application written in C. (with a small but growing amount of C++) It has evolved over the years with many features you would expect in a large C/C++ application:
#ifdef hell
Large files that make it hard to isolate testable code
Functions that are too complex to be easily testable
Since this code is t...
A compulsion of LD_PRELOAD on HP platform only and not on other unix flavors (AIX,Linux, and Solaris).
I built Perl Module XML::LibXML::Common on all of Unix flavors.I had to specifically do LD_PRELOAD for libcl.2 library on HP Platform only. While on other unix platforms nothing as such was required.
Is this an OS behaviour or somethi...
Is it a good practice that links should always point to absolute path rather than pointing from current directory?
I am talking this with reference - where i need to maintain software and all its previous versions should always point to latest version.
...
Lets pretend I have a program that needs an environment set. Let's just pretend its Perl and I want to modify the environment (to search for libraries a special spot). Every time I mess with the the standard way to do things in UNIX I pay a heavy price and I pay a penalty in flexibility. I know that by using a simple shell script I wi...
I have the following code that uses 'paste' and AWK script inside
Perl.
use strict;
use Data::Dumper;
use Carp;
use File::Basename;
my @files = glob("result/*-*.txt");
my $tocheck = $ARGV[0] || "M";
foreach my $file ( @files ) {
my $base = basename($file,".txt");
my @res = `paste <\(awk '\$4 == "M...
I was trying to get mysql running on my machine and ran sudo mysqld_safe from my home directory. This, I have found, was not a wise decision. Anyone have any idea what it might have changed to make reaching the internet impossible? My wireless card works fine and connects to the router, but I cannot resolve any external host (localhost w...
I have an XML file of size 31 GB. I need to find the total number of lines in that file. I know the command wc -l will give me the same. However it's taking too long to perform this operation. Is there any faster mechanism to find the number of lines in a large file?
...