Posts Tagged ‘linux’

Proxying all Linux Traffic – set web access for Ubuntu behind a proxy


2010
10.22

So that it’s documented… I’m using port 8080 as the default port as the likelyhood of your upstream proxy being on 8080 is high – else, typical proxy ports are, of course, 80, 800 (transpartent), 8000, 3128 (squid)

To force your server to force web traffic via a proxy, just two quick things to set – in /etc/environment, export one (or two) variables: (more…)

Intel Gigabit Ethernet Card on an old kernel?


2010
10.21

For self-reference, mainly:

For the Intel Corporation 82574L Gigabit Network Connection on an old kernel that doesn’t have the drivers compiled into it – get the driver and

make install

it on the platform you’re on, and to be sure (if it doesn’t get done for you) to copy to /lib/modules/2.4.36/kernel/drivers/net/ (your kernel may vary, this is an example only) (more…)

Symbolic links in Windows


2010
06.28

Windows Vista and 7, if not before, allow symbolic links — mklink is your command-line friend!

Creates a symbolic link. (more...)

Ubuntu 10.04 LTS now in beta


2010
03.20

Ubuntu 10.04 LTS (beta) now out...

Ubuntu 10.04 went beta yesterday afternoon, with downloads at http://releases.ubuntu.com/10.04/, otherwise from the download mirrorsLucid Lynx, as it’s called, enjoys LTS support (ie 5 years out the box).

This version promises as a better (and faster) boot experience, new themes, version 2.6.32 as the Linux kernel, Firefox as default browser — with default browser page changed to Yahoo! (that’s new!) nVidia hardware support using open source drivers has improved, and a whack of new features for the Ubuntu Enterprise Cloud have been included. (more…)

Wipe all mp3s and avis from the filesystem


2009
09.08

So you want to run a script that removes all mp3 and avi files off the filesystem. One way (in bash) as below. Comment, suggestions and feedback are welcome :) Using $EUID to check for root user, and $IFS to check for line breaks as the file names has spaces in them. IFS is saved to a temp variable, reset and then re-instated afterwards. C is the counter. Got two litte for loops in bash with backtick execution.

(more...)

Copying files from one server directory to another (without sapping resources)


2009
06.03

cp just saps resources when transferring large volumes of data between directories. Especially on old machine memory usage spikes when the process is started and the machine becomes almost unresponsive. That’s on large volumes of data (and old hardware).

Enter rsync stage left. OK, none of this is new (you know all this already) — it’s really just to have in one spot:

No mess no fuss transfer from one server to the other (straight transfer via SSH):
rsync -av -e ssh username@oldhost:/home/old_home/ /home/new_home/

Synchronising your local to a remote directory:
rsync -r -a -v -e "ssh -l username" --delete webhost:/var/www /local/var/www

Synchronizing your remote directory to the (current) local directory:
rsync -r -a -v -e "ssh -l username" --delete /local/var/www webhost:/var/www

-r recurses, -z compresses, -v is verbose and -e is obvious

With large volumes of data (DVD isos etc) your processor is still going to be taxed (twice) — via ssh and rsync – but not quite as intensively as on the cp.

To copy files between two local directories, rsync does the job, too:
rsync -vur --delete --exclude=*.EXT1--exclude=*.EXT2 /folder1 /folder2

Quick, simple, gracious.

But you knew that already… :)

Ubuntu 8.04 Dual-screen


2008
07.22

From the bug-report there’s a simple solution to dual-screening on Hardy…

Users upgrading from Dapper Drake to Hardy Heron who have used Xinerama to support dual monitors now have to use a different method (xrandr I think). This isn’t mentioned in the release notes and the graphical tool for configuring dual monitors is under “Screen Resolution” in the System -> Preferences Menu. The point being that it is quite hard to find.

Users with multiple desktops appear to have add the following to the xorg.conf file “Screen” section:

SubSection “Display”
Depth 24
Virtual 4000 2048
EndSubSection

Then the screen resolution tool works fine for me.

Me too! Just to complete this (it’s all out there…):

Unfortunately, for creating dual-screen layouts there is still one manual configuration step required, which is to add a Virtual framebuffer size. The size needs to be equal or greater than the maximum combined size of your displays. For example, if you have two 1920×1200 monitors you wish to put side-by-side, you would add a Virtual line like this:

Section "Screen"
        Identifier      "Default Screen"
        Device          "Configured Video Device"
        DefaultDepth    24
        SubSection "Display"
            Depth           24
            Virtual         3840 1200
        EndSubSection
EndSection

Note that setting Virtual to larger than 2048×2048 disables 3d acceleration (i.e., no Compiz).

Treason uncloaked


2008
05.21

This kind of error message has been popping up in some of the servers’ log files (mainly in the US):

1
 X Time(s): TCP: Treason uncloaked! Peer 195.166.XXX.YYY:18549/80 shrinks window 94463210:94463211. Repaired.

Doing any kind of google.com search (or yahoo.com for that matter) doesn’t give much of a hint as to what that’s all about.

There’s a mix of opinions.

RedHat Magazine puts this down to an “informative message. It is not a problem with the system.” which is rightly chastised by the comments following it.

Other scenarios are provided, such as that it’s a low-level DoS attack (to simply keep sockets open that will use up resouces)

This is backed up by the comment (hurray for comments!!) in the tcp_timer.c code in the ipv4 net code:

/* Receiver dastardly shrinks window. Our retransmits
* become zero probes, but we should not timeout this
* connection. If the socket is an orphan, time it out,
* we cannot allow such beasts to hang infinitely.
*/

So, it’s highly likely that it’s a tar-pit somewhere that’s trying to eek out resources.

A blunt approach would

1
iptables -A INPUT -s 195.166.XXX.YYY -j DROP

quite a definite defense mechanism (should they not be spoofing, which they most probably are…) — in this case, they claim to be from Nicaragua…

Two alternative explanations present themselves:

  • a seriously old TCP receiver stack OR
  • a mobile device that purposefully starts with small windows to start off with…

Not highly likely…

Will keep monitoring :)