Transperent windows in xorg and other fancy stuff

First you need a recent xorg, (6.8.x) the one in gentoo portage will work.
configure X as you would otherwise do adding following to you config file:

Section "Extensions"
    Option "Composite" "Enable"
    Option "RENDER" "Enable"
EndSection


If you have either an ati card or nvidia card you should add the respectivly
changes to your card-device section i your configfile.

Nvidia:
Option      "RenderAccel" "true"

Ati:
Option      "backingstore" "true"

Its a good idea to have som kind of hardware acceleration , my 1700mhz Pentium
M (Aprox 2.8ghz P4) with one gig of RAM are laggy as hell without ati drivers.

Add following line to make.conf (must be removed after this or you will break 
things)
ACCEPT_KEYWORDS="~x86"

emerge xcompmgr transset

Start x and run

xcompmgr -c 

and watch as your windows are being shadowed. You can tweak your settings if 
you want, xcompmgr -h should tell you enough to do so.

With xcompmgr -c running (for an instance put it in .xinitrc with a tailing & 
to make it go into background) you can run transset and click on a window to 
make it transperent.

I am thinking about hacking a fluxbox version to support tranperency nativly, 
if i do so it will be announced here later :)



OBS : 
redeeman CyberMike: foreløbig, kan du ændre det til kun at bruge ACCEPT_KEYWORDS="~x86" emerge xcompmgr
redeeman det giver det samme som at indsætte det, emerge og fjerne
redeeman windzor: begge ting virker, det er bare officielt korrekt at bruge package.keywords, fordi det er nemmere at holde styr p
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

UltraX genvejstaster i LinEAK

emerge linerakconfig og lineakd

/etc/lineakkb.def

[UltraX]
  Brandname = "Logitech"
  modelname = "UltraX"
  [KEYS]
    WWW = 178
    Mail = 236
    Favoritter = 230
    PlayPause = 162
    Media = 237
  [END KEYS]
[END UltraX]

Man må bare ikke trykke på mute for
så går lineakd ned.....
Der er ikke nogene keycode på mute så den kan ikke bruges....
Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar

FreeBSD Trafic Shaping

http://www.bsdnews.org/02/dummynet.php

Udgivet i Uncategorized | Skriv en kommentar

FreeBSD Trafic Shaping

http://www.bsdnews.org/02/dummynet.php

Udgivet i FreeBSD, Knowledge Base, Links, Old Base | Skriv en kommentar

Software raid in freebsd

you can if you want add:
device   ccd

but it shouldnt be necesary:

ccdconfig ccd1 32 0 /dev/ad0 /dev/ad1

Unites ad0 and ad1 in a harddisk named ccd1 which has twice the size

Save config:

ccdconfig -g > /etc/ccd.conf

echo /dev/ccd1 /store ufw rw 1 1 >> /etc/fstab , to mount during boot.


If you want mirroring do
ccdconfig ccd 32 CCDF_MIRROR /dev/ad0 /dev/ad1



# You can join two arrays as well

ccdconfig ccd3 32 0 /dev/ccd1 /dev/ccd

Unites the two arrays ccd1 and ccd2 in ccd3
Udgivet i FreeBSD, Knowledge Base, Old Base | Skriv en kommentar

Enabling 3d Support in Fedora Core 2

Remove any NVIDIA Drivers before proceding.

Hent ATI Drivers til XFree86 4.30

http://www.ati.com/support/drivers/linux/radeon-linux.html

Hent Fedora Core 2 Patch
http://www.fedoraforum.org/forum/attachment.php?attachmentid=3340

Derefter aabner du en terminal som root og henter kernesovs.

# yum install kernel-sourcecode

Installer ATI Drivere

# rpm -Uvh --replacefiles fglrx-4.3.0-*.i386.rpm

Apply the patch

# cd /lib/modules/fglrx/build_mod
# gunzip -c /tmp/fglrx-fedora.patch.gz | patch -p1

Build the module and install it
# sh make.sh
# cd ..
# sh make_install.sh

Now we need to install it, switch to runleve 3

# telinit 3

Login as root and remove current radeon drivers

# rmmod radeon
# rmmod fglxrx

Configure the the new driver and create x config file

# fglrxconfig

Symlink the ned config file
# cd /etc/X11
# mv xort.conf xorg.conf.bak
# ln -sf XF86Config-4 xorg.conf

Apply this fix , its a mouse error the fglrxconfig introduces
# sed -i 's/\dev\/mouse/\/dev\/input\/mice/g' /etc/X11/xorg.conf

Start X again
telinit 5

I stole this guide from : http://fedorafaq.org/#radeon
Udgivet i Knowledge Base, Linux, Old Base, Workstation | Skriv en kommentar

gprs internet på en nokia telefon

opret en modemforbindelse der bruger mobil telefonen som modem, og brug flg opkalds data:

tlf nr: *99***1#
bruger: ingen
kode: ingen

det sidste 1 tal skal måske skiftes hvis mobilen kører på et andet CID
Udgivet i Knowledge Base, MobilPhone, Old Base | Skriv en kommentar

redirect of banned users in firewall

the table `macs` have a field `mac` which identifies the banned computer, and a field `status` which identifies the state of the computer.

to redirect the users:
<pre>
for mac in $( echo "SELECT mac FROM macs WHERE status='banned';" | mysql -u fwuser bannedusers | grep -v mac ); do
        iptables -t nat -A PREROUTING -i eth1 -p tcp -d ! 10.0.0.1 -m mac --mac-source $mac --dport 80 -j REDIRECT --to-port 8080
done
</pre>

access are restricted to hosts other than the local (10.0.0.1)
Such connections are directed to port 8080 on the local machine.

on port 8080 a virtualhost runs with index.php that redirects to example.org/banned.php and a ErrorDocument 404 directive that also points at example.org/banned.php. (and thus catches subdirs and other pages in the original request)

index.php:
<pre>
<?
header("Location: http://example.org/banned.php");
?>
</pre>

.htaccess:
<pre>
ErrorDocument 404 http://example.org/banned.php
</pre>

virtualhost:
<pre>
<VirtualHost 10.0.0.1:8080>
    DocumentRoot /var/www-banned/
    ServerName gateway.example.org
</VirtualHost>

<Directory /var/www-banned/>
    Options Indexes Includes FollowSymLinks MultiViews

    AllowOverride All

    Order allow,deny
    Allow from all
</Directory>
</pre>

remember:
<pre>
Listen 80
Listen 8080
</pre>
in httpd.conf
Udgivet i Apache, Old Base | Skriv en kommentar

redirect of banned users in firewall

the table `macs` have a field `mac` which identifies the banned computer, and a field `status` which identifies the state of the computer.

to redirect the users:
<pre>
for mac in $( echo "SELECT mac FROM macs WHERE status='banned';" | mysql -u fwuser bannedusers | grep -v mac ); do
        iptables -t nat -A PREROUTING -i eth1 -p tcp -d ! 10.0.0.1 -m mac --mac-source $mac --dport 80 -j REDIRECT --to-port 8080
done
</pre>

access are restricted to hosts other than the local (10.0.0.1)
Such connections are directed to port 8080 on the local machine.

on port 8080 a virtualhost runs with index.php that redirects to example.org/banned.php and a ErrorDocument 404 directive that also points at example.org/banned.php. (and thus catches subdirs and other pages in the original request)

index.php:
<pre>
<?
header("Location: http://example.org/banned.php");
?>
</pre>

.htaccess:
<pre>
ErrorDocument 404 http://example.org/banned.php
</pre>

virtualhost:
<pre>
<VirtualHost 10.0.0.1:8080>
    DocumentRoot /var/www-banned/
    ServerName gateway.example.org
</VirtualHost>

<Directory /var/www-banned/>
    Options Indexes Includes FollowSymLinks MultiViews

    AllowOverride All

    Order allow,deny
    Allow from all
</Directory>
</pre>

remember:
<pre>
Listen 80
Listen 8080
</pre>
in httpd.conf
Udgivet i Apache, Knowledge Base, Linux, Networking, Old Base | Skriv en kommentar

CPAN Quickstart

http://www.cpan.org

First time

# perl -MCPAN -e shell

Some configuration options will be asked.

>> install NSNMPD::Simpe

Installation will go on

>> … install more

or

>> quit

Next time configuration will not be asked.

Udgivet i Knowledge Base, Old Base, Uncategorized | Skriv en kommentar