apt-get bash foo

November 13th, 2007

Apt-get returns the error: “E: Dynamic MMap ran out of room”

 

This is caused because the cache is too small to handle all of the packages in the flavour of Debian that you are using. The fix for this is trivial, just add the following line into /etc/apt/apt.conf:

 

APT::Cache-Limit 12582912;

 

If that file does not exist, create it. If you still get the same error, increase the value.

 

How do I list all the packages I have installed?

 

The easy way is to do:

 

dpkg -l

 

But this has issues since some of the package names are truncated due to the column width. A more accurate way is to do:

 

COLUMNS=200 dpkg -l

 

You can further define that command by showing only those packages which are installed:

 

COLUMNS=200 dpkg -l | awk '/^ii/ {print $2}'

 

For additional information about this, there’s some excellent examples on the ManagingPackages/Apt page.

 

Reinstall all packages

 

Sometimes there is a need to reinstall all packages currently on your system. This can be achieved by:

 

COLUMNS=200 dpkg -l | awk '/^ii/ {print $2}' | xargs apt-get --reinstall install

 

Note the use of the environment variable ‘COLUMNS’ which ensures that the package names are not truncated on output. A value of 200 is usually sufficient for those packages that have long names.

 

Removing leftover files after removed packages

 

If you remove a package without purging it, configuration files related to that package are left behind. If you want to remove these leftover files, you can run:

 

COLUMNS=200 dpkg -l | awk '/^rc/ {print $2}' | xargs dpkg --purge

 

Removing dependencies of packages no longer required

 

This is often related to meta-packages which are empty packages depending on a large number of packages so that a suite of applications can be installed (’build-essential’ and ‘gnome-desktop-environment’ are such examples). Removing these meta-packages is perfectly valid, and will leave the dependencies behind (although aptitude may well remove them). If you wanted to remove the dependencies as well; and you are using apt-get; you can use debfoster and deborphan. Deborphan was originally written to handle removing libraries and so to get it to recognise packages that are not libraries, run:

deborphan --all-packages

 

Installing a package and ignoring its dependencies

 

I’m often asked “How do I install a package and not install its dependencies”. The answer is that you don’t. If you do, you can be expected to sort out the mess yourself since you must have had a good enough reason to ignore it in the first place. If you’re still sure you know that you want to disregard the package handling, read dpkg --force-help, although until you fix the dependencies manually, you won’t be able to use apt-get. That said, there might be a valid reason whereby you need to fool the system into thinking you have a package installed. In such instances you should use equivs, but this not meant as a replacement to fix dependencies.

 

How do I install a .deb file?

 

dpkg -i ./the_file.deb

 

How do I extract files in a .deb file?

 

dpkg -x ./file.deb /some/directory

 

Can I clone an existing Debian install on another machine?

 

Sure, here’s how. On the machine that has all the packages installed that you want replicated to another machine, as root, run the command:

 

dpkg --get-selections > ./selectionfile

 

After the base install has finished on the other machine, copy the “selectionfile” to this machine and run the command:

 

dpkg --set-selections < ./selectionfile && apt-get dselect-upgrade

 

This will then install all of the packages from the list specified.

 

How do I stop packages being upgraded when I update my system

 

By default when you install packages on your system, the next time you go to upgrade it those packages will be updated. There are times when this is not desirable (such as wanting to retain a copy of an installed package you had made yourself). To stop a package from being updated, you can use:

 

echo "packagename hold" | dpkg --set-selections

 

How do I upgrade packages that are on hold?

 

In addition to the answer above, the reverse of that is:

 

echo "packagename install" | dpkg --set-selections

 

If you want to upgrade all held packages regardless, you can tell apt-get to do so:

 

apt-get --ignore-hold upgrade

 

Although this does not affect the state of a package afterwards, it just causes apt to conveniently forget about the status of all held packages for the initial update. To make the change to a package’s status permenant, you’ll want to use the first example.

 

Note also that putting packages on hold this way means that they will be ignored by aptitude, should you be using that. This is a known bug. You have been warned.

 

I installed unstable by mistake. How do I downgrade?

 

You don’t. Short answer, eh? The reason being that to do so is a pain in the arse. It’s possible, but unless you like to play ‘pinning’ games with apt, the canonical answer is to reinstall, this time using the correct flavour of Debian. For the curious, a good reference is here: http://people.debian.org/~osamu/downgrade.html

 

An alternative is to amend your source.list file to use testing sources, and wait a long time before upgrading. After a few months, the packages in testing will be of a newer version that those that were in unstable when you installed it. Running the usual apt-get update && apt-get dist-upgrade combination will install the packages that have newer versions in testing. Note though that there’s no guarantee that the packages in testing will be newer that those that were in unstable. I refer to this technique as “sidewaysgrading”.

 

I want to install a newer version of a package not available in Stable

 

Since the packages that stable contains is set in stone, the version that you install them at will remain at that version. This can sometimes be problematic, since you may well want a newer version of a package installed. This is where backports are handy. There are two main sites for these:

 

http://www.backports.org
http://apt-get.org

 

If you cannot find the package you want in either of these you can always grab the source package and build it yourself. The following achieves that:

 

Add a deb-src line for unstable in /etc/apt/sources.list, something like:

 

deb-src http://mirror.ox.ac.uk/debian/ unstable main apt-get update apt-get build-dep packagename apt-get -b source packagename

 

This will then pull the dependencies of the package you’re after and build it against them for inclusion on your stable box. Note that this is not always a good idea, and you can break your system if the dependencies have changed significantly.

 

Debian doesn’t use an /etc/rc.{boot,local} file?

 

/etc/rc.local or /etc/rc.boot are the boot scripts used by BSD / Redhat / SuSE. It’s lazy, and you should use other means under Debian. If you simply try and create an /etc/rc.boot file under Debian, it won’t get read. The proper way of doing it is to use the sysvinit method via the command update-rc.d (see /RunLevels for more information). Although this can sometimes be daunting. If you simply wanted to have a script run at startup, you can create an /etc/rc.boot directory, and place your script(s) inside that directory. You should ensure that the file permissions are set to 0755; both on the directory, and the scripts contained therein.

 

I can’t compile anything, what do I need to install?

 

apt-get install build-essential

 

What’s the difference between an upgrade and a dist-upgrade?

 

Upgrading software on your machine involves installing newer version of packages that are available. Like many people this will involve the use of the internet, whereby packages are downloaded from mirror sites. If you’re using Debian Stable, then the only new releases you’ll get are security ones. If you’re not, then these packages will be downloaded as needed.

 

An upgrade (via apt-get upgrade for example) will only install those packages which do not depend on packages not yet installed on your system. So for example, let’s say that there was an upgraded package “cowsay” that you had installed on your system. If that package’s depenencies are already installed on your system then it will be installed without fuss. If the “cowsay” package dependencies however, showed that there were some packages not installed on your system it would be “held back”. This is why when you upgrade you sometimes see many packages held back.

 

A dist-upgrade however will upgrade all packages regardless of whether the dependencies are installed already or not. Generally this is the option that most people use when upgrading their system.

 

When I do an update, I get lots of packages held back, why?

 

See the answer above. What you want to do is:

 

apt-get -u dist-upgrade

 

Do I have to do anything special when a new stable release is made?

 

That depends on what you have in your sources.list file. Depending on how you installed your system you may find that you have a line that looks like:

 

deb http://mirror.ox.ac.uk/debian/ stable main

 

If you’re using the word “stable” as opposed to the nickname of the distribution (e.g. “Woody” or “Sarge”) then a dist-upgrade when the stable release is made will upgrade you to the new release. If, however, you are using the nickname, liek “Woody” or “Sarge” on your deb lines, then you will have to ensure that you change that to the nickname of the new stable release as and when you want to upgrade to it.

 

So, using the nicknames gives you more control over when and whether you upgrade to a Debian release, but requires a little more work when you do want to upgrade. Using the release type (e.g. stable) means that you have less to do to upgrade, but you will upgrade to the new version when it is released.

 

Note that when a new stable release is made, the security releases for the old version it will remain usually for up to six months post Sarge’s release. But by that time, you’d have upgraded… For more information see the /DebianReleaseProcess page.

 

Debian no longer asks me configuration questions when I install new packages

 

First of all, this could simply be because the package in question doesn’t have any questions to ask you. However if you know that it does, and you’re not seeing any, run the following:

 

dpkg-reconfigure debconf

 

and select “dialog”.

 

How do I re-run the configure screen for a specific package?

 

Debian’s “configuration” program is handled by “debconf”. This is what certain packages use when asking questions. To run it for packages you can do:

 

dpkg-reconfigure <packagename>

 

If you are unsure of the package name, you can install and use the package configure_debian. In this way, you can then run the command: configure_debian and use the menu-based navigation screen to select the package(s) that you want to reconfigure.

 

My keymap is messed up at the console. How do I fix this?

 

dpkg-reconfigure console-data

ip_conntrack: table full, dropping packet.

November 13th, 2007

dd-wrt http://www.dd-wrt.com/ provides open linux firmwares for Linksys WRT54G routers

  • when experiencing when doing some p2p very slow response from internet, a customization is required to increase the ip_conntrack buffer for avoiding the nat table to be full. In order to check if this is the issue log in to the router and check for dmesg to see if you have such messages:
ip_conntrack: table full, dropping packet.

The remedy is the following:

echo "81920" > /proc/sys/net/ipv4/ip_conntrack_max

or modify under Administration/Management tab increase

IP Filter Settings (adjust these for P2P)

to 4096 and set timeouts to 3600

Lusers

October 22nd, 2007

———————————————————
Helpdesk: What kind of computer do you have?
Female customer: A white one…
———————————————————-

Hi, this is Celine. I can’t get my diskette out.
Helpdesk: Have you tried pushing the button?
Customer: Yes, sure, it’s really stuck.
Helpdesk: That doesn’t sound good; I’ll make a note …”
Customer: No … wait a minute… I hadn’t inserted it yet… it’s still on my desk… sorry….
———————————————————-

Helpdesk: Click on the ‘my computer’ icon on to the left of the screen.
Customer: Your left or my left?
———————————————————-

Helpdesk: Good day. How may I help you?
Male customer: Hello… I can’t print.
Helpdesk: Would you click on start for me and…
Customer: Listen pal; don’t start getting technical on me! I’m not Bill Gates damn it!
—————————– —————————–

Customer: Hi good afternoon, this is Martha, I can’t print.
Every time I try it says ‘Can’t find printer’.
I’ve even lifted the printer and placed it in front of the monitor,
but the computer still says he can’t find it…
———————————————————-

Customer: I have problems printing in red…
Helpdesk: Do you have a color printer?
Customer: Aaaah………………..thank you.
———————————————————-

Helpdesk: What’s on your monitor now ma’am?
Customer: A teddy bear my boyfriend bought for me in the supermarket.
——————————————————————–

Helpdesk: And now hit F8.
Customer: It’s not working.
Helpdesk: What did you do, exactly?
Customer: I hit the F-key 8-times as you told me, but nothing’s happening…
———————————————————-

Customer: My keyboard is not working a nymore.
Helpdesk: Are you sure it’s plugged into the computer?
Customer: No. I can’t get behind the computer.
Helpdesk: Pick up your keyboard and walk 10 paces back.
Customer: OK
Helpdesk: Did the keyboard come with you?
Customer: Yes
Helpdesk: That means the keyboard is not plugged in. Is there another keyboard?
Customer: Yes, there’s another one here. Ah…that one does work!
———————————————————-

Helpdesk: Your password is the small letter a as in apple, a capital letter V as in Victor, the number 7.
Customer: Is that 7 in capital letters?
———————————————————-

A customer couldn’t get on the internet.
Helpdesk: Are you sure you used the right password?
Customer: Yes I’m sure. I saw my colleague do it.
Helpdesk: Can you tell me what the password was?
Customer: Five stars.
———————————————————-

Helpdesk: What antivirus program do you use?
Customer: Netscape.
Helpdesk: That’s not an antivirus program.
Customer: Oh, sorry…Internet Explorer.
———————————————————-

Customer: I have a huge problem. A friend has placed a screensaver on my computer,
but every time I move the mouse, it disappears!
———————————————————-

Helpdesk: Microsoft Tech. Support, may I help you?
Old woman: Good afternoon! I have waited over 4 hours for you.
Can you please tell me how long it will take before you can help me?
Helpdesk: Uhh..? Pardon, I don’t understand your problem?
Old woman: I was working in Word and clicked the help button more than 4 hours ago.
Can you tell me when you will finally be helping me?
———————————————————-

Helpdesk: How may I help you?
Customer: I’m writing my first e-mail.
Helpdesk: OK, and, what seems to be the problem?
Customer: Well, I have the letter ‘a’ in the address, but how do I get the circle around it?
———————————————————–

Windows error opening Internet shortcut or local HTML file - Firefox

October 9th, 2007

This script fixes the following errors

  • * Bug 246078 (2windows) – URLs from other apps result in two Firefox windows or a window and an error dialog (Set as Default Browser does a lousy job creating ddeexec keys)
  • * Bug 353089 – Fix / remove ddeexec hack
  • * Bug 359630 – Windows cannot find ‘SHORTCUT’ when clicking link from desktop after crash
  • * Bug 367899 – FirefoxHTML%5CShell%5COpen%5CCommand is added to URLs linked to from another application
  • * Bug 370053 – Clicking a URL shortcut icon opens two instances of Firefox


If MsgBox("Remove DDE Actions for Firefox?", vbQuestion+vbYesNo, "Script Runtime") = vbYes Then
' Specify file types from which to remove DDE actions
Dim strArray
strArray = Split("FirefoxHTML|FirefoxURL|ftp|gopher|HTTP|https", "|")
' Create shell object to edit Windows Registry
Dim sh
Set sh = WScript.CreateObject("WScript.Shell")
' Loop through file types and delete DDE branches
On Error Resume Next
Dim strReport, intCount, strKey
strReport = "Script Results:" & vbCrLf & vbCrLf
For intCount = 0 To UBound(strArray)
strKey = "HKEY_CLASSES_ROOT\" & strArray(intCount) & "\shell\open\ddeexec\"
sh.RegRead strKey
Select Case err.Number
Case 0
strReport = strReport & "Found DDE branch for " & strArray(intCount)
' Remove subkeys (ignore errors if they don't exist)
sh.RegDelete strKey & "Application\"
sh.RegDelete strKey & "Topic\"
sh.RegDelete strKey & "ifExec\"
If Not (err.Number = 0) Then err.Number = 0
' Remove DDE key itself
sh.RegDelete strKey
If err.Number = 0 Then
strReport = strReport & " -- Successfully removed!" & vbCrLf
Else
strReport = strReport & " -- Error removing it! (" & err.Description & ")" & vbCrLf
err.Clear
End If
Case Else
strReport = strReport & "Error finding DDE branch for " & strArray(intCount) & "! (" & err.Description & ")" & vbCrLf
err.Clear
End Select
Next
' Clean up & confirm actions
On Error Goto 0
Set sh = Nothing
MsgBox strReport, vbInformation+vbOkOnly, "Script Runtime"
End If

Installer for Console2

October 3rd, 2007

Taken from the Project page http://sourceforge.net/projects/console

Console is a Windows console window enhancement. Console features include: multiple tabs, text editor-like text selection, different background types, alpha and color-key transparency, configurable font, different window styles

By default it comes as a simple zip file.

Now because I prefer to keep my installed in a cleaned up orderly fashion I’ve created a install package for windows installer.

As an added bonus i’ve added the option of registering “console.exe” in your PATH environment variable allowing you to run console from ” Start > Run “

console-ii-setup.tar.gz

Additional Screenshot:

screenshot

The upcoming (Nuclear) war with Iran, A Word fromt he Underground.

September 20th, 2007

Several weeks ago, on August 30, 2007, critical nuclear weapons personnel were activated at Minot AFB under the guise of a classified, unspecified operation. 6 cruise missiles, equipped with W-80 tactical nuclear warheads, were loaded onto a B-52 bomber, purportedly for transport to Barksdale AFB for ‘decommissioning’[1,2]. Less well-known, however, is that Barksdale AFB acts as a staging ground for Middle Eastern operations[3,4].
In 2003, CONPLAN 8022-02[5,6] was devised in order to provide nuclear first strike options against “hostile” anti-US nations, including Iran and North Korea, which involves deployment of tactical nuclear weapons, most notably the W-80.
An anonymous whistleblower involved in the operation managed to leak information relating the movement of the missiles; it is believed that the movement was part of the initial stages of an unprovoked first strike against Iran[4]. Given the high procedural complexity of the transport and activation of the missiles and warheads, the stringent requirements on critical nuclear weaponry personnel under the Personnel Reliability Program, and the potential consequences of a lost nuclear warhead, the explanation provided by the Defense Department[1,2] is unlikely to the extreme[7]. In the aftermath of the disclosure, the cover-up orchestrated — putting the Pinnacle - empty quiver scenario down to a mere ‘mistake’ — also involved the interrogation and detention of those involved. Further, reports indicate that within days of the disclosure, several personnel met their untimely demise through ‘accidents’[7,8,9,10,11,12,13] — in a ludicrously transparent demonstration of the stakes involved. The opposing view in [7] is of great interest, as it appears to be an attempt to reduce the fallout of such exposes as this. As a staff sergeant supposedly involved in network security, the question is raised: how would a network security engineer have intimate knowledge of the details of nuclear weapon systems? The less-than-laudable excuse of working with a ‘trainee munitions specialist’ fails to dispel such doubts. The critique given later, however, does a more thorough job of debunking the response.

That those behind this operation are willing to go to such lengths to pursue this agenda is a dangerous precedent, endangering the lives and freedom of both the soldiers — steeped with honorable intentions though they may be — and anyone who may pose a threat to the realisation of this reckless plot to catapult the world into a third world war. As the popular aphorism has it, the first casualty of war is truth — and so we are obliged to expose these realities, lest these plans come to fruition, and the true extent of the possible casualties becomes apparent.

1. “Air Force Investigates Alleged Nuke Transfer, Pentagon Spokesman Says”
2. “DoD News Briefing with Press Secretary Geoff Morrell from the Pentagon, Arlington, Va.”
3. “Staging Nuke for Iran?
4. “Was a Covert Attempt to Bomb Iran with Nuclear Weapons foiled by a Military Leak?
5. “Not Just A Last Resort?
6. “Nuclear War againstIran
7. “Minot AFB Clandestine Nukes ‘Oddities’
8. “Minot Base Officials Say Airman Dies While On Leave”
9. “Caddo deputies work double-fatality accident”
10. “Minot Air Force Base Airman Dies on Leave
11. “Authorities identify Minot airman killed in crash”
12. “Bomber pilot killed in crash ” [possibly unrelated, c.f. date]
13. “Body of missing Air Force captain found

Adwords is Fucking useless

August 28th, 2007

Google adwords is fucking useless.

You spend 70 dollars bidding on random keywords and STILL not a single fucking conversion

CPC advertising is dead. I’m going to ditch this shit until they start providing me CPA advertising.

Starting OpenBSD Secure Shell server: sshdPRNG is not seeded

August 4th, 2007

I ran into a rather annoying error on a debian VPS. There’s alot of stuff on it out there, but here’s the actual fix i found on a mailing list.

 

From: Dave Crossland
Date: Mon, 25 Jun 2007 02:02:23 +0100

 

On 18/06/07, Henning Sprang wrote:
> On 6/18/07, Dave Crossland wrote:
> > Hi,
> >
> > I have tried to install a Debian domU on a Centos5 dom0 by using alien
> > to convert xen-tools and its dependency .deb packages for Etch and
> > installing them with rpm. Is this a good approach?
>
> Alien is always a bit of a “dirty” approach - it works for some
> packages, and not for others.
> But AFAIK, theres no nice packages alien for fedora/redhat, just for suse.

Yes, I had to build alien from source, so I suppose I might just as
well have built xen-tools and debootstrap from source also.

> Or help building proper rpm’s (I don’t know how this is done, but if
> you use centOs a lot, and want xen-tools, this is the way to go -
> knowing to package for your dist of choice is a good thing anyway.
> And Steve will probably be glad to put necessary patches in to build rpm’s…

Yes, I’ll certainly consider this if I get the job I’m currently on a
short term contract for.

> And then, debootstrap needs the argument –arch - AFAIk(as debootstrap
> detects this with dpkg, which you don’t have on centos)

Ah, classic RTFM goof: somehow I missed the –arch arg, and it means I
don’t need dpkg. Perfect!

I built my Debian domU with the following command:

xen-create-image –verbose –boot –cache –fs ext3 –image full
–memory 512 –passwd –size 5G –swap 1G –dist etch –mirror
http://ftp.uk.debian.org/debian/ –hostname myfull.domain.net –ip
1.2.3.4 –netmask 255.255.255.0 –gateway 1.2.3.1 –dir /srv/xen
–kernel /boot/vmlinuz-2.6.18-4-xen-686 –initrd
/boot/initrd-2.6.18-4-xen-686.img –debootstrap –arch=i386

I then folded these args into xen-tools.conf for future use :-)

On 18/06/07, Steve Kemp wrote:
>
> The only part I’m unsure about is installing debootstrap on non-Debian
> systems.

The alien’d .deb from Etch installed perfectly, so I guess it will
install from original sources just fine too :-)

My next problem is that when the domU is created, the final boot messages are:

- - - 8< - - -
Starting kernel log daemon: klogd.
* Not starting internet superserver: no services enabled.
Starting OpenBSD Secure Shell server: sshdPRNG is not seeded
Starting periodic command scheduler: crond.

Debian GNU/Linux 4.0 myfull.domain.net tty1

myfull.domain.net login:
- - - 8< - - -

Searching for “PRNG is not seeded” I see from
http://lists.cvsrepository.org/xen-tools/Jun06/0047.html that this is
a rare problem with xen-tools, where the /dev/urandom device isn’t
created for some reason. Here’s what I did:

dell:~# /usr/sbin/sshd -t
PRNG is not seeded
dell:~# ls -1 /dev
MAKEDEV
console
initctl
log
mapper
md1
null
ptmx
pts
ram0
ram1
ram10
ram11
ram12
ram13
ram14
ram15
ram2
ram3
ram4
ram5
ram6
ram7
ram8
ram9
root
rtc
sda1
sda2
shm
systty
tty
tty0
tty1
tty10
tty11
tty12
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
ttyS0
ttyS1
ttyS2
ttyS3
xconsole
zero
dell:~# cd /dev/
dell:/dev# ./MAKEDEV generic
dell:/dev# ls -la | grep urandom
crw-rw-rw- 1 root root 1, 9 Jun 25 00:57 urandom
dell:/dev# /usr/sbin/sshd -t
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
dell:/dev# /etc/init.d/ssh start
Starting OpenBSD Secure Shell server: sshd.
dell:/dev#

Steve, I was hoping to make it to Edinburgh for Debconf but sadly
couldn’t make it - but next time I’m in town I’ll surely buy you a
beer :-)


Regards,
Dave

Schoolgirl loses “virginity ring” battle

July 17th, 2007


Yahoo Story

With a face like that you don’t choose to be a virgin till marriage, it’s a fucking GIVEN.

www.msfirefox

July 2nd, 2007

Someone is going to get sued for this…..