General :: Use RANDOM Number In Procmailrc?

May 2, 2011

I want to generate random name for email file name to prevent overwriting but $RANDOM ENV VARs does not work in it what can I do? this is my procmailrc:

Quote:

SHELL=/bin/bash
SUBJECT=`formail -xSubject:`
FROM=`formail -xFrom:`
SUBJECT=`echo $SUBJECT | sed -e 's/ /-/g'`
FROM=`echo $FROM | sed -e 's/.*<//g' | sed -e 's/>//g' | sed -e 's/@/AT/g'`
STOREFILE=20`date +%y-%m-%d_%H-%M-%S`_${FROM}_${SUBJECT}_${RANDOM}${RAMDOM}

it works fine except ${RANDOM}${RAMDOM} and I do not want to use mktemp command .

View 8 Replies


ADVERTISEMENT

General :: Generate Random Number Either 1 Or 0?

Jan 21, 2010

Not only that but I need tons and tons of them generated, and I need it to be totally random each time.

Code:
matthew@mvm:/h/misc> cat a
#!/bin/bash
for i in {1..5}; do
echo $RANDOM

[Code]....

There you can see that it is the same number. It does that every time!! Grrr. The strange thing is each time I manually type [or copy & paste] it into the terminal, it gives random [not static, like I am getting from my script] results.

The reason I want this is because I am making a script where this line will randomly go up or down [depending on if the random number is 1 or 0].

View 4 Replies View Related

Programming :: Get Random Number From -1 To 1 In C?

Mar 4, 2011

i want to generate random number in c programming from -1 to 1

View 1 Replies View Related

General :: Put ELSE For Condition Block Of Procmailrc Recipes

May 2, 2011

How can I have ELSE condition in procmailrc I mean if the mail was from X and Subject has Y OR .... DO something ELSE DO SOMETHING ELSE. I do not want to use two different conditions for each state I want use just one condition and its ELSE because putting too recipes in procmailrc make it too slow .

View 2 Replies View Related

General :: Set Variable In Procmailrc Action Block?

May 2, 2011

I want to know how to set variable in procmailrc action block or condition block I want to set a variable as a random file name to store emails but I don't know how to set a variable in procmailrc action block or condition block .this is my example:Quote:

:0b
* ^FROM.*
{

code]...

View 2 Replies View Related

SUSE :: Initializing The Random Number Generator?

Jan 10, 2009

I just tried booting SUSE 11.0, but the system stops at the point it shows "initializing random number generator". I have left the system running at that point for almost 2 hrs, with no way to get past that. System isn't locked up. It has never done this before. How do I fix this?I have also tried failsafe booting, but it stops at the same spot also.

View 3 Replies View Related

Ubuntu Security :: Making A Hardware Random Number Generator

Apr 1, 2011

I'd like to somehow connect a serial port to a headphone jack, plug it into the geiger counter and literally dump random noise from the geiger counter into the entropy pool used by /dev/random

View 7 Replies View Related

General :: Use Sender Or Any Thing In Header As Ame Of Storing Mail File In Procmailrc?

Apr 19, 2011

I want to know how can I use sender an receiver of the email in name of file for storing mail in procmailrc. I made one but it does not work.

Quote:

SUBJECT=`formail -xSubject:` # regular field
FROM=`formail -rt -xTo:` # special case
:0 b
* ^FROM.*
| sed -e '/^To: +?[0-9]*$/,/report/!d' > ${FROM}${SUBJECT}--`mktemp 20`date +%y-%m-%d-%S--`XXXXXX`

it works when I use :

Quote:

| sed -e '/^To: +?[0-9]*$/,/report/!d' > `mktemp 20`date +%y-%m-%d-%S--`XXXXXX`

View 1 Replies View Related

Software :: When Type Mpd & To Bring Up Ring On A Single Nodethe Output Is A Random Number?

Mar 9, 2011

when we type mpd & to bring up ring on a single nodethe output is a random number,like this:>>mpd &>>[1] 5450anybody knows what is this resulting number?ps: i dont think its a port number because when i type >>mpd -eits prints out the port number mpd takes

View 1 Replies View Related

Ubuntu Networking :: Unable To Connect To A Small Number Of Random Websites: Otherwise Networking Is Fine

Dec 29, 2010

I was having no problems (that I knew of) browsing the web since installing Ubuntu 10.10 a week or so ago. I was previously trialling Win7 as my customers will likely be using that in the future. Then I wanted to go to internode.on.net. Got the following: Quote: Firefox can't establish a connection to the server at internode.on.net. or Quote: Oops! Google Chrome could not connect to internode.on.net

As it was just after Christmas I thought it must be down, for upgrades or maintenance etc. I later tried to go to Freebsd.org; same error. I've been having a small number of other websites give the same error. I thought nothing of this until I tried it on my wife's macpro. I could log onto all the websites I wanted to and none gave any indication of having been down. Both boxes are on the same adsl connection. I still can't access internode or freebsd on 10.10 yet have been able to access every website on OSX. Now, I was only looking at them for info but am worried I won't be able to access something important. (so far everything I 'need' is working)

ping just drops out. edit: weirdest thing! I just retried and now can not emulate the problem for internode. freebsd still won't show. that is less than five minutes between problems and resolution! I hadn't even posted! But I still would like to have an idea of what is going on. Here is the ping error for freebsd: Quote:

[Code]...

View 9 Replies View Related

General :: Unix Ps -l Priority Whoes One Number In Column "PRI" But In Same Time Ps -o Pri Shows Another Number?

May 21, 2011

Why does unix ps -l whows one number in column "PRI" but in same time ps -o pri shows another number? cpu and nice are zero for those processes

View 1 Replies View Related

Ubuntu Multimedia :: Copy Random Jpg From Random Folder

Jan 19, 2010

I'm looking for a script that copies a random .jpg from a random folder in my ~/Pictures folder to my ~/temp folder with a standard filename. This file will then be displayed in Conky. I can fix the last part, but I cannot find a way to do the first part.

View 3 Replies View Related

General :: Random Numbers Between -5.0 To +5.0?

May 25, 2010

How to create random numbers between -5.0 to +5.0

View 12 Replies View Related

General :: Point /dev/random To /dev/urandom

Jul 12, 2011

I have a server that cannot generate enough entropy to support /dev/random. The particular piece of software having problems can't be configured to use /dev/urandom.

I tried moving /dev/random to /dev/realrandom and symlinking /dev/random to /dev/urandom, but lsof /dev/realrandom still shows processes using it.

In Does urandom share the same entropy of random?, the suggestion is to use mknod /dev/random 1 9. Will this hold across restarts? Should I be using udev somehow?

View 3 Replies View Related

General :: Random System Freeze ?

Mar 2, 2010

I'm running Fedora 12 with GNOME on an old Toshiba Satellite A15. From time to time I get a system freeze, where everything stops working besides the touch pad (I can move the cursor, just can't click on anything). When I boot up, I see an error message that it skips past before I can read anything, although I have spotted the snippets 'pci' 'error' and what appears to be the 0x at the start of a memory address. When I try and shut down the system (going either by command line or the System->Shut Down part), I get to the part where it says "Unmounting filesystems..." and then it stops right there. When I boot it back up, I get an error that says "A crash in package kernel has been detected."

The same happens when I boot up after the hard freeze. It seems more frequent when I have a heavy load on system memory, but for the most part it seems random. I've seen it crash after 5 minutes with only Pidgin or gedit open, I've seen it run for weeks with over 100 Firefox tabs, Pidgin, 3 documents, and GIMP running, but it seems more likely in the second scenario. It also seems to have a chance of freezing again within 5 minutes of rebooting (even if I don't touch anything after login). I ran Fedora 8 and Fedora 10 on this computer just fine, with most of the same system settings (copied my /home folder for each upgrade). I have a dual-boot system (XP/Fedora), with a third partition for data and a 200MB partition for the boot loader. The partition with Fedora is encrypted, and the crashing while trying to unmount the filesystem implies to me that might be the problem, but whatever it is, it wasn't in Fedora 8 or 10 (at least as far as I could tell).

View 4 Replies View Related

General :: Does 'urandom' Share The Same Entropy Of 'random'

Jun 10, 2010

Does the entropy pool /dev/random used the same to /dev/urandom?

I want to

mknod /dev/random 1 9

to replace the slow random, I think the current entropy is randomly enough, if urandom is based on the same entropy, and all succeed random numbers are generated based on that entropy, I don't think there'll be any vulnerable.

View 2 Replies View Related

General :: Creating Random Large Files?

Aug 27, 2010

how I can randomly write / create a 1 GB file in bash to test disk / network i/o? I was told I could use the 'dd' command but I don't know if there are some better ways and or what the 'dd' command looks like.

View 7 Replies View Related

General :: Random Drives Corrupt GTP Table?

Jan 30, 2011

I have several drives in an LVM VG/LV and for some reason on reboot, a drive will get a corrupt GTP table. I have killed the entire VG and re-created it without the drive that was showing the problem, then then it just happens to another drive. It does not appear to be the same drive each time either. I've confirmed this by using smartctl to check the SN of the drive reporting a corrupted table. It's not always the same drive.

I have swapped around cables to the two controllers to see if I could pin-point which cable or port showed the problem and long story short, there was little consistency in it. This simply does not appear to be caused by any single cable, port, controller, or drive.

Code:

parted /dev/sdb print
Error: The primary GPT table is corrupt, but the backup appears OK, so that will be used.
OK/Cancel?

When I see that and select Ok, it just shows it again. I can do an mklabel and mkpart, then the LVM LV shows up under /dev as it should, without another vgscan. If I then mount that LV, I can see the data is there and it seems Ok despite the warning of mklabel saying it will destroy the data. Logs show no cause during boot. So, what is causing this? Will doing the mklabel kill the data on it? I just don't understand why Ubuntu is randomly corrupting GTP tables.

Code:

Ubuntu 10.10 x64
Mobo: ASUS A8N-SLI - On board NVIDIA nforce4-SLI controller has 4 ports connected to 3 drives in this LVM LV.
HighPoint Technologies, Inc. RocketRAID 230x 4 Port SATA-II Controller - Has 4 ports, 3 of which are used in the LVM LV. (Had 4, one is out with an RMA).

[code].....

View 17 Replies View Related

General :: Random Keyboard Pseudo-failure?

Jan 9, 2011

Occasionally when I start typing into a text box, it will not enter text until I go to another window or text box and click back in. This seems to happen at random without any pattern or to any specific applications more than others. I can still use alt-tab and similar commands, so I know it's not the hardware. I am running Ubuntu 10.04 Lucid Lynx using a Microsoft Multimedia keyboard and I am running SCIM for Japanese input, but I almost always have it set to English, and it can be set t

View 12 Replies View Related

General :: Rename Command Using Random Variables?

Apr 14, 2010

I'm trying to clean up some files and I've been using the rename command as its the easiest way I've found to do it. One problem I've found is that on a couple of batches of files they have a set random numbers on them which I need to remove.

Only problem is I can't find a way for rename to "lock" onto those numbers to remove them. The file name structure is something like this:

file name[random numbers].extension

There are brackets around the numbers as well which I'm not sure will help or not.

View 1 Replies View Related

General :: Get Assigned Ip From Server It Does Not Get Ip Instead Random Ip Is Provided?

Apr 26, 2010

when i assign ip manually to a machine it gets ping by server and it also itself pings server but when i chose to use client machine as dhcp , so that it can directly get assigned ip from server, it does not get ip, instead random ip is provided which is out of range specified at server side in /etc/dhcpd.conf file.

View 2 Replies View Related

General :: Random Evolution - Cannot View Inbox?

Jan 7, 2011

I wouldn't have a lot of time for repairing my laptop and until now Ubuntu has been flawless. When I open evolution sometimes i cannot view my inbox? although I can view my other folders of which i have about 8 or 9. I suspect this is an issue with the storage folder for my inbox, but where would i find it?

View 1 Replies View Related

General :: Manually Sort Random Text Files?

Jun 6, 2010

I have about 1000 text files and I need to view each, and move it to a folder if it's the correct one. I can only do basic sorting by length/size, and I can't grep because the text is random. How can I do this besides manually openiing + saving each in gedit.I'm on Ubuntu Linux.I've already done all the sorting I can based on ize,wordcount,greps,date,etc. This is what's left over. I'm trying to find an easy way to view +save/ignore the rest.

View 6 Replies View Related

General :: Windows - How To Batch Rename Files With A Random Name

Jun 30, 2011

I have a bunch of photos with varying names. I want to give each photo a random name(*), how do I do that? (*)I'm going to put them on a digital photo-frame that can't shuffle

View 4 Replies View Related

General :: CLI Commands To Generate Random Result From Specified List?

Jul 20, 2011

List of 77 lines with the names of movies. For ease, let's say it's in a text file. What I want is a command line argument I can pass that'll read each line and pick one of those 77 lines at random, except I can't figure out how to do this. Is there a program I can just pipe the output of 'cat listofmovies.txt' to?

View 13 Replies View Related

Ubuntu :: Get The Card Number And Device Number On System For Attched USb Audio Device?

Oct 1, 2010

how to get the card number and device number on system for attched USb audio device?

View 3 Replies View Related

General :: Grab A Random Section In The Middle Of A Huge File?

Apr 23, 2011

I have a huge log file of around 3.5 GB and would like to sample random sections in the middle of say 10 MB for the purpose of debugging what my application is doing.

I could use head or tail commands to get the beginning or end of the file, how can I grab an arbitrary portion from the middle of the file? I guess I could do something like head -n 1.75GB | tail -n 10MB but that seems clumsy and I'd need to determine line numbers for the midpoint of the file to get 1.75GB and 10MB line counts.

View 2 Replies View Related

General :: Bad Video - Square Boxes Appearing At Random Places

Mar 9, 2010

I have a couple things I think is my video card. One annoying thing it does is to put half inch square boxes in random places and times that might be trying to display what was in that spot before you changed the window. Sometimes it can be important information so I had to find a way to do something about it. I couldn't get rid of them but I could move them out of the way by moving the pointer to a different area and turning the scroll wheel. That would put the square in the new area where the pointer was.

The other thing is very bad scroll control. Sometimes I would have to use the arrows in the corner. Sometimes I had to drag the slider which moved hard, not at all or very delayed. The squares also make highlighting very difficult. Because an area will not be highlighted you don't know the results until you paste it. It might be perfect. I believe the video card is on the motherboard. I do have a spare slot so If needed I could put in a new one. Where is my title bar at the top of a screen which allows you to move it around or -minimize or maximize or close.

View 14 Replies View Related

General :: Instability In Fedora 15 - Black Screen And Message Appear At Random

Jun 15, 2011

if I reboot the computer, I get the grub menu and am able to choose between Win7 and Fc15. A couple of times during installation the screen flashed black and diplayed a message for a brief second. I can't read that fast but it says something like "DRM nouveau- unknown or unsupported chipset" and one more line that I can't catch. When this happens, I see the pre-login loading screen, the one that shows an icon of a hard drive, network, and so on as each resource is secured. I can log back in, but this starts a new session- it doesn't remember what I was doing. I had to redo the install and setup several times because of this.

I can log in and so on normally, but the black screen and message will appear at random, forcing me to start all over, which is really frustrating. what's going on? Is it the video card? How do I install a driver for it? Also, the hard drive in question has been through a lot. could it have a bad sector or something? Windows didn't even want to "see" it, that's why Fedora is installed on there.

View 11 Replies View Related

General :: Ubuntu Server - Random Hard Drive Corruption

Feb 28, 2010

So I built a new system few months to act as a development/"mess around with" server with an Asus Mobo and a Q6600 processor and 8 gigs of ram. Along with file, web and app hosting, I also do some virtualization on it... or atleast I had hoped to.

Ever since the first install, I've been randomly getting crashes and lockups. Sometimes it would just dump an error to the screen but stay alive, and sometimes it would dump an error and then lock up fully. The error mentions something about "kernel not tainted" etc. I will post the detailed error once it comes up again, as I have just formatted it again.

Other problems include downloaded files becoming corrupt. Files downloaded through any means (wget, torrents, ssh, ftp etc.) seem to randomly get corrupted (ie: the hashes are wrong).

I currently have one WD 150GB raptor as my primary OS partition, and 3 WD 1TB greens as my storage in an mdadm raid 5 array. At first, I had thought it was the raid array or it's drives causing issues. After painfully transfering the data off of it, I took the drives out and tried to run ubuntu with just the OS drive for a while. This still had the same issues. I then put in only one of the 1TB greens and had the same issue...

I downloaded WD's hardware diagnostic tool and ran full scans on all the drives. They all check out fine.

I left memtest running overnight and it had no errors either.

Most recently, ubuntu would not even install. It would get stuck at the stage of partitioning, and the keyboard lights would flash. After much googling, I tried popping in "noapic nolapic" to the end of the grub string, and it managed to install.

Now, I'm in a fresh system and just wgetted vmware server. However, it wont untar, I just realized the MD5 hash doesn't match!

So definately not the memory or the hds... I'm assuming it has to do with the APIC? From what I found on google, it seems as though this is only needed for the install.

Do I really need this to be on the boot string too? From what I understand, APIC allows processes to be divided out to the least loaded CPU. Having a quad core, I'd rather leave this on since it seems somewhat beneficial... I have yet to try putting this into the grub yet since I'm offsite and need

As a side note, this latest install is using just the WD Raptor as an OS drive.

And I'll post up the dumped errors if I get them again. There were none dumped out when the vmware download corrupted. The message format is very similar to the one here: [url

However, sometimes it mentions ext3 (or one of the other filesystem types I had tried with thinking it was a problem with ext3) Again, the error message is not the EXACT same, however the format is very similar...

View 13 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved