Posts Tagged ‘linux’

Moar BackTrack 4 and eeePC

Tuesday, December 8th, 2009

I re-did my eeePC 701 last night and now have BackTrack 4 pre-final booting from a 2GB USB drive and using the 4GB SSD for persistent changes.  My process is very similar to what the guys from Offensive Security showed.

Items I used:

  • bt4-pre-final.iso
  • 4GB SSD (/dev/sda)
  • 16GB USB (/dev/sdb)
  • 2GB USB (/dev/sdd)

Here are the steps:

  1. Follow the video but substitute the proper device paths where applicable
  2. When editing the menu.lst, add this to the KERNEL line:  changes=/dev/sda1
  3. ?????
  4. Profit

Post questions, complaints, etc in the comments.

BackTrack 4 on eeePC 701

Monday, March 2nd, 2009

Here are the quick steps for installing BackTrack 4 (beta) to an SDHC card on your eeePC.

  1. Download BackTrack 4 ISO
  2. Create a bootable USB (thumb) drive with UNetBootin
  3. Partition the SDHC card for at least one FAT32 partition
    • Partition type 0xC in fdisk
  4. Format the FAT32 partition
    • The apt package dosfstools contains mkfs.vfat
  5. Mount the new FAT32 partition to /mnt/bt
  6. Mount the ISO on loopback
    • mkdir ~/lbt && sudo mount -o loop ~/bt4-beta.iso ~/lbt
  7. Copy the boot and BT4 directories to the mounted FAT32 partition
    • sudo cp -Rv ~/lbt/* /mnt/bt
  8. As root (sudo), run the script /mnt/bt/boot/bootinst.sh
  9. If no errors occur, reboot the computer and hit ESC on boot to boot from the SD slot
  10. Make a ‘changes’ directory on the card (alongside boot and BT4) where modifications can be stored
    1. sudo mkdir /mnt/sdb2/changes
  11. Edit /mnt/sdb2/boot/syslinux/syslinux.cfg and modify this block:
    • LABEL BT4
    • MENU LABEL BT4 Beta – Console
    • KERNEL /boot/vmlinuz
    • APPEND vga=0×312 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 changes=/dev/sdb2 rw quiet
  12. Save the file and reboot

You can start with a simple test to see if it worked.  Add a user for yourself and put yourself in sudoers.  Reboot and if the new user account is still present and has sudo access, then it worked.  I am pretty sure it took longer to type this than it did to install BackTrack.

Load > 4000, is this bad? (y/n)

Friday, February 27th, 2009

One of our systems at work is doing some heavy crunching, check this out.

load average: 4040.80, 4685.54, 4773.97

I am trying to get it OVER 9000!!!!!!!

aptitude and apt-get

Tuesday, February 3rd, 2009

Read this: http://pthree.org/2007/08/12/aptitude-vs-apt-get/

Back story: Yesterday someone on SILC asked about the difference between aptitude and apt-get, and why to use one over the other. I haven’t looked at the source code so could only provide reasons based on anecdotal evidence. The link posted above contains a concise write-up by Aaron Toponce on the difference between these apps.

Extracting lines with sed

Friday, January 30th, 2009

Say you have a file and want to pull a line out of the middle, for example line 4 from functions.php:

  • sed -n 4p functions.php

function uuid() {

If you want to pull a range, say lines 4 through 10:

  • sed -n 4,10p functions.php

function uuid() {
return sprintf( ‘%04x%04x-%04x-%04x-%04x-%04x%04x%04x’,
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
mt_rand( 0, 0x0fff ) | 0×4000,
mt_rand( 0, 0x3fff ) | 0×8000,
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
}

Shenanigans with screen

Friday, January 30th, 2009

I just had a neat learning experience with screen.  My session became locked to me accidentally hitting Ctrl s instead of Ctrl a.  Thanks to this post, I now understand what happened and a few ways to fix and/or prevent.  The original is pretty concise so feel free to stop reading this and browse there; or just read on.

  • Ctrl s sends an XOFF which stops character flow.
  • Ctrl q sends an XON which starts character flow.

That is the short term fix, Ctrl q will right the ship.  For longer-term prevention, add this line to your ~/.bashrc:

  • stty ixoff -ixon

In short, thanks to Morgy for a great post.