zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Aptitude search

October 31, 2010 by Igor Drobot Leave a Comment

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'

aptitude search virtualbox -F '%p%V'

Filed Under: Bash, Linux Tagged With: aptitude, aptitude search

Top funny source code comments

October 31, 2010 by Igor Drobot Leave a Comment

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?
}

/* * 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

// if i ever see this again i'm going to start bringing guns to work

[Read more…]

Filed Under: Fun, Linux Tagged With: Funny code

‘Argument list too long’

October 18, 2010 by Igor Drobot Leave a Comment


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

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

or

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

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

Filed Under: Bash, Debian, Linux, Ubuntu Tagged With: bash, limit, rm

Data Recovery

October 5, 2010 by Igor Drobot Leave a Comment

Each of you looses already some important files like photos or important documents.
After a normal Windows crash it’ s not a problem to get all your data back.
I show you some methods to get your data back.

These two examples are taken directly from the ddrescue info pages.

Example 1: Rescue an ext3 partition in /dev/hda2 to /dev/hdb2

1
2
3
dd_rescue /dev/hda2 /dev/hdb2 -l logfile.txt
e2fsck -v -f /dev/hdb2
mount -t ext3 -o ro /dev/hdb2 /mnt

dd_rescue /dev/hda2 /dev/hdb2 -l logfile.txt e2fsck -v -f /dev/hdb2 mount -t ext3 -o ro /dev/hdb2 /mnt

If you have a damaged hard disk /dev/sda1 and you have an empty space hard disk /dev/sdb1 You can copy data from /dev/sda1 to /dev/sdb1 use the following commnd

1
2
3
dd_rescue /dev/sda1 /dev/sda2/backup.img
# To mount use:
mount -t ext3 /dev/sda2/backup.img mnt/ -o loop

dd_rescue /dev/sda1 /dev/sda2/backup.img # To mount use: mount -t ext3 /dev/sda2/backup.img mnt/ -o loop

Example 2: Rescue a CD-ROM in /dev/cdrom

1
ddrescue -b 2048 /dev/cdrom cdimage logfile

ddrescue -b 2048 /dev/cdrom cdimage logfile

Filed Under: Bash, Debian, Linux, Ubuntu Tagged With: dd, dd_rescue. restore data, HDD recovery

CCNA Exploration 4 – Module 4

September 26, 2010 by Igor Drobot Leave a Comment

Configure R1 with OSPF simple authentication:

1
2
3
4
5
R1(config)#router ospf 1
R1(config-router)#area 0 authentication
 
R1(config-router)#interface S0/0/0
R1(config-if)#ip ospf authentication-key cisco123

R1(config)#router ospf 1 R1(config-router)#area 0 authentication R1(config-router)#interface S0/0/0 R1(config-if)#ip ospf authentication-key cisco123

1
2
3
R2(config)#interface S0/0/1
R2(config-if)#ip ospf authentication message-digest
R2(config-if)#ip ospf message-digest-key 1 md5 cisco12

R2(config)#interface S0/0/1 R2(config-if)#ip ospf authentication message-digest R2(config-if)#ip ospf message-digest-key 1 md5 cisco12

Configure Router to support Cisco SDM:

1
2
3
4
5
6
7
8
9
10
R1# configure terminal
R1(config) # ip http server
R1(config) # ip http secure-server
R1(config) # ip http authentication local
R1(config) # username Student privilege 15 secret cisco
R1(config) # line vty 0 4
R1(config-line) # privilege level 15
R1(config-line) # login local
R1(config-line) # transport input telnet ssh
R1(config-line) # exit

R1# configure terminal R1(config) # ip http server R1(config) # ip http secure-server R1(config) # ip http authentication local R1(config) # username Student privilege 15 secret cisco R1(config) # line vty 0 4 R1(config-line) # privilege level 15 R1(config-line) # login local R1(config-line) # transport input telnet ssh R1(config-line) # exit

Additional security for VTY:

1
2
3
4
R1 (config) # line vty 0 4
R1 (config-line) # exec-timeout 3
R1 (config-line) # exit
R1 (config) # service tcp-keepalives in

R1 (config) # line vty 0 4 R1 (config-line) # exec-timeout 3 R1 (config-line) # exit R1 (config) # service tcp-keepalives in

Additional tricks:

1
2
3
Router (config) # crypto key generate rsa
Router (config) # ip ssh time-out 15
Router (config) # ip ssh authentication-retries 2

Router (config) # crypto key generate rsa Router (config) # ip ssh time-out 15 Router (config) # ip ssh authentication-retries 2














Supports incoming telnet and SSH sessions:

1
2
3
4
R1 (config) # line vty 0 4
R1 (config-line) # no transport input
R1 (config-line) # transport input telnet ssh
R1 (config-line) # exit

R1 (config) # line vty 0 4 R1 (config-line) # no transport input R1 (config-line) # transport input telnet ssh R1 (config-line) # exit

Supports only incoming SSH sessions:

1
2
3
4
R1 (config) # line vty 0 4
R1 (config-line) # no transport input
R1 (config-line) # transport input ssh
R1 (config-line) # exit

R1 (config) # line vty 0 4 R1 (config-line) # no transport input R1 (config-line) # transport input ssh R1 (config-line) # exit

Filed Under: Linux Tagged With: CCNA4, Cisco, Securiry

  • « Previous Page
  • 1
  • …
  • 51
  • 52
  • 53
  • 54
  • 55
  • …
  • 62
  • Next Page »
Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok