ubuntu tips collection


collection of useful tips, i found at places and tested and they worked well and i doubt some point in time in space i might need those and have forgotton. so putting them all here
 




TEMP ROOT ACCESS IN TERMINAL
  • sudo su

TEMP ROOT ACCESS IN EXPLORER (NAUTILUS)
  • gksudo nautilus (alt +F2 and type)
PERMANENT ROOT ACCESS IN EXPLORER (NAUTILUS)
  • install from synaptic manager
  • nautils-gksudo
MAKING A SCRIPT FOR NAUTILUS TO OPEN IN GEDIT AS ROOT
gedit ~/.gnome2/nautilus-scripts/gedit-root
  • Copy the following lines into the file and save it and close it.
#created by Arnav Ghosh (United States)
foo=`gksudo -u root -k -m "enter your password for gedit root access" /bin/echo "Do you have root access?"`
sudo gedit $NAUTILUS_SCRIPT_SELECTED_URIS
  • Then make it executable with
chmod +x ~/.gnome2/nautilus-scripts/gedit-root
thats it you are all set. Now right click on any file in nautilus and under "scripts" u will find "gedit-root"
click and enjoy!
UBUNTU GPG keys errors ( update manager not working right, having issues in downloading udpates )
apt-get update -o Acquire::http::No-Cache=True

Setting permissions recursively

sudo chown -R username:username foo/
chmod 755 -R foo/

Reset Xorg back to Failsafe Defaults

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.original
sudo dpkg-reconfigure -phigh xserver-xorg

adding environment variables mehtod 1 fails on restart

printenv >> prints all
printenv PATH >> print path variable value
echo $PATH >. does same
PATH = bla/bla >> will assign a value. scope dependency
to add path permanently different ways, pc / user / session
user is /.profile file>> it will overright pc values (if defined)
quick is pc direct values sample below
sudo gedit /etc/gdm/gdm.conf >> open file in gedit
search "DefaultPath" , append your value at end with :
save, restart gdm

adding environment variables mehtod 2

sudo gedit /etc/environnment
add >> PATH=#PATH;/directory

adding pythonpath to permanent pyhtonpath

sudo gedit ./bashrc
export PYTHONPATH=/home/lala/maya/scripts/mapy2.5.6

running multiple commands from launcher

gnome-terminal -x bash -c "cd /usr/local/Cutter; java -classpath .:/usr/local/Cutter/cutter.jar Cutter"
gnome-terminal -x bash -c "cmd1; cmd2; read -n1"


killing a process (by name from shell)

sudo pkill -9 name ( best tip for me )

e.g: sudo pkill -9 maya

changing display manager from ubuntu to kubuntu etc

sudo dpkg-reconfigure gdm


No comments:

Post a Comment