Programming :: Fill A File With N Bytes Of A Given Value?

Dec 17, 2008

How do i fill a file with <n> bytes at a given value ,for example 3?

View 3 Replies


ADVERTISEMENT

Ubuntu :: Error: Allowed Memory Size Of 20971520 Bytes Exhausted (tried To Allocate 7680 Bytes) In /var/www/index.php On Line 2

Jan 9, 2011

I recently had to move to a new machine, everything went well except for one thing. I did fresh installation of LAMP server all with default configs. Every time I'm using PHP script to that invokes include, require or require_once I get the following error:

Code: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 7680 bytes) in /var/www/index.php on line 2 index.php file: PHP Code:
<?php    include "index.php";?>
icukapi.php file:
PHP Code:
<?php    echo "test";?>

My memory_limit in php.ini is set to 20M. I tried to increase that however it didn't quite work. PHP seems to allocate all possible space and return that message every time i try. If somebody has an idea of how to fix it I would be more than grateful. I spend quite a long time searching for an answer however the all things i found suggested increating memory_limit which in this case doesn't work.

View 1 Replies View Related

Programming :: Print A Line Of Fill Character In C?

May 15, 2010

As you know, in C++ you can use setfill(char c); and setwidth( int length) to fill a line of a character.
It's line making a line of a character for output

Code:
NAME DEPARTMENT LOCATION
==========================================
Pete R&D Chicago
...
==========================================
As you see, a line of a '=' character drawn to output.

I'm wondering, how can I draw this line in C using printf() to format?
( no loop or repetiton )

View 8 Replies View Related

Programming :: Read X Bytes From Serial Port?

May 5, 2010

I am trying to write some code that interfaces with an AVR over a serial port. Basically I send a command then read the output which is 6 bytes. I need to receive all 6 bytes before the program continues. Is there a way to do this? If I use read() it returns -1 unless I add a delay before reading the port. Is there a way to get it to read the 6 bytes as soon as they arrive?In python you simply say how many bytes you want and the max time you are willing to wait which seems a whole lot easier than read

View 1 Replies View Related

Programming :: Converting Vector Of Bytes To String C++

Mar 4, 2011

I have a vector of octets that needs to be converted to a std string. I'm currently doing it this way:

Code:
stringstream ss;
for (unsigned int i=0; i < data.size(); i++
{
ss << data[i];
}
string s_data = ss.str();

This works, but is there any better way to do it?

View 2 Replies View Related

Programming :: Running Script Bash To Fill Files?

Mar 21, 2010

I have around 600 empty text files that I need to add the name of this file as part of the data, I meanfiles from "file1.txt to "file599.txt, all of them empty, and I need to get the name inside the file, so, when I open the file show the name as part the data "file1".these files were created on my web site, I am thinking in a small script in bash

View 5 Replies View Related

Programming :: Resume Download By Curl Without Mentioning The No. Of Bytes?

May 25, 2011

I am trying to resume an aborted download. I have to use the curl_easy_setopt(hnd, CURLOPT_RESUME_FROM_LARGE,(curl_off_t)no. of bytes to be skipped) to set from where to start resuming download. But in run time, how would i put the no. of bytes to be skipped? Its not possible always to see how much is the size of file downloaded already. So is there any way so that prograjm will automatically know from where to start??

View 5 Replies View Related

Programming :: Double Pointers / Matrix GCC (fill It One Column With Zeros And The Other With Ones)

May 26, 2011

I have a 10x2 matrix, I create said matrix and fill it one column with zeros and the other with ones, now when I print the matrix I get this:

column 1:
0,0,0,0,0,0,0,0,1,1
column 2:
1,1,1,1,1,1,1,1,1,1

The first two rows of the second column are being replaced into the last two rows of the first column, now I even checked in visual studio and it works fine there. A friend tried my code and he gets it even worse:
column 1:

0,0,0,0,1,1,1,1,1,1
column 2:
1,1,1,1,1,1,1,1,1,1

As far as I've seen it must be a problem with GCC, unfortunately I need to have this up and running in GCC no matter what.

[Code].....

View 6 Replies View Related

General :: Delete File Still Fill Space On HD?

Jun 12, 2010

I have external USB HD 500 GB, by mistake folder with 13 GB deleted, using some windows recovery tools, i got it back, but the deleted folder still take and fill space on the HD!!

any idea how to remove or edit it under linux ?

View 15 Replies View Related

Programming :: Combine 40 Different Mount Points Into One Bytes Free/used Number?

Feb 18, 2011

We have a program that catalogs to 40 different mount points. The program is fine as long as thier is free space on at least one of the 40 mount points. My boss wants me to come up with a script that will email us daily to know how much overall free space is left. I know I can do a df but I don't know how to combine the 40 mount points into a single disk used/disk free report.

The 40 mount points are /dev/mapper/areaxx, xx being 01 to 40.

View 4 Replies View Related

Programming :: Httpmethod Of Httpclient Support Downloading More Than 8192 Bytes?

Apr 15, 2010

Can httpmethod of httpclient support downloading more than 8192 bytes?

If not, any other ways?

View 2 Replies View Related

Ubuntu :: File Transfer Speed Shown In Bytes/sec ?

Apr 20, 2010

I have few different usb cards and socets , some of them i have really hotwired.. and i would like to find out where to keep my usb-hdd . few months ago i would use "total commander" it would show .. copying-444Kb/s but these times are over...

View 1 Replies View Related

Software :: Use Grep Through A Binary File For Sequence Of Bytes?

Apr 7, 2009

Is it possible to use grep to search for a sequence of bytes? For instance say I was looking for the following byte sequence in a file:

64 03 40 30 ; add eax, fs:[eax+30h]

Is this possible to do using grep?

View 5 Replies View Related

General :: Security - Safely Zero Fill A File In A Compressed Filesystem?

Aug 29, 2011

I had read that the shred doesn't safely work for compressed filesystems when shredding a file, how this can be accomplished in a compressed fs ?

View 1 Replies View Related

Programming :: Create Large Buffer In Program To Send And Eceive On Another Pc More Than 4096 Bytes

Feb 9, 2011

create a large buffer in my program so that I can send, and then receive on another pc, more than 4096 bytes (this seems to be the default for the serial port). I thought this might work:

[code]...

View 9 Replies View Related

General :: Command Line To Prepend 8 Bytes Of Data To A Binary File?

Jan 14, 2011

i would like to add 8 bytes of data to the begigning of a binary file.is there a command for this?

View 2 Replies View Related

Ubuntu :: Can't Fill Out Pdf Form?

Jun 11, 2011

I have a pdf form that came from open office conversion to pdf. It has some information filled out in it already and I don't want to lose that by doing anything that overwrites it or loses something in a conversion, etc. Also, it is two pages so I can't print it out, fill it in and then scan it because I would end up with two files instead of just one then.

View 4 Replies View Related

Red Hat :: Calculate Bytes-per-inodes Value?

Feb 17, 2010

I am a brand new member

here is my question :

in a RedHat configuration :

i need to be sure that a partition has been formatted with those parameters code...

View 3 Replies View Related

OpenSUSE :: Can't Get Wallpapers To Fill Desktop

Mar 14, 2010

Running Open Suse 11.1 with KDE 3.+ using screen resolution (trying to) 1280x1024. I can't get my wallpapers to fill the desktop, they are tiled sometimes and I can't change them. One other thing is I am having trouble with the screensavers, they won't start, and I like to delete some of them?

View 1 Replies View Related

General :: What Number Of Bytes Should Set The Bs To In The Dd Command

Apr 3, 2011

I have just created a usb boot disk so that I can install Fedora 14.I used the following which was successfully. However, I am left wondering what does the bs parameter actually does. I know it mean bytes and copies these at a time. But how do I know what to set it to?dd if=F14-Live-i686.iso of=/dev/sdb bs=8MIn the above example it is set to 8MB. However could I set this to any value that I want?

View 1 Replies View Related

Ubuntu :: Swap Partition Is Always At 0 Bytes

Jan 8, 2011

How do fix my Swap Partition? Last night I added unused space to the main Ubuntu partition. Now I noticed the Swap Partition is always at 0 bytes. I'm using a Sony Laptop, and have enclosed two screenshots. One of the Disk Utility and a system monitor.

View 9 Replies View Related

Networking :: Get Usage's Bytes Of A Specific IP?

Sep 14, 2010

I need to get usage's bytes of a specific (src/dst)IP adress;can i use this
#iptables -L -n -v -x
with the other options that get only byte of the specific IP address?

View 4 Replies View Related

OpenSUSE Multimedia :: Fill Out The Sound In LXDE?

May 5, 2011

i use opensuse 11.4 LXDE . after i installed i had a problem with the display blank votes . How to fill out the sound in LXDE ?.

View 2 Replies View Related

Ubuntu :: Window Doesn't Fill 10% Of Screen At Top?

Jul 31, 2010

Ubuntu 10.04 32bit
Gnome 2.30.2
Compiz active
Cairo Dock loaded

I've loaded Cairo-dock, deleted my bottom panel in Gnome & reduce my top panel to a minimum showing only "notifications". I can't get my windows to fill the top 10% of the screen on maximise without going full-screen and losing the window borders and the menu bar.how I can configure the maximise setting to use the whole screen?

View 1 Replies View Related

Red Hat / Fedora :: Fill 2TB /dev/sdxx With Random Data?

Jul 5, 2011

If this post is correct [URL] I can expect that it will take more then 16 days to fill my 2TB partition from /dev/urandom. That's not workable for me. dd if=/dev/urandom of=/dev/sdxx has been running for 36 hours, and I need to finish setting up the filesystem. But I also need to make a "professional effort" at encrypting the partition. I am supposed to fill the partition with random data, to strengthen the encryption for a LUKS partition. It seems that if the bad guys get the drive, they have much more time to try and crack it, then I have to encrypt it. Ok, so I can try Code: sudo /sbin/badblocks -c 10240 -s -w -t random -v /dev/sdxx How long can I expect badblocks to run on a 2TB partition?.

View 3 Replies View Related

General :: WMV Playing Doesn't Fill Fullscreen?

Mar 20, 2010

I was having trouble with the sound of the wmv files on linux, but i solved it by coping the w32 dll libraries and now it works just fine. There is one problem though : whatever player i use to open and play a wmv file (mplayer, vlc), it doesn't fit the full screen - in windows the same movie DOES.

View 1 Replies View Related

Ubuntu :: Blank CDs Read With 0 Bytes Memory?

Jan 14, 2010

Every single blank CD i put into my computer show it has 0 bytes of memory and i cannot write things onto them. I dual boot 9.10 and Windows XP, and Windows reads them just fine. Ubuntu will mount the disk as "Blank CD-R Disc, i can access it, and everything works except when i look at the properties it says there are 0 bytes used and 0 bytes free. The drive reads discs with data on them just fine, and they work flawlessly, its just blank discs that dont work. What i need to know is if there some property i need to change or a line i need to put in the terminal to make it read blank discs? Or am i completely screwed?

View 5 Replies View Related

Ubuntu :: Compare Folder Sizes By Bytes?

Dec 5, 2010

As a recent migrant to Ubuntu from Windows, I was expecting to be able to compare the sizes of two folders or set of folders by Bytes (as in windows). I'm slightly OCD when it comes to my personal files and folders, and I like to maintain identical backups in various pen-drives; as such, I was hoping to be able to track the file sizes of each folder set, but I can only do so in Kilobytes... Is there any application or other means by which to compare sizes in bytes --as is the case in windows?..

View 1 Replies View Related

Security :: Logging Connection Bytes For Iptables?

Mar 28, 2011

I am wondering if it's possible to log the number of bytes a connection transfered when the connection is complete with iptables. I know I've seen this sort of information in Cisco FWSM logs, where the "Teardown" entry of the logs has the bytes transferred for that connection. Is it possible to have something similar to that with iptables? Where the initial connection attempt is logged (i.e. NEW, which I have logging fine) AND an entry for that connection that includes the bytes transferred?

View 6 Replies View Related

Software :: Overwrote First Bytes Of Windows Partition?

Dec 5, 2010

This question is only partially linux-related, but I accidently typed cp file /dev/sda2 instead of cp file /mnt/sda2. The first 300 bytes or so of the ntfs partition were overwritten and now it can't mount and can't boot. I figured I would try copying the first 4096 bytes from another ntfs partition and see if that gave it enough to at least boot. It didn't and I'm wondering if there's any way to fix this sort of thing easily (without downloading an entire Windows 7 DVD) and what exactly I overwrote that was so important.

View 5 Replies View Related







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