Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mynameistmp

Pages: 1 ... 3 4 [5] 6 7 8
61
General Programming / Help with C pointers
« on: November 12, 2005, 05:13:58 pm »
I found this brief piece of code that I don't really understand. Obviously there is some major concept that I am missing. I was hoping someone here could explain it a little bit. This guy stores shellcode in a char array then executes the shellcode. If you run the program it works, but I don't understand why. Here is the code:

Code: [Select]
char shellcode[] = "blahblah";

int main()
{
      int *ret;
      ret = (int *)&ret + 2;
      (*ret) = (int)shellcode;
}

I don't really understand how that results in the shellcode being executed. Thanks in advance.


   


62
Unix / Linux Discussion / Re: Slackware 10.2
« on: November 03, 2005, 03:00:46 pm »
I thought most HP printers already have drivers in CUPS... Newby... what's that link to the web-interface thingy?

Affirmative.

63
General Programming / Re: [C++] Beginning socket use
« on: October 17, 2005, 04:33:51 am »
You should read Beej's classic:

http://beej.us/guide/bgnet/



64
Botdev / Re: Packet Buffer question
« on: October 17, 2005, 04:30:07 am »
MyndFyre's example is broken.

65
Unix / Linux Discussion / Re: Who has the most RAM ?
« on: September 30, 2005, 01:20:17 am »
Quote
  x Linux can use up to 64 Gigabytes of physical memory on x86 systems.     x 
  x However, the address space of 32-bit x86 processors is only 4           x 
  x Gigabytes large. That means that, if you have a large amount of         x 
  x physical memory, not all of it can be "permanently mapped" by the       x 
  x kernel. The physical memory that's not permanently mapped is called     x 
  x "high memory".

  x If you are compiling a kernel which will never run on a machine with    x 
  x more than 960 megabytes of total physical RAM, answer "off" here (defau x 
  x choice and suitable for most users). This will result in a "3GB/1GB"    x 
  x split: 3GB are mapped so that each process sees a 3GB virtual memory    x 
  x space and the remaining part of the 4GB virtual memory space is used    x 
  x by the kernel to permanently map as much physical memory as             x 
  x possible.                                                               x 
  x                                                                         x 
  x If the machine has between 1 and 4 Gigabytes physical RAM, then         x 
  x answer "4GB" here.           


-- Linux 2.4.29 Configuration help menu

My understanding was that if the kernel cannot map the memory, then it is not going to be used. Perhaps I am wrong, although if I am, I don't know why the help menu would say this:

Quote
x If the machine has between 1 and 4 Gigabytes physical RAM, then         x 
  x answer "4GB" here.           


66
General Discussion / Re: slackchat has a new home!
« on: September 30, 2005, 01:03:04 am »
Code: [Select]
echo "nick="$username >> ~/.slackchatrc

You'd end up with 2 "nick=" lines, though.  You might need to pipe it through sed then back to the file.

I think you mean he'd have a duplicate of every line if the file already existed. Otherwise I don't understand what you mean. He could do:

Code: [Select]
echo "nick="$username > ~/.slackchatrc
echo "whatever="$whatever >> ~/.slackchatrc

That should work fine.

67
Unix / Linux Discussion / Re: Who has the most RAM ?
« on: September 28, 2005, 03:24:14 pm »
What part of my post was misleading ?

68
General Discussion / Re: slackchat has a new home!
« on: September 28, 2005, 03:25:06 am »
Thanks, Joe. Most of those sound like good ideas. I don't think I'd ever implement /quit though. Have you tried ctrl+c ? IMO (and probably most unix users) ctrl+c is more standard and instinctive.

Also, it is open source. If you learn some C you could probably add a lot of that functionality on your own. I wouldn't mind giving you pointers on where to start with what and if you actually got the ball rolling you could maintain the project/website for all I care.

PS
Probably the closest thing to what you want for that script would be something like this:

Code: [Select]
echo "nick="$username >> ~/.slackchatrc

69
Unix / Linux Discussion / Re: Who has the most RAM ?
« on: September 28, 2005, 03:14:02 am »
Alright! Enough fun. Now, I don't want to be a dick but I don't actually care how much RAM any of you have. The truth is that this is another lesson-post in trap form!

EDIT -
tmp, may I ask why we need more than 900MB of RAM?

Good question, Joe! I had a sneaking suspicion that many of you guys probably have some fancy machines (with plenty o' RAM), but you probably didn't know that Linux, out of the box anyways, doesn't support more than 960MB of RAM ;P Don't believe me ? Check out Newby's situation ;P

newby@impaler:~$ free -m
             total       used       free     shared    buffers     cached
Mem:           883        850         32          0        265        103
-/+ buffers/cache:        481        401
Swap:          933         65        868


It's 1024MB RAM, but...

BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003ff30000 (usable)
 BIOS-e820: 000000003ff30000 - 000000003ff40000 (ACPI data)
 BIOS-e820: 000000003ff40000 - 000000003fff0000 (ACPI NVS)
 BIOS-e820: 000000003fff0000 - 0000000040000000 (reserved)
 BIOS-e820: 00000000ffb80000 - 0000000100000000 (reserved)
Warning only 896MB will be used.

:(

If you ran free on a shell server (cheated) then you probably got the expected amount because the admin hopefully knows what he's doing.

Anyhow, on with the issue at hand.

Good news: I'm about to tell you how to fix the problem

Bad news: You'll have to recompile your kernel.

The linux kernel actually supports up to 64GB of RAM. However, in order to use anything past 960MB you need to configure  the CONFIG_NOHIGHMEM define appropriately then rebuild your kernel. You want something like so:

up to 960MB: off
up to 4GB: 4GB
up to 64GB: 64GB

If you select 64GB your processor must be capable of PAE mode. That includes all processors since the Pentium Pro, so you're probably OK. The kernel will refuse to boot if you don't have it which is why this configuration isn't enabled by default.

Also, if you've got an older BIOS it might have trouble reporting the amount of RAM to the bootloader accurately. If you've taken the above step and it still doesn't work properly add this to your /etc/lilo.conf:

Code: [Select]
append="mem=2048M"

Where I have 2 Gigs of RAM. All should be well.

70
Unix / Linux Discussion / Re: Who has the most RAM ?
« on: September 27, 2005, 03:40:33 pm »
Please run free and paste the output here. Thanks

71
Unix / Linux Discussion / Who has the most RAM ?
« on: September 27, 2005, 03:02:16 pm »
I'm interested in who has the most RAM in ONE machine. The machine has to be running Linux or you're void from the contest ;P Whoever wins (the winner has to be above 900MB) will get a prize.

72
General Programming / Re: Learning
« on: September 27, 2005, 02:53:04 pm »
The Art of UNIX Programming -- Eric S. Raymond
Beginning Linux Programming (I've only seen the 3rd edition) -- Matthew and Stones

The first one is a must read for a unix programmer. These books are more for the guy who's done reading the how-to books and is interested in starting to develop applications. I know that's not what mfqr is looking for but It's obvious he's not the only one with interest in programming that is viewing this thread.

73
General Discussion / Re: slackchat has a new home!
« on: September 27, 2005, 02:39:11 pm »
Quote
At this point, a fully functional linked/compiled binary will be located at slackchat/slackchat. A default configuration file can be found at slackchat/.slackchatrc. Simply edit the configuration file to your liking, copy it to your home directory, run the slackchat binary to begin chatting! The binary will not connect unless you adjust the configuration file appropriately.

slackchat README
;P

74
General Discussion / Re: slackchat has a new home!
« on: September 27, 2005, 02:48:11 am »
There is a default config file in the tarball distributed on the site. The configuration file is located at slackchat/.slackchatrc upon extraction. You might not know that files prepended with a . are 'invisible' and are only viewed when passing the -a flag to ls ? (ls -a)

PS
this information is all in the README
*cough*

75
Unix / Linux Discussion / Re: I've seen the light!
« on: September 27, 2005, 02:34:11 am »
Edit .xinitrc to my knowledge! :)

Code: [Select]
echo "startkde" > ~/.xinitrc
echo "fluxbox" > ~/.xinitrc
echo "wmaker" > ~/.xinitrc

Slackware: xwmconfig

Pages: 1 ... 3 4 [5] 6 7 8