View Poll Results: How useful was my tutorial?

Voters
0. You may not vote on this poll
  • great

    0 0%
  • good

    0 0%
  • ok

    0 0%
  • bad

    0 0%
  • horable!

    0 0%
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: HOWTO: save changes. the easy way (newbie proof)

  1. #1
    Just burned his ISO
    Join Date
    Sep 2008
    Posts
    10

    Post HOWTO: save changes. the easy way (newbie proof)

    Hi all you BackTrackers! Are you tired of useing:
    Code:
    dir2lzm /mnt/live/memory/changes changes.lzm; mv changes.lzm /mnt/sdb1/BT3/base
    ???

    What if you could do all that and more with just:
    Code:
    save
    Now wouldn't that be better??

    Well, i have a way. Not only will this save your current changes, but it will merge them with the old! So after awhile you done end up with 50 files.

    now lets do some background of the script. its FULLY automated! all you need is to have your BT3 folder on the root of your USB drive (if you can boot with out..let me know) and only that drive.

    NOTE!: if you have a folder named "BT3" on the root of any other drive the script will get confused and may save the file on the wrong drive or produce unexpected results.

    So first things first; lets make sure your in the HOME directory
    Code:
    cd ~
    "cd is a unix command that is used to "Change Directory"
    Next lets make the script make a file named "save.sh".
    Code:
    touch save.sh
    "touch" is commonly used to make/create files from shell
    NOTE: you can do that in Konqueror if you feel more comfertable
    Now lets just make sure its executable before we forget.
    Code:
    chmod 755 save.sh
    Now most of you programers know this part but "chmod" changes the mode of the file. if you simply try to run save.sh you will get:
    -bash: ./save.sh: Permission denied
    this means in its current mode it can not be executed
    now lets open the file and copy and past this script
    Code:
    #!/bin/sh
    #NAME: save.sh
    #AUTHOR: pc
    #COMPANY: pcap
    #EMAIL: none...that you need...
    #INFO: this is a script i made to merge two .lzm
    #files to keep up to date and to make backtrack easy to use
    
    USBDRIVE=`find /mnt/*/BT3 -maxdepth 0`
    lzmdir=${USBDRIVE}/base/
    changes=/mnt/live/memory/changes
    tempTEMP=/tmp/TEMP/
    tempdir=/tmp/
    lzm=changes.lzm
    
    if [ -s ${lzmdir}/$lzm ]; then
    	echo "changes.lzm found. mergeing old and new."
     
    	mkdir ${tempTEMP}	
    	mv $lzmdir$lzm ${tempTEMP}$lzm
    	lzm2dir ${tempTEMP}$lzm ${changes} 
    	rm -r ${tempTEMP}
    	dir2lzm ${changes} $lzm -skipcheck
    	mv $lzm ${lzmdir}$lzm
    	exit
    else
    	echo "change.lzm not found. making a new one."
     
    	dir2lzm ${changes} $lzm -skipcheck
    	mv $lzm ${lzmdir}$lzm
    	exit
    
    fi
    now save and exit.
    WOOH thats not that hard was it?...good...

    On to the good stuff: lets put it in place so we can make sure it doesn't get harmed. lets put it in the /usr directory (you can put this any wareas long as you remember you put it, this is just so its out of the way.)
    you can do this in Konqueror or just type
    Code:
    mv ~/save.sh /usr/save.sh
    So after that we need to do some more things. we need to make a .profile file. but we need it make it in the home folder (we cannot just edit .bashrc or even /etc/.profile the changes to the file will not be saved. or atleast i cant get them to save for me)

    So lets make the .profile file.
    Code:
    touch ~/.profile
    And make it accessible.
    Code:
    chmod 755 ~/.profile
    now lets put in the aliases
    NOTE!: if you have any other aliases you need to copy them to this new file or else they will not work!

    Code:
    #my alias's for speed of hacking and conveanince
    unalias -a
    alias save='/usr/save.sh'
    #PUT YOUR OTHER ALIASES IN THIS FILE
    NOTE: you can put other aliases in this file or even change what the alias is. like change"save" to "changes" or even "beef" anything you want!
    ANOTHER NOTE: the part where it says " '/usr/save.sh' " IF you changed where the file is, this is where you put the file! or it will not work
    Well thats nice. were all most done!
    lets make our "save" command work
    Code:
    source ~/.profile
    and now...LETS SAVE!!!
    Code:
    save
    wow that was alot but its worth it dont you think?

    WERE DONE!!!! YAY!!!! now if you want to learn more Bourne shell. you can go ooblick.com/text/sh/ (sorry about the weird format i cant post urls yet

    ---------------
    MY ~/.profile
    ---------------

    Code:
    #my alias's for speed of hacking and conveanince
    unalias -a
    
    #lists all with more detail
    alias dir='dir -al --color'
    
    #lists all in detail and on page by page
    alias dirp='dir -al --color |more'
    
    #lists all
    alias lA='ls -a'
    
    #lists all but "./" and "../"
    alias la='ls -A'
    
    #THIS is the save script
    alias save='/usr/save.sh'
    
    #i make this typo alot so i just fixed it
    alias cd..='cd ..'
    
    #the next  few lines are for my bluetooth hacking to 
    #incress my speed of hacking
    
    #alias for hciconfig
    alias hci='hciconfig'
    
    #alias hcitool
    alias hcit='hcitool'
    
    #alias for bluebugger
    alias bug='bluebugger'
    
    #makes hci0 up and running
    alias hciup='hciconfig hci0 up'
    
    #makes hci1 up and running
    alias hci1up='hciconfig hci1 up'
    
    #scans for bluetooth devices on default hci device
    alias scan='hcitool scan'
    
    #scans for bluetooth devices on hci1
    alias scan1='hcitool -i hci1 scan'
    
    
    #makes a file
    alias mkfile='touch'
    
    #this opens konqueror (i was tired of spelling it)
    alias kon='konqueror'
    
    #this is default for most ls
    alias ls='ls --color'
    
    #save aliases useing another of my costom scripts
    alias savea='/usr/savealias.sh'
    
    #make new aliases work
    alias updatebash='source .profile'
    
    #edit ~/.profile to add/remove aliases
    alias profile='kwrite ~/.profile'
    
    #open wifi assistant
    alias wifi='wlassistant'
    well i hope this was help full. so if you have modifications or improvements to this script please tell me

    and it would be cool if all you added your aliases for fun
    Code:
    .:pcap:.

  2. #2
    Just burned his ISO
    Join Date
    Apr 2008
    Posts
    2

    Default

    There is an error in the HOWTO

    The changes.lzm file should be placed in the BT3/modules folder and not the BT3/base folder, at least on the USB install.

  3. #3
    My life is this forum Barry's Avatar
    Join Date
    Jan 2010
    Posts
    3,817

    Default

    What's the difference between this and a changes partition?
    Of course, if you really wanted to have some fun, go to Wal-Mart late at night and ask the greeter if they could help you find trashbags, roll of carpet, rope, quicklime, clorox and a shovel. See if they give you any strange looks. --Streaker69

  4. #4
    Just burned his ISO
    Join Date
    Sep 2008
    Posts
    10

    Default

    Quote Originally Posted by Barry View Post
    What's the difference between this and a changes partition?
    the difference is that, with MY expeaence with the changes partition, it saves every 5 to 10 minutes. and, some people may not always want to save what they were working on, some times i just fiddle and end up with so many scripts on my desktop its full. the whole reason i made this is to save changes before i exit backtrack. with the changes partition it wouldn't always save before i exit.

    Quote Originally Posted by redtool View Post
    There is an error in the HOWTO

    The changes.lzm file should be placed in the BT3/modules folder and not the BT3/base folder, at least on the USB install.
    thats the only way it worked for me i placed them in the BT3/modules folder and they did not load

  5. #5
    Developer
    Join Date
    Mar 2007
    Posts
    6,124

    Default

    The next person that creates a poll to ask how good was his post,idea or tutorial is going to get banned. The polls are not real designed for this sort of thing. It is meant for mods and admins to use to poll forum members about how this place could be better and not to feed some kids ego about his tutorial.

  6. #6
    Junior Member ktzqbp's Avatar
    Join Date
    Nov 2008
    Posts
    25

    Default

    Did I just not write a guide on how to do this yesterday???

    Edit: I guess you're right in saying the difference is automated saving and prompted saving. Fair play.

  7. #7
    Just burned his ISO
    Join Date
    Sep 2008
    Posts
    10

    Exclamation

    Quote Originally Posted by ktzqbp View Post
    Did I just not write a guide on how to do this yesterday???

    Edit: I guess you're right in saying the difference is automated saving and prompted saving. Fair play.
    thank you

    thank you for your time. .:~pc~:.

  8. #8
    Just burned his ISO Dimus's Avatar
    Join Date
    Dec 2008
    Posts
    16

    Default Works for me...

    Hey its saving files.. Thats all i needed to do. I changed the background but it didnt save that though -shrugs-. I got sick of trying to create a new partition and go through the process only to keep having "operator errors". But this was fast and simple. And ill buy it for a dollar

    Thanks PC...
    +Dimus+

  9. #9
    Junior Member
    Join Date
    Sep 2008
    Posts
    85

    Default

    does this save things such as passwords in firefox?
    patience is appreciated =]

  10. #10
    Just burned his ISO Dimus's Avatar
    Join Date
    Dec 2008
    Posts
    16

    Default

    hmm.. actually i couldnt figure out how to get the files off my desktop so i got rid of it.. and went back to normal..
    +Dimus+

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •