Advertisement
diegocaetanop

etc/bashrc

Sep 10th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.06 KB | None | 0 0
  1. # /etc/bashrc
  2.  
  3. # System wide functions and aliases
  4. # Environment stuff goes in /etc/profile
  5.  
  6. # For some unknown reason bash refuses to inherit
  7. # PS1 in some circumstances that I can't figure out.
  8. # Putting PS1 here ensures that it gets loaded every time.
  9. alias which="type -path"
  10. export EDITOR="pico"
  11. export VISUAL="pico"
  12. PS1="\u@\h [\w]# "
  13.  
  14. whoami=`whoami`
  15. if [ -e "~/.dns" ]; then
  16.     DNS=`cat ~/.dns`
  17.     PS1="\u@$DNS [\w]# "
  18. else
  19.     if [ -e "/var/cpanel/users/$whoami" ]; then
  20.         eval `grep DNS= /var/cpanel/users/$whoami`
  21.  
  22.         if [ ! "$DNS" = "" ]; then
  23.             echo -n "$DNS" > ~/.dns
  24.             PS1="\u@$DNS [\w]# "
  25.         fi
  26.     fi
  27. fi
  28.  
  29. if [ ! -e ~/public_html/cgi-bin ]; then
  30.         mkdir -p ~/public_html/cgi-bin
  31. fi
  32. if [ ! -e ~/public_ftp ]; then
  33.         mkdir -p ~/public_ftp
  34. fi
  35.  
  36. mesg y
  37.  
  38. #alias monitor_logins="watch -n 1 w -hs"
  39. #alias list_processes="ps -uxa | more"
  40. # Now for the dos users
  41. alias dir="ls"
  42. alias copy="cp"
  43. alias del="rm"
  44. alias deltree="rm -r"
  45. alias move="mv"
  46. alias ff="whereis"
  47. alias attrib="chmod"
  48. alias edit="pico"
  49. alias chdir="cd"
  50. alias mem="top"
  51. alias search="grep"
  52. alias pico="pico -w -z"
  53.  
  54.  
  55. LS_OPTIONS='--color=tty -F -a -b -T 0';
  56. export LS_OPTIONS;
  57. alias ls='/bin/ls $LS_OPTIONS';
  58. alias dir='/bin/ls $LS_OPTIONS --format=vertical';
  59. alias vdir='/bin/ls $LS_OPTIONS --format=long';
  60. alias d=dir;
  61. alias v=vdir;
  62. eval `dircolors -b`
  63.  
  64.  
  65. export JAVA_HOME=/usr/local/jdk
  66. export PATH=$JAVA_HOME/bin:$PATH
  67. export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
  68. export PATH="$PATH:/usr/local/bin:/usr/X11R6/bin"
  69.  
  70. #cPanel Added Limit Protections -- BEGIN
  71.  
  72. #unlimit so we can run the whoami
  73. ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2>/dev/null
  74.  
  75. LIMITUSER=$USER
  76. if [ -e "/usr/bin/whoami" ]; then
  77.         LIMITUSER=`/usr/bin/whoami`
  78. fi
  79. if [ "$LIMITUSER" != "root" ]; then
  80.         ulimit -n 100 -u 35 -m 200000 -d 200000 -s 8192 -c 200000 -v unlimited 2>/dev/null
  81. else
  82.         ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 2>/dev/null
  83. fi
  84. #cPanel Added Limit Protections -- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement