/etc/environment file holds the system-wide environment variables. (*). For a command file session playing with .basrc file is better I think.
While I was opening my Ubuntu system the electricity went off. When electricity was back I reopened the system and I faced with a crash of the system telling me unable to mount /proc etc.
I followed
http://art.ubuntuforums.org/showthread.php?t=1601810&highlight=mounting+dev+on+root+dev+failed+no+such+file+OR+directory&page=2
but it did not solve so I then reopen the system with a ubuntu livecd and made fsck -fC /dev/sdb1 command multiple times.
Yeah everything is back.
When I tried to install gentoo and finally open my system I realized that the ethernet connection was broken. After a search I saw that it was due to lack of the hdpc packet so I had to go back to the live CD and emerge it. If I want to emerge a packet on my system with a live CD then I should chroot. I simply adopted something from the installation guide of gentoo.
I opened the system with a live CD and fell into the gentoo live session then I did the following (I assume that you have configured eth0)
mkdir /mnt/temp mount /dev/sda3 /mnt/temp mirrorselect -i -o >> /mnt/temp/etc/make.conf mirrorselect -i -r -o >> /mnt/temp/etc/make.conf cp -L /etc/resolv.conf /mnt/temp/etc/ mount -t proc none /mnt/temp/proc mount -o bind /dev /mnt/temp/dev chroot /mnt/temp /bin/bash env-update >> Regenerating /etc/ld.so.cache... source /etc/profile export PS1="(chroot) $PS1" |
now you have chroot and have an alive internet connection
emerge hdpc >> when everything finishes reboot |
if you eject the live CD and permit the system start then you will have a system on which hdpc is installed.
go to http://hplipopensource.com/hplip-web/install_wizard/index.html
However still I could not manage to solve the problem.
Hey back again did what it said here and yes everything is fine again.
Adopted from http://www.linux.org/docs/ldp/howto/Bash-Prompt-HOWTO/x237.html Let’s see :
When a file is sourced (by typing either source filename or . filename at the command line), the lines of code in the file are executed as if they were printed at the command line. This is particularly useful with complex prompts, to allow them to be stored in files and called up by sourcing the file they are in.
In examples, you will find that I often include
#!/bin/bash |
at the beginning of files including functions. This is not necessary if you are sourcing a file, just as it isn’t necessary to
chmod +x |
a file that is going to be sourced. I do this because it makes Vim (my editor of choice, no flames please – you use what you like) think I’m editing a shell script and turn on colour syntax highlighting.
I am using Ubuntu since 8.10 and in recent months I started to use more frequently. However as I upgraded to 10.04 it really started to respond slower. I am looking for an advice on the net for this situation apart from a fresh install. As I find a solution I will share here.
Here again. I applied the things in here and well now it is faster. Actually I could not follow the updates whether if an update fixed the problem but in my opinion etc/hosts fixes it.
Write this
sudo service gdm restart |
taken from http://doctus.org/showthread.php?t=41474
a good lesson about use of bashrc. Functions and aliases a final code snippet is here.
echo -en "\033[1;36m" echo " /\ _ _ _ " echo " / \ __ _ _ __ ___| |__ | (_)_ __ _ ___ __ " echo " /' \ / _\` | '__/ __| '_ \| | | '_ \| | | \ \/ / " echo " /_- ~ -\ | (_| | | | (__| | | | | | | | | |_| |> < " echo " / \ \__,_|_| \___|_| |_|_|_|_| |_|\__,_/_/\_\ " echo " / _- - _ '\ " echo " /_-' '-_\ " echo -en "\033[0m\n" # Fortune echo fortune echo # Check for an interactive session [ -z "$PS1" ] && return PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[m\] ' #bash completion. if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi # Aliases # General Aliases alias fontup="sudo fc-cache -v" alias ls="ls --color=auto" alias reboot="sudo reboot" alias rconf="sudo nano /etc/rc.conf" alias shutdown="sudo shutdown -h now" alias source="source /home/wargasm/.bashrc" alias xorgconf="sudo nano /etc/X11/xorg.conf" # Pacman Aliases alias ins="sudo pacman -S" alias pacclean="sudo pacman -Rs $(pacman -Qtdq)" alias pacinfo="pacman -Qi" alias paclocs="sudo pacman -Qs" alias pacs="pacsearch" alias rem="sudo pacman -R" alias syscl="sudo pacman -Scc" alias sync="sudo pacman -Sy" alias sysup="sudo pacman -Syu" # Yaourt Aliases alias yains="yaourt -S" alias yarem="yaourt -R" alias yainfo="yaourt -Qi" alias yaup="yaourt -Syu --aur" # Functions arsivle () { FILE=$1 case $FILE in *.tar.bz2) shift && tar cjf $FILE $* ;; *.tar.gz) shift && tar czf $FILE $* ;; *.tar.lzma) shift && tar --lzma cf $FILE $* ;; *.tgz) shift && tar czf $FILE $* ;; *.zip) shift && zip $FILE $* ;; *.rar) shift && rar $FILE $* ;; esac } ayikla () { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xvjf $1 ;; *.tar.gz) tar xvzf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar x -v $1 ;; *.gz) gunzip $1 ;; *.tar) tar xvf $1 ;; *.tbz2) tar xvjf $1 ;; *.tgz) tar xvzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *.7z) 7z x $1 ;; *) echo "don't know how to extract '$1'..." ;; esac else echo "'$1' is not a valid file!" fi } pacsearch () { echo -e "$(pacman -Ss $@ | sed \ -e 's#core/.*#\\033[1;31m&\\033[0;37m#g' \ -e 's#extra/.*#\\033[0;32m&\\033[0;37m#g' \ -e 's#community/.*#\\033[1;35m&\\033[0;37m#g' \ -e 's#^.*/.* [0-9].*#\\033[0;36m&\\033[0;37m#g' )" } twit () { echo "User: " read user echo "Pass: " read -s pass echo "" curl -u $user:$pass -d status="$1" http://twitter.com/statuses/update.xml } |
This is taken from http://www.anand-iyer.com/blog/?p=22 (thanks). The steps are.
1. Install necessary tools for building:
sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3 |
2. It turns out that otcl does not like the version of gcc installed by default in Lucid. So go ahead and change ns-allinone-2.34/otcl-1.13/Makefile.in. Find the line that says:
CC= @CC@ |
and change it to:
CC= gcc-4.3 |
3. Now try doing ‘./install’ from the ns-allinone-2.34 directory. It should work.
Then I added the following in command line
export LD_LIBRARY_PATH=<YOUR_NS_PATH>/ns-allinone-2.34/otcl-1.13:<YOUR_NS_PATH>/ns-allinone-2.34/lib export TCL_LIBRARY=<YOUR_NS_PATH>/ns-allinone-2.34/tcl8.4.18/library export PATH=$PATH:<YOUR_NS_PATH>/ns-allinone-2.34/bin:<YOUR_NS_PATH>/ns-allinone-2.34/tcl8.4.18/unix:<YOUR_NS_PATH>/ns-allinone-2.34/tk8.4.18/unix |
if you want these paths be permanent you must do something in the bashrc file.