My little Tips and Tricks [en]

I have been setting up a Tips and Tricks file for myself, little bits of everything I use (either for me or to help people) and never remember because I do not use them so often. This post will be sort of a sticky note where I can easily retrieve them when I am not on my own Ubuntu box. If you happen to have little Tips and Tricks, thank you for sharing them ;-)

  • To know my IP from a command line : wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d\< -f 1
  • To know which debian/ubuntu release is installed : lsb_release -cd
  • To get a screenshot from gnome environment after a specific action is done (ie with a delay) : gnome-panel-screenshot --delay=10
  • To get a GDM screenshot, install imagemagick, go to GDM login screen, then to a tty (CTRL+ALT+F2) and chvt 7 ; sleep 5 ; XAUTHORITY=/var/lib/gdm/:0.Xauth DISPLAY=:0.0 sudo import -window root gdm-screenshot.png; chvt 2. The file gdm-screenshot.png will be saved in your current directory file
  • Do not want to use a .htaccess file in a directory of your site, but do not want people to freely browse through, but still get or see specific files ? Put an empty index.html file in that directory
  • I do not remember who I am : either $ logname or $ whoami
  • Who is currently logged in my box $ users
  • Who can logon : either $ cat /etc/passwd | awk -F: '$3 == 0 || $3 > 500 { print $0 }' or $ grep /bin/bash /etc/passwd
  • My iud, gid, groups $ id

edit :

from cep's comment on the french entry : zenity --info --text=" `wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d\< -f 1 ; /sbin/ifconfig eth0 |grep inet\ adr | awk '{ print $2} ' |cut -d: -f 2 `" will show your public IP along with the lan address in a nice box. Thank you cep :-)

References

http://forum.ubuntu-fr.org/viewtopic.php?pid=530625#p530625
http://ubuntuforums.org/showthread.php?t=2127
http://www.ubuntuforums.org/showthread.php?t=330432
€mix@m in ubuntu@chat.jabberfr.org

About these ads

2 thoughts on “My little Tips and Tricks [en]

Comments are closed.