Greetings all,
I'm a python newbie, so my apology for being silly (if it is) with my question.
I was trying to convert converting HTML markup code to human readable text and the sample line I took form the iTumes music library, which is a .xml file.
import os, sys, string
import urllib...
Greetings all,
As said in the subject line, trying to write a script to print the number of years, months weeks and days between two given dates. Does anyone know how to do that?
So far I've tried Date::Calc module, which returns the difference as number of days but then I'm stuck converting...
Hi people,
I'm very very new in this flash world (just a 2 weeks old of experiences, so far) and I found the ActionScript (especially v3) is really cool. So I started with making clock, not the the one which takes time off the system clock but a clock with different timezone(s). I didn't find...
Hi guys,
I was trying to execute some Unix commands from within perl but getting error; especially when the command itself got a single quote in it. Say e.g. if I want to pipe through sed like this:
my $DIR = `pwd -PL | sed '\,^, s/.*\///'`;
I tried with backslash but didn't work. Any idea how...
Hi all,
I use this script:
HOST=`seq 11 18 | gawk '{printf("node%03i\n",$1);}'`
for ix in ${HOST}; do
ssh -T ${ix} << EOF
some commnds
.......
......
exit;
EOF
to remotely login on to all of my nodes, say e.g. from “node011” to “node018”. The script runs fine, I can login and do stuff on...
Hi all,
What would be the PHP equivalent of this Perl construct:
$ENV{"PATH"} = "/bin:/usr/bin";
my $ls = `/bin/ls /path/to/dir/some_dir/`;
my @images = split /\n/, $ls;
my $name = "some_file.jpg";
my ($position, %pics);
$pics{$images[$_]} = $_ for 0 .. $#images;
$position = $pics{ $name }...
Hi Guys,
I was trying to use the output of "ls" command to fill an array with. This is the sample code I'm using:
#!/bin/bash
#
cd /Volumes
PART=( `ls` )
echo; echo "Directory listing:"
echo "------------------"; ls
echo; echo "The array using ls:"
echo "----------------------"
ix=0
while...
I’ve got another problem with bash script. If I do this on the console I get it write:
[MacUsers@pcge ~]$ find ~/scripts -type l | grep iTest
/home/MacUsers/scripts/iTest File
[MacUsers@pcge ~]$ find ~/scripts -type l | grep iTest | sed 's/ /\\ /g'
/home/MacUsers/scripts/iTest\ File
But running...
Hi people,
I'm a complete newbie in this php world and was trying a very simple thing to start with. But can't see that I'm doing quite well. These are the things I'm trying to do:
list the directory content using UNIX “ls” command
split the out put
put the values in an array
display the...
Hi guys,
I was trying to write a small bash script, which reads the iTunes’ Library.xml file and then print the name of the songs based on the “given” artist. In the end, I came up with something like this:
cat ~/Music/iTunes/iTunes\ Music\ Library.xml | tr \\n ' ' | sed 's%</dict>%\n%g' |...
Hi guys,
I was trying to write small bash script, which reads the iTunes’ Library.xml file and then print the name of the songs based on the “given” artist. And I came up with something like this:
cat ~/Music/iTunes/iTunes\ Music\ Library.xml | tr \\n ' ' | sed 's%</dict>%\n%g' | sed -e...
Hi all,
How to encrypt the URI string (or maybe put some extra garbage in it) so that it’s not easily understandable when passing through a Perl/CGI?
Say like, if I want to pass an URI like this:
<a herf=”/cgi-bin/xyz/xyz.cgi?MODE=ABC&DIR=$blah&FILE=$blah.txt”>
and on the next page this is...
Hi guys,
How can I determine the position of an array element if the value is known? For example, if we have
Then print $sss[3] will return “Wednesday”
I just need to do the other way round, i.e. if I know the element “Wednesday” then how can I return 4?
Thanks in advance. Cheers!!!
Hi guys,
I'm a bit confused with the behaviour of my dhcp server. I'm just wondering if you can help or explain. To summarize every thing else in the dhcpd.conf file is under our own subnet section, like this:
subnet 1.2.3.0 netmask 255.255.255.0 {
deny unknown-clients;
authoritative;
...
hi guys,
Need to write a bash script which will increment the numbers by 1 but the number should be with leading zero, i.e. 01, 02, 03 etc.
So, if I do
#!/bin/bash
s=`seq -w 5 12`
for i in $s
do
echo $[i+1]
done
not returning the desired result. I tried replacing “$[i+1]” with “$[s+1]” and...
Hi,
Since few days I'm trying to get a work around to burn a CD on my Mac, off a disk image which I created from a folder. After burning, I get it perfectly okay on Mac but on Windows it appearing as a empty (not *BLANK*) disk. I suspect that it’s creating a HFS+ formatted disk and that’s why...
Hi,
I need a help. I got a page with nested frame set, like this:
<FRAMESET rows="59,*" cols="99%" frameborder="0">
<FRAME name="titlebar" src="header.html">
<FRAMESET cols="190,99%" rows="*" frameborder="0">
<FRAME src="leftbar.html" name="leftbar" noresize>
<FRAME src="rightbar.html"...
Hi guys,
I got a problem: rndc not connecting ‘named’
I’m using FC-2 and I got a slave zone. ‘named’ service is running but getting error when to stop the named:
[root@www root]# service named restart
Stopping named: rndc: connect failed: connection refused [FAILED]
Starting named: [ OK...
Hi all,
I got a problem and a n urgent fix. Here is my situation one:
I got /var (/dev/hda6) totally filled up so I decided to switch that one with /home (/dev/hda8) as I got plenty of spaces left over there. To do that I edited the /etc/mtab file and switched the entry for /var with /home so...
Hi all,
I have a really tricky requirement. I need to create a special-purpose user account, by giving it a shell which only allows the ‘sftp-server’ and a set of commands, namely ‘passwd’ ‘ls’ and ‘cd’ (ls & cd within the ~user directory only).
Initially, I replaced '/bin/bash' by...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.