Monthly Archive for October, 2010

Aptitude search

Very useful search hack for aptitude, to compare package versions. Normaly you see the versions if you open aptitude and it takes to much time.

1
aptitude search virtualbox -F '%p%V'

Top funny source code comments

Some funny comments from different codes found around the net:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * OK; before you read the following code know what I am trying to do.
 * I needed to get the list of child catagories from the root node so that
 * the root node didn't appear in the selection box. But for some stupid
 * fucking reason the stupid fucking DBA wont let me access the items using
 * indices and I instead have to use their stupid fucking Iterator
 * implementation. So there.
 */
$firstList = $this->getRootNode()->getChildren();
foreach ($firstList as $node)
{
    $nodes = $node->getChildren();
    break;                // wtf?
}
1
// if i ever see this again i'm going to start bringing guns to work

Continue reading ‘Top funny source code comments’

Installing Remote Server Administration Tools for Windows 7

Microsoft Remote Server Administration Tools enables IT administrators to remotely manage roles and features in Windows Server 2008 from a computer running Windows Vista or Windows 7. It includes support for remote management of computers running either a Server Core installation or the full installation option of Windows Server 2008. It provides same functionality to Windows Server 2003 Administration Tools Pack
Continue reading ‘Installing Remote Server Administration Tools for Windows 7′

Secure Cisco devices

Some cisco basic command to secure your device against logins.
You should execute this command always on your routers/switches.
DonĀ“t forget to replace the “cisco” password!

Set a console password to cisco:

1
2
3
Router(config)#line con 0
Router(config-line)#login
Router(config-line)#password cisco

Set a telnet password:

1
2
3
Router(config)#line vty 0 4
Router(config-line)#login
Router(config-line)#password cisco

Stop console timing out:

1
2
Router(config)#line con 0
Router(config-line)#exec-timeout 0 0

Set the enable password to cisco:

1
2
3
4
Router(config)#enable password cisco
Router(config)#enable secret class
# No Plain-Text passwords more
Router(config)#service password-encryption

‘Argument list too long’


root@web2:$ rm pe-warn-*.bz2
-bash: /bin/rm: Argument list too long

This peoblem happens when you are trying to delete too many files in a directory at the same time – it seems rm has special limits …

To solve the problem:
Use:

1
find . -name 'pe-warn-*.bz2' | xargs rm

or

1
find . -name "pe-warn-*.bz2" -delete