Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 5,214
» Latest member: topupaman
» Forum threads: 4,029
» Forum posts: 16,404
Full Statistics
|
Online Users |
There are currently 318 online users. » 0 Member(s) | 314 Guest(s) Bing, DuckDuckGo, Google, Yandex
|
Latest Threads |
How to install Archboot i...
Forum: Network Problems
Last Post: Meup
2025-05-13, 01:41 PM
» Replies: 0
» Views: 412
|
clear logs in smoothwall
Forum: Security and Firewalls
Last Post: amanda63
2024-03-10, 03:27 PM
» Replies: 8
» Views: 85,964
|
I cannot install RedHat 8...
Forum: Redhat
Last Post: hybrid
2023-11-11, 01:01 PM
» Replies: 1
» Views: 40,125
|
How things are done, usin...
Forum: Xorg Problems
Last Post: ross
2023-09-04, 09:03 AM
» Replies: 0
» Views: 1,863
|
Im back.....
Forum: Hello
Last Post: anyweb
2021-01-17, 11:36 AM
» Replies: 1
» Views: 5,334
|
add mp3 plugin to xmms in...
Forum: Fedora
Last Post: anyweb
2021-01-17, 11:30 AM
» Replies: 11
» Views: 41,334
|
Configuring VSFTPd Server
Forum: FTP Server
Last Post: Johnbaca
2020-10-14, 10:25 AM
» Replies: 32
» Views: 116,006
|
Wolf won't play sound!
Forum: Game Problems
Last Post: Guest
2020-10-03, 05:51 PM
» Replies: 1
» Views: 53,887
|
Using git + python
Forum: How Do I?
Last Post: Clueless puppy
2020-08-21, 04:37 PM
» Replies: 0
» Views: 44,209
|
what does your nick mean ...
Forum: Hello
Last Post: volt
2020-08-06, 03:25 PM
» Replies: 28
» Views: 41,808
|
|
|
PHP: on the day |
Posted by: jsn06 - 2006-03-14, 08:58 AM - Forum: LAMP
- Replies (1)
|
 |
Getting the current full URL in PHP
Sometimes, you might want to get the current full URL in PHP. Here is how you do that. Add the following code to a page:
Code: <?php
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80″) ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }
?>
You can now get the full URL using the line:
Code: <?php print(selfURL()); ?>
Removing empty elements in a PHP array, this works like the @Trim formula in Notes/Domino.
Code: <?php
/**
* Trims an array from empty elements. *
* @param $a the array to trim.
* @return a new array with the empty elements removed. */
function array_trim($a) {
$j = 0;
for ($i = 0; $i < count($a); $i++) {
if ($a[$i] != "") {
$b[$j++] = $a[$i];
}
}
return $b;
}
?>
Use it like this:
Code: <?php
$a[0]="";
$a[1]="An entry";
$a[2]="Another one";
$a[3]="";
$b=array_trim($a);
?>
The resulting $b array will have two entries, with the two empty ones removed.
How to figure out your server’s real name. It is sometimes necessary to figure out the real server name. There are several ways to do this, but in PHP, a simple way is this:
Code: <?php
$IP = gethostbyname ($SERVER_NAME);
$server = gethostbyaddr($IP);
echo "Server IP: $IP";
echo "Server Name: $server";
?>
If you do not want to see the IP address of your website, you can use this single line of code:
Code: <?php
echo "Server Name: " . gethostbyaddr (gethostbyname ($SERVER_NAME));
?>
:P johnny06
|
|
|
'Root' Password Readable in Clear Text on Ubuntu Breezy |
Posted by: anyweb - 2006-03-12, 08:33 PM - Forum: Ubuntu
- Replies (3)
|
 |
for all you ubuntu users out there, please read the following and act accordingly
from:- [/url]http://www.osnews.com/story.php?news_id=13951
[url=https://launchpad.net/distros/ubuntu/+bug/34606]https://launchpad.net/distros/ubuntu/+bug/34606
Quote:A major, critical bug and possible security threat has been discovered in Ubuntu Breezy. Apparantly, the 'root' password (not actually the root password because Ubuntu uses sudo) gets written into the installer's log files in clear text, and can be read by any account on the Ubuntu machine. The bug was first discovered and reproduced on the Ubuntu forums. The bug does not seem to affect Dapper, however, users upgrading from Breezy to Dapper might still be at risk because the log files are not modified.
cheers
anyweb
|
|
|
useradd |
Posted by: xDamox - 2006-03-12, 08:02 PM - Forum: Fedora Core Release 5
- No Replies
|
 |
Hey all,
I am not sure if this is a security issue in Fedora Core 5 but when using useradd the user home directory
is created with the following permissions; 755
If anyone is using Fedora Core 5 I would suggest editing the /etc/login.defs and appending the following:
UMASK 077
This affects Fedora Core 4 too
|
|
|
Compiling Apache 2.x on FCR5 T3 |
Posted by: hybrid - 2006-03-11, 09:18 AM - Forum: Fedora Core Release 5
- Replies (3)
|
 |
I know that you can install it off the disc, but I'm trying to compile Apache 2.0.55 from source on Fedora Core 5 Test 3. I have installed gcc and the related compiler stuff.
I run the following configure command: ./configure --prefix=/usr/local/apache2. It finishes without error, so I run make:
Code: /bin/sh /home/peter/Desktop/httpd-2.0.55/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I../../include -I../../include/arch -I../../include/arch/unix -c proc_mutex.c && touch proc_mutex.lo
proc_mutex.c: In function 'proc_mutex_proc_pthread_create':
proc_mutex.c:341: error: 'PTHREAD_PRIO_INHERIT' undeclared (first use in this function)
proc_mutex.c:341: error: (Each undeclared identifier is reported only once
proc_mutex.c:341: error: for each function it appears in.)
make[4]: *** [proc_mutex.lo] Error 1
make[4]: Leaving directory `/home/peter/Desktop/httpd-2.0.55/srclib/apr/locks/unix'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/peter/Desktop/httpd-2.0.55/srclib/apr/locks/unix'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/peter/Desktop/httpd-2.0.55/srclib/apr'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/peter/Desktop/httpd-2.0.55/srclib'
make: *** [all-recursive] Error 1
I have snipped the lines that appeared to work.
What am I doing wrong here? Is there something else I need to install (but surely then it would tell me during configure)? Or is it a (known or unknown) bug?
This seems to also happen with Apache 2.2.x.
Thanks in advance for any help. :)
|
|
|
quickie on LVM |
Posted by: hijinks - 2006-03-10, 07:24 PM - Forum: Filesystem Management
- Replies (7)
|
 |
So what are the benefits about running a filesystem with LVM.. well for one say you create a normal non-LVM setup with a 20gig home dir. Now over the next few weeks you download so much porn that its filled.. so your option is get a new drive and either move everything to the new drive or do some symlinking. Well if you created your /home partition under a LVM enviroment, you could just grow /home with the new drive and have that extra 400 gigs to download more porn.
IMO that is one of the biggest points to using LVM is it allows you to easily change the size of a partition. With that said you should never make / or /boot LVM.. this just creates evilness.. or so i've read.. So in my example I will have a extra partition I made on my sda drive called sda7 which has no filesystem on it or such
Code: [root@localhost ~]# fdisk -l
Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3200 25599577+ 83 Linux
/dev/sda3 3201 5112 15358140 83 Linux
/dev/sda4 5113 9726 37061955 5 Extended
/dev/sda5 5113 5214 819283+ 82 Linux swap
/dev/sda6 5215 5278 514048+ 83 Linux
/dev/sda7 5279 9726 35728528+ 8e Linux LVM
I gave it a system type of LVM.. that is only needed for LVM v1.. most modern distros should ship with v2 now anyway. Ok now lets init that partition
Code: [root@localhost ~]# pvcreate /dev/sda7
Physical volume "/dev/sda7" successfully created
Now you might get a partition not found error. I ran into this when i just created sda7 using fdisk. The only work around I found out was a reboot. You could also use pvcreate on a whole disk. Like if i had a sdb i could do it on the whole disk. There is no need to do it just on a partition.
Now we need to create out volume group. You might think of this as the extended partition which holds all the extended partitions. That might not be explaining it good enough but oh well..
Code: [root@localhost ~]# vgcreate volume_group /dev/sda7
Volume group "volume_group" successfully created
Feel free to change volume_group to whatever identifier you want to use. You will notice how its used in a bit.. just hold on!
Ok now lets see if it worked
Code: [root@localhost ~]# pvdisplay /dev/sda7
--- Physical volume ---
PV Name /dev/sda7
VG Name volume_group
PV Size 34.07 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 8722
Free PE 8722
Allocated PE 0
PV UUID i9r7Pt-o8Jl-bhSW-LfCN-lVlW-FPZX-ZYgvyM
Now you can see my pv name is the partition i used..
My volume group is what i used above. and you can see I have around 34gigs of space you allocate. So lets get down to using that all up now
So lets create a logical device for our old lady porn
Code: [root@localhost ~]# lvcreate -L3000 -nporn_old_lady volume_group
Logical volume "porn_old_lady" created
Now lets create the filesystem. I shall use ext3 here
Code: mkfs.ext3 /dev/volume_group/porn_old_lady
Now we can mount it
Code: mount /dev/volume_group/porn_old_lady /dump/
Now lets see it in all its glory
Code: [root@localhost ~]# df -h | grep dump
2.9G 37M 2.8G 2% /dump
So you can see our size is 2.9gigs and we have used 37megs and we have aroudn 2.8gigs left. So you downloaded a ton of old lady porn and you want to grow your partition.. ok lets do it! Lets say we want to increase it to 7gigs
Code: [root@localhost ~]# lvextend -L7G /dev/volume_group/porn_old_lady
Extending logical volume porn_old_lady to 7.00 GB
Logical volume porn_old_lady successfully resized
Now if you use ext3 you have to resize it.. so you have to umount it and do some magic
Code: umount /dump
e2fsck -f /dev/volume_group/porn_old_lady
resize2fs /dev/volume_group/porn_old_lady
mount /dev/volume_group/porn_old_lady /dump/
Now lets check out the new size
Code: [root@localhost ~]# df -h | grep dump
6.9G 39M 6.6G 1% /dump
Yaya.. more space for old lady porn.. that would make randall happy. You can just see the benefits of using this if you are a hosting company or such. Now there is a ext2online patch you can apply to your kernel so you can resize it while its still mounted. I have never tried it.
|
|
|
Complete Computer Science Study Routine? |
Posted by: halpern - 2006-03-10, 01:41 PM - Forum: General Chat
- Replies (2)
|
 |
I did not go to school for computer science but I am getting interested in it. Now that I am learning C what other things I would need to study that is usually offered in a comp sci major? I see a lot of books on data structures, algorithyms, operating system design etc. Can someone give me a nice layout which, if you have books thats cool, how i can progress thru this programming/comp sci cycle. After I learn basic C and stuff, where do I go from there? Do I grab a book on algorithyms? What next? What have you learned to be the best method of progressing thru a comp sci degree? thx
|
|
|
Sound and DialUp Modem |
Posted by: JohaN^^ - 2006-03-10, 12:15 PM - Forum: Audio and Video
- Replies (2)
|
 |
Hi, I am still waiting for my ADSL so at this time i juse a 56kbps
dial up modem, im using KDE at Slackware. How should i do to set it up?
And now another problem, Sound. I have a SoundBlaster Live24 and in the
volume panel it found the soundcard but i cant get any sound.
//JohaN^^
|
|
|
|