Brave Cobra's Hideout
If Linux doesn't have the solution, you have got the wrong problem.
HomeNews

News » Linux

/usr/portage on a LAN

Contributed by bravecobra on May 11, 2005 - 07:28 PM
I was using a NFS mount for sharing my /usr/portage tree across my local network. However experience showed me that wasn't the best solution. Then I came across a couple of posts in the Gentoo Wiki: The idea is as follows. Build a local rsync daemon that will offer your /usr/portage tree to your network, but exclude the distfiles folder. This offers the possibility to sync each box separately without overloading Gentoo's servers. I can even have each box have its own overlay without interfering with another. Next you can cache every source tarball, avoiding unneeded bandwidth. The NFS share of the /usr/portage/distfiles was doing fine there, but it posed a problem on my laptop. When I wasn't home Ididn't have access to my sources anymore. With a caching proxy on the server, from which I download my sources now, my laptop has all the sources it needs and still I don't download them twice. Personally, I think this is the best way of setting up portage for a LAN with multiple Gentoo boxes. More information and guides can be found here: http://gentoo-wiki.com/HOWTO_Download_Cache_for_LAN-Http-Replicator and http://gentoo-wiki.com/HOWTO_Local_Rsync_Mirror

Prevent Hotlinking images

Contributed by bravecobra on May 09, 2005 - 09:12 PM

Ever saw those pictures telling you that hotlinking is not allowed? Some websites seems to run some code that prevents you from seeing the pictures that are located on their servers. You can only see the pictures when surfing on their site. You thought you're the clever one and you might have taken the picture's URL from their source and pasted it on your own website, resulting in another photograph than you intended. Now, did they do that? The URL you used, makes perfect sense, but still there is another one appearing.

What you are trying to do, is stealing their bandwidth and they don't like that. So before offering the picture to you, they check the referrer. If it matches their site, the correct picture is offered, if not they present you with something else or nothing at all.

Now you might have a picture gallery yourself and you realize that people are posting pictures, that are located in your gallery, all over the internet. Well, you too can prevent that. Here's how:

All you'll need, is the mod_rewrite Apache module to do that. The module is built in by default, however some ISP's might have taken it out. Contact your ISP administrator if it's not available.

The trick to the puzzle is no more than an .htaccess file. Should you have access to your Apache config file, you can also put the code there. Have look at its content:

RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC] 
RewriteRule \.(gif|jpg|png)$ - [F]

Let's explain. First we enable the Rewrite Engine and reformat the referrer string. Next we check the referrer string against a regular expression, representing our domainname (Be sure to replace <ins>example.com</ins> with your own domainname). If it's not us, then we deny access to anything with the gif, jpg or png extension. The image on the hotlinking website will then show up as not existing.

Seems we're almost there. Instead of denying access, we could also reformat the string and have it point to another picture. Look at the following:

RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC] 
RewriteRule \.(gif|jpg|png)$ http://www.othersite.com/nasty.gif [R,L]

Of course the nasty.gif needs to be located elsewhere or that one too will be blocked by our rule.
Should you want to use your pictures on other websites, just add a new ReWriteCond and they should become available on that website as well.

More information on how mod_rewrite is to be used, can be found here:http://httpd.apache.org/docs/mod/mod_rewrite.html.


Make movies brighter with mencoder

Contributed by bravecobra on Apr 20, 2005 - 10:21 AM

You bought a little camera that can make video's? Some of these camera's perfom very bad when there is not much light. Sometimes it's even impossible to recognize what the video represents. There must be a way to make these home video's a little brighter.

Mplayer includes a video encoder called Mencoder. With Mencoder you can also process the video before encoding. You can try this to make the clips brighter (and also noisy):

mencoder dark_video.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -vf eq=75:100 -o out.avi

In the example, the result video is in Divx 4/5 format. Try varying brightness/contrast values. Also, trying eq2 would be worth it, since it can adjust eg. gamma, brightness, saturation, and rgb channels independently. Eg this way (rgb not treated in this):

mencoder dark_video.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -vf eq2=0.5:1.9:1.1 -o out.avi

Happy encoding!


Photoshop for Linux = Gimpshop

Contributed by bravecobra on Apr 01, 2005 - 01:35 PM
Yes, it exists now. Actually it's still Gimp, but it looks exactly like Photoshop now. I found the article on /.. After following the links, I could download the source code at plasticbugs.com. Seems that guy is still looking for people to compile the source on other distro's. So, let's join in. It compiled perfectly on my Gentoo box (Seems time for an ebuild then). Happy compiling! [edit] The first gentoo ebuilds are being prepared. Check: http://bugs.gentoo.org/show_bug.cgi?id=87553

Emulating an OS with qemu

Contributed by bravecobra on Feb 25, 2005 - 01:59 AM

When you want to emulate a PC with a complete operating system on your computer, the most heard answer would be VMWare. Sure, for Linux, there is wine, but that package is targeted to handle only window$ and not all programs are supported. No, I'm talking about simulating a complete OS on a virtual PC with virtual hardware.

Although VMware does an almost perfect job at it, it isn't free software. Time to see what the Open Source community has to offer. That's when I stumbled upon qemu. Let's have a look at the possibilities.

But what is it actually? Well, qemu emulates a processor. You can then add-on virtual peripherals and we have a virtual PC on which we can install any OS (Check here for all supported OS's). On Linux we can also have qemu run programs that were actually compiled for another processor that the one that resides in your box. qemu is available for Linux, FreeBSD, MacOS and even window$.

Let's see whether we can have ie XP running as a guest OS on our Linux host with access to both the internet and the local network. A little screenshot as a preview:

qemu 

Now, qemu doesn't have a nice interface from which to start. It's a command line tool. It has several options with which you can specify peripherals of your choice.

It now also has a kernel module with which you can speed up the emulation. Quite impressive at that too. Unfortunately, this module only work with the current CVS code. Check it out at savannah.gnu.org. Don't forget to modprobe the new kernel module. Should you need any help building the code, I'd suggest getting it at the IRC channel #qemu on freenode.net. For Gentoo users, there is currently an experimental ebuild. Have a look at this forum post.


Writing udev rules

Contributed by bravecobra on Feb 11, 2005 - 09:02 AM
When I got my memory stick, I found it very useful to let it have its own personal entry in my /dev. Since my Gentoo box is running a 2.6 kernel with udev, it was time to investigate udev rule writing. I found this site to be particulary usefull: http://www.reactivated.net/udevrules.php
The next line in /etc/udev/rules.d/10-local.rules, did the trick:
BUS="scsi", SYSFS{model}="UsbFlashDisk", KERNEL="sd?1", NAME="%k", SYMLINK="usbstick"


It creates a symlink, called 'usbstick', to my usb scsi device which got added by hotplug.

Fedora 3 far from complete

Contributed by bravecobra on Feb 03, 2005 - 10:02 AM
And you thought that after installing the latest Fedora Core 3 on your brand new machine, that you had all the latest multimedia features of Linux. Think again. Yum, the engine used by Fedora, doesn't even include mplayer or xine. So what can you do to fix that?
I found a little website that can help you make your desktop completely multimedia ready:http://home.gagme.com/greg/linux/fc3-tips.php. A quite easy-to-follow guide to help you get your machine ready.

Gaming on Linux

Contributed by bravecobra on Jan 24, 2005 - 11:01 PM
I've heard many people say that gaming under Linux is almost impossible. Well, that ain't the truth! Apart from native Linux games (like NeverWinterNights), Transgaming provides you with Cedega, an enhanced version of wine that supports DirectX. That way you can get your favorite games installed. Agreed, not all of them work but most of them do. Have a look in their Games database to see what games are supported by Cedega.
And for the unsupported games, you might wanna take a look at the UnOfficial TransGaming Wiki on how to get them running too. Indeed, a vast resource of games 4 u to play under Linux. Try a piece of this!! :P.

NFS on Windows

Contributed by bravecobra on Jan 09, 2005 - 07:01 PM
Yep, it's possible. I always found it a pain to have samba installed on a Linux machine in order to have files shared to window$ boxes. Now it seems those days are over for me. I came accross a neat little program that offers NFS on window$. Just take a look at http://www.pavitrasoft.com/products/crossmeta/. At first glance it seems that it simulates a Linux root partition from which NFS can be started. I'll have to investigate all that a bit further, but it works for now... icon_smile

Linux humor

Contributed by bravecobra on Dec 29, 2004 - 02:12 AM
Talking about humor. Try this: http://comic.escomposlinux.org/. Real funny!

The Linux History

Contributed by bravecobra on Dec 29, 2004 - 01:12 AM
I found a nice little article on the history of Linux. You can find it here : http://www.linuxgazette.com/node/9721. Quite amusing actually. This Torvalds dude really has a great sense of humor icon_smile

Why mickey$oft?

Contributed by bravecobra on Dec 10, 2004 - 09:12 AM
Try reading these sites and still dare to ask me the question why!
http://www.euronet.nl/users/frankvw/rants/microsoft/IhateMS.html
http://www.msversus.org/

The wireless story (continued)

Contributed by bravecobra on Nov 25, 2004 - 02:11 PM
So I went back to the shop and got myself a SMC 2.4GHz 54Mbps Wireless Cardbus Adapter (SMC2835W V2 EU). Using this little card, which is supported by prism54.org I got my wireless network perfectly up and running with wep encryption up to 256bits. This shows you how carefull you have to be when buying hardware for Linux. Even though that previous card was perfectly allright when using window$, linux was a bit reluctant on this part. If only everything was opensource. That really would make life a lot easier.

The wireless story (DWL-G650+ on Linux)

Contributed by bravecobra on Nov 24, 2004 - 07:11 AM
Well I thought I'd start with a little wireless network at home..on Linux of course. 
So I plugged in a D-Link access point (DWL-2000AP+) into the switch and got that up and running pretty quickly. However then the trouble began.
I got myself a DWL-G650+ (Note the +). After searching the prism54.org website I found this card to be supported at least I thought it was. Great, a native linux kernel module. This module is even already in the gentoo-dev-sources(Gentoo's 2.6 kernel) that I use on my laptop. However, after compiling, there was no card detected. Seems that little plus ment that there is a complete different chipset on that card. What I would have needed(and did ask for at the store) was a DWL-G650 A1. Ok whatever, I can get this card to work too, right? So I started searching for a suitable driver. Seems the guys at http://acx100.sf.net were willing to do this. So let's get this card up and running. That's pretty much how far I got. It ran, but without wep encryption. This module doesn't seems to support that part "yet".
Time to head to the store again tomorrow and see whether I can change it for the one that I asked for in the first place.... I'll keep you posted.

Setting up Oracle on Linux

Contributed by bravecobra on Nov 17, 2004 - 05:11 PM
An excellent guide for setting up Oracle (the famous database) on Linux can be found right here : http://gentoo-wiki.com/HOWTO_Install_Oracle_10g. Although this is intended for a Gentoo distro, it might be very useful for any other Linux distro. The only thing that need changing are the startup scripts imho.

Wine on a Linux kernel v2.6.9

Contributed by bravecobra on Nov 17, 2004 - 04:11 PM
Eversince I upgraded my kernel to 2.6.9, I was unable to start wine properly. Up until kernel 2.6.8 everything was going great. So this must be a kernel thingie, right?
After Googling 'round a bit, I found the solution.
It seems that adding the following line to your /etc/sysctl.conf did the trick:
vm.legacy_va_layout = 1

Now you want to run 
sysctl -p

to load the parameter.
Now all your beloved games should run perfectly on a 2.6.9 Linux kernel.

Building a fullblown webserver - Part 2

Contributed by bravecobra on Jun 19, 2004 - 01:06 PM
Apache servers, ahh, probably the best webserver there is at the moment. Highly configurable and so many features. Proper configuration is a bitch however. Now why do I get that 403 page? Bad configuration is as good as outdated versions for hackers, so this part will need some extra attention. Block everything and then open up what you need. That's, most of the time, the best way to get started. 
Once that is done and you have your webserver up and running, let's have a look at virtual hosts in order to run multiple websites on one server. The "Include" word comes to mind. We also want to log everything in order to have webalizer generate graphs of our web traffic.
Now how are we going to get stuff onto the webserver? Well the classic way, through an ftp server. Its logs can also be parsed by webalizer.
And that should about cover it. icon_smile

Building a fullblown webserver - Part 1

Contributed by bravecobra on Jun 17, 2004 - 11:06 PM
I've come to the conclusion that building a fullblown webserver is a lot more difficult than was expected. You have to think of all kinds of things. Just Apache with MySQLand PHP isn't enough. You need a mail server, FTP access, SSH and DNS server. Furthermore you want to log stuff, make reports, rotate your logs and,oh yeah why not a cvs server while we're at it.
Now that would be great if it all was for just one domain, but that's not the case. You want your server to able to handle multiple domains, that means multiple email addresses, more FTP accounts, etc....
Now there are some packages available for doing just that. One of them is Plesk (http://www.sw-soft.com). Tough part is that they only support some Linux distributions, but not Gentoo (my favorite!).
So I wanted to have a go at it and tried looking to get it going. Soon I noticed that that would takes why to much patching and altering, making it so difficult for you as administrator to keep track and what when they upgrade. You'd have to do it all again. No, I prefered configuring the server myself.
And so I'm now, configuring the server myself. Today I took on the battle of the mail server, using postfix and courier-imap, which turned out to be configurable in MySQL. Ain't that great ? icon_smile I've already done a big part of the Apache server too, but that one still need some extra work to be fully secure.
Anyways more to follow next time.

Installing a secure webserver.

Contributed by bravecobra on Jun 12, 2003 - 08:46 PM
Thanks to the guys of http://www.linux-scripts.nl, I was able to provide you with an article on how to setup a secure webserver. You'll find some useful info on log rotation and webalizer too.

Hope this will guide you to setting up a working secure webserver. Using such a secure server (for let's say banktransactions icon_smile ), will be covered in one of the following guides.
First Page Previous Page Page 2 / 2 (26 - 44 of 44 Total)