I have a linux server has an ad-hoc wireless network for clients to connect to. Once connected I want users to always be redirected to it’s own web server no matter what URL they type in. The large solution would be to set up a full DNS server (with BIND or equivalent) but that seems like overkill. All I need
Tag: perl
CPAN giving all sorts of errors on ubuntu
I am just trying to run a simple perl program to import data from xml and export it to database. Use Mysql; did not work, so I used DBD::mysql instead after failing to get Mysql.pm from cpan. However, I am unable to install anything. I am trying to install xml parser module, but cpan gives these errors no matter what
How to clean a data file from binary junk?
I have this data file, which is supposed to be a normal ASCII file. However, it has some junk in the end of the first line. It only shows when I look at it with vi or less –> grep is also saying that it’s a binary file: Binary file data.dat matches This is causing some trouble in my parsing
How can I know if I am running in a 64bits or a 32bits linux from within a perl script?
I don’t want to directly access the shell (for example to use uname). I am looking for a fast-forward way to detect the architecture (only if it is 32 or 64 bits), once I know I am on linux. Answer There are 3 separate questions you could be asking: Note for all that there’s not a single magic “64-bit”, there’s
extracting unique values between 2 sets/files
Working in linux/shell env, how can I accomplish the following: text file 1 contains: text file 2 contains: I need to extract the entries in file 2 which are not in file 1. So ‘6’ and ‘7’ in this example. How do I do this from the command line? many thanks! Answer Explanation of how the code works: If we’re
How can I get name of the user executing my Perl script?
I have a script that needs to know what username it is run from. When I run it from shell, I can easily use $ENV{“USER”}, which is provided by bash. But apparently – then the same script is run from cron, also via bash – $ENV{“USER”} is not defined. Of course, I can: But it doesn’t look nice – is