Advertisement
arkanon

slashfs-setup

Aug 11th, 2013
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # $FS/SETUP
  2.  
  3. # Custom FS Hierarchy Config
  4. #
  5. # Arkanon <arkanon@lsd.org.br>
  6. # 2013/08/11 (Sun) 06:33:16 (BRS)
  7. # 2013/08/08 (Qui) 17:57:59 (BRS)
  8. # 2013/08/07 (Qua) 19:17:31 (BRS)
  9. # 2013/08/06 (Ter) 17:53:43 (BRS)
  10. # 2013/08/04 (Sun) 19:13:13 (BRS)
  11. # 2013/07/24 (Wed) 16:09:53 (BRS)
  12. # 2013/02/14 (Qui) 16:48:40 (BRD)
  13. # 2013/02/08 (Sex) 18:00:22 (BRD)
  14. # 2013/02/07 (Qui) 09:52:08 (BRS)
  15. # 2013/02/05 (Ter) 17:19:03 (BRS)
  16. # 2013/01/30 (Qua) 08:35:30 (BRS)
  17. # 2013/01/29 (Ter) 11:27:34 (BRS)
  18.  
  19.  
  20.  
  21. # Guide To Setting Up LXDE, The Lightweight Champion <http://lxlinux.com>
  22. #
  23. # Table Of Contents
  24. #
  25. # | root_login      | fstab_          | php_          | youtube_dl | user_environment |
  26. # | root_fs         | grub_           | mysql_        | ifconfig_  |   bash__         |
  27. # | swap            | host_           | pgsql_        | asqm_      |   ssh__          |
  28. # | distro          | nfs_            | apache_       |            |   top            |
  29. # | slash_fs        | ssh_            |   /~user_     |            |   lynx_          |
  30. # | data_partitions | no_ip           |   php__       |            |   fonts_         |
  31. # | apt_get         | init_           |   phpmyadmin_ |            |   home_page      |
  32. # | system_def_apps | printer_scanner |   phppgadmin_ |            |   libtrash__     |
  33. # | synaptic_       | log_clean       |   www_        |            |   inkscape       |
  34. # | libtrash_       | lesspipe_       | msmtp_        |            |   gimp           |
  35. # | xorg_           | sudo_           | lightdm_      |            |   shortcuts      |
  36. # | bash_           | crontab_        | gui           |            |   virtualbox     |
  37. # | vim_            | samba_          | users_        |            |   x11vnc         |
  38.  
  39. # TODO
  40. #
  41. # | live_partitions | firefox
  42. # | svn             | chrome
  43. # | git             | google_earth
  44. # | raid            | apt_file (dists/all/Contents-amd64.gz)
  45. # | synergy
  46. # | wine
  47. # | doom
  48.  
  49.  
  50.  
  51. unset LD_PRELOAD # disable libtrash
  52.  
  53. ### root_login
  54.   sudo su -
  55.   passwd
  56.  
  57. ### root_fs
  58.   eval R$(blkid $(df / | tail -n1 | cut -d\  -f1) | tr " " "\n" | grep LABEL)
  59.   # RLABEL="local-07-ext4"
  60.   touch /.$RLABEL
  61.  
  62. ### swap
  63.     DISK="/dev/sda"
  64.    SPART=$(sgdisk -p $DISK | grep 8200 | awk -F" +" '{print $NF}')
  65.   SLABEL=$(sgdisk -p $DISK | grep 8200 | awk -F" +" '{print $NF}')
  66.   swaplabel -L $SLABEL $DISK$SPART
  67.  
  68. ### distro (name, flavor and version)
  69.   which gnome-session && FLAVOR=""
  70.   which lxsession     && FLAVOR="l"
  71.   which xde-session   && FLAVOR="x"
  72.   which kde-session   && FLAVOR="k"
  73.  
  74.   . /etc/os-release
  75.   # NAME="Ubuntu"
  76.   # VERSION="13.04, Raring Ringtail"
  77.   # ID=ubuntu
  78.   # ID_LIKE=debian
  79.   # PRETTY_NAME="Ubuntu 13.04"
  80.   # VERSION_ID="13.04"
  81.   # HOME_URL="http://www.ubuntu.com/"
  82.   # SUPPORT_URL="http://help.ubuntu.com/"
  83.   # BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
  84.  
  85.   ARCH=$(uname -m | grep -qw x86_64 && echo 64 || echo 32)
  86.   # 32
  87.  
  88.   touch /.$FLAVOR$ID-$VERSION_ID-$ARCH
  89.  
  90. ### slash_fs
  91.   export FS="/fs"
  92.        HOST="spiderman"
  93.        NETW="lsd"
  94.   mkdir -p /export
  95.   mount /dev/disk/by-label/local-10-export /export
  96.   ln -nfs export/fs $FS
  97.   mkdir -p /var/fs
  98. # cp -a /export/fs-repo/etc/$NETW-$HOST/ubuntu-11.10-64/ /export/fs-repo/etc/$NETW-$HOST/$ID-$VERSION_ID-$ARCH/
  99.   ln -nfs ../../export/fs-repo/etc/$NETW-$HOST/$ID-$VERSION_ID-$ARCH /var/fs/etc
  100.  
  101. # alias  h='history'
  102. # alias  l='ls -lap --color'
  103. # alias df='df -haT'
  104. # alias du='du -chs'
  105. # export PATH=$FS/sbin:$FS/bin:$PATH
  106.  
  107.   . $FS/etc/profile
  108.  
  109. ### data_partitions
  110. # mkdir /mnt/{1,2,3,4,efi}
  111. # mkdir /mnt/mp1-media
  112. # mkdir /mnt/mp2-23-export
  113.   rmdir /cdrom /selinux /srv
  114.   cp -a $FS/mnt/* /mnt/
  115.  
  116.   mount /dev/disk/by-label/mp1-media                  /mnt/mp1-media
  117.   mount /dev/disk/by-label/mp2-23-exportmp2-23-export /mnt/mp2-23-export
  118.  
  119. ### apt_get
  120.   rm -rf   /var/cache/apt/archives
  121.   mkdir -p /export/data/archives/$ID-$VERSION_ID-$ARCH/{incoming,repo}
  122.   ln -nfs  /export/data/archives/$ID-$VERSION_ID-$ARCH ~/archives
  123.   cp -al   ~/archives/repo/*.deb                       ~/archives/incoming/
  124.   ln -nfs  ~/archives/incoming                         /var/cache/apt/archives
  125.   ln -nfs  $FS/etc/apt/sources.list.d/more.list        /etc/apt/sources.list.d/
  126.   . <(grep aptkey /etc/apt/sources.list.d/more.list | grep '^ ' | cut -c5-)
  127. # sed -i 's/oneiric/quantal/' /etc/apt/sources.list.d/more.list # $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)
  128.   time apt-get update
  129.  
  130.   udisksctl mount -b /dev/sda6
  131.   mkdir /var/cache/oracle-jdk7-installer/
  132.   cp -a /media/administrador/local-06-ext4/var/cache/oracle-jdk7-installer/jdk-7u25-linux-i586.tar.gz /var/cache/oracle-jdk7-installer/
  133.  
  134.   cp -al ~/archives/repo/* ~/archives/incoming/
  135.  
  136.   time apt-get -y             remove  $(sed -r 's/#.*//g;/^$/d' REM)
  137.   time apt-get -y --force-yes install $(sed -r 's/#.*//g;/^$/d' ADD-{0..6}*)
  138.  
  139.   time apt-file update
  140.   time update-apt-xapian-index # <http://forums.bodhilinux.com/index.php?/topic/5597-quick-search-missing-synaptic/>
  141.  
  142.   du ~/archives/{repo,incoming}
  143.  
  144.   mv ~/archives/incoming/*.deb ~/archives/repo/
  145.  
  146. ### system_def_apps
  147.   for i in {x,gnome}-www-browser
  148.   do
  149.     update-alternatives --get-selections | grep "^$i"
  150.     update-alternatives --list $i
  151.     update-alternatives --set  $i /usr/bin/chromium-browser
  152.     echo
  153.   done
  154.  
  155.   update-alternatives --get-selections | grep "^www-browser"
  156.   update-alternatives --list www-browser
  157.   update-alternatives --set  www-browser /usr/bin/lynx
  158.  
  159. ### synaptic_
  160.   mkdir -p $FS/.ori/root/.synaptic/
  161.   touch    $FS/.ori/root/.synaptic/synaptic.conf
  162.   ln -fs   $FS/home/.synaptic/synaptic.conf ~/.synaptic/synaptic.conf
  163.  
  164. ### libtrash_
  165.   unset  LD_PRELOAD
  166.   touch  $FS/.ori/etc/libtrash.conf
  167.   touch  $FS/.ori/root/.libtrash
  168.   ln -fs $FS/etc/libtrash.conf /etc
  169.  
  170. ### xorg_
  171.   ori s     /etc/X11/xorg.conf
  172.   rm -f     /etc/X11/xorg.conf
  173.  
  174. ### bash_
  175.   ori s  ~/.bashrc
  176.   ori s  ~/.profile
  177.  
  178.   ori s     /etc/profile
  179.   ln -fs $FS/etc/profile /etc/
  180.  
  181.   ori s     /etc/bash.bashrc
  182.   ln -fs $FS/etc/profile /etc/bash.bashrc
  183.  
  184.   ori s     /etc/bash_completion.d/apport_completion
  185.   ln -fs $FS/etc/bash_completion.d/apport_completion /etc/bash_completion.d/
  186.   ln -fs $FS/etc/bash_completion.d/misc              /etc/bash_completion.d/
  187.  
  188.   cp -a  /bin/sh $FS/.ori/bin/
  189.   ln -fs bash /bin/sh
  190.  
  191.   ori s     /etc/screenrc
  192.   ln -fs $FS/etc/screenrc /etc/
  193.  
  194. ### vim_
  195.   ori s     /etc/vim/
  196.   rm -rf    /etc/vim
  197.   ln -fs $FS/etc/vim /etc/
  198.  
  199. ### fstab_
  200.   ori s     /etc/fstab
  201.   cp -a  $FS/etc/.cp/fstab /etc/
  202.   ln -fs    /proc/mounts   /etc/mtab
  203.  
  204. ### grub_
  205.   ori s     /etc/default/grub
  206.   ln -fs $FS/etc/default/grub     /etc/default/
  207.  
  208.   ori s     /etc/grub.d/10_linux
  209.   ln -fs $FS/etc/grub.d/10_linux  /etc/grub.d/
  210.  
  211.   ori s     /etc/grub.d/40_custom
  212.   ln -fs $FS/etc/grub.d/40_custom /etc/grub.d/
  213.  
  214.   update-grub
  215.  
  216. ### host_
  217.   echo $HOST >| /etc/hostname
  218.  
  219.   ori s     /etc/hosts
  220.   ln -fs $FS/etc/hosts   /etc
  221.  
  222. ### nfs_
  223.   ori s     /etc/exports
  224.   ln -fs $FS/etc/exports /etc
  225.   rc.nfs start
  226.   exportfs -a
  227.   showmount -e
  228.  
  229. ### ssh_
  230.   ori s     /etc/ssh/sshd_config
  231.   ln -fs $FS/etc/ssh/sshd_config /etc/ssh
  232.  
  233.   ori s     /etc/ssh/ssh_config
  234.   ln -fs $FS/etc/ssh/ssh_config  /etc/ssh
  235.  
  236. ### no_ip
  237.   ln -fs $FS/etc/rc2.d/S90noip2 /etc/rc2.d/
  238.   rc.noip2 status
  239.   rc.noip2 start
  240.  
  241. ### init_
  242.   for i in $FS/.ori/etc/rc2.d/*; do echo rm /etc/rc2.d/$(basename $i); done
  243.  
  244.   for i in $FS/etc/init/*
  245.   do
  246.     echo ori s     /etc/init/$(basename $i)
  247.     echo ln -fs $i /etc/init
  248.   done
  249.  
  250. ### printer_scanner
  251.   # <http://www.meier-geinitz.de/sane/gt68xx-backend/>
  252.   # <http://ubuntuforums.org/archive/index.php/t-24087.html>
  253.   ln -s $FS/share/sane/gt68xx /usr/share/sane/
  254.   cupsd
  255.   id root
  256.   usermod -G lp,lpadmin
  257.   # <logout-login>
  258.   mkdir ~/.hplip
  259.   touch ~/.hplip/hplip.conf
  260.   # <http://hplipopensource.com/hplip-web/install/install/index.html>
  261.   # <http://hplipopensource.com/hplip-web/release_notes.html>
  262.   hp-check -t
  263.   hp-plugin -i
  264.   scanimage -L
  265.   scanimage > /dev/null
  266.  
  267. ### log_clean
  268.   l  /var/log/{,*/}*.{gz,0,1,old}
  269.   rm /var/log/{,*/}*.{gz,0,1,old}
  270.  
  271. ### lesspipe_
  272.   (
  273.     cpanm App::TarColor
  274.     cd $FS/src
  275.     wget http://www-zeuthen.desy.de/~friebel/unix/less/lesspipe.tar.gz
  276.     ver=$(tar tvf lesspipe.tar.gz | head -n1 | awk -F- '{print$NF}' | cut -d/ -f1) # 1.82
  277.     mv lesspipe.tar.gz lesspipe-$ver.tar.gz
  278.     tar zxf lesspipe-$ver.tar.gz
  279.     cd lesspipe-$ver
  280.     ./configure # y n n
  281.     cp -ai code2color lesspipe.sh $FS/bin
  282.   )
  283.  
  284. ### sudo_
  285.   ori s     /etc/sudoers
  286.   cp -a  $FS/etc/.cp/sudoers                         /etc/
  287.  
  288. ### crontab_
  289.   mkdir -p             $FS/.ori/var/spool/cron/crontabs/
  290.   chmod u=rwx,g=wx,o=t $FS/.ori/var/spool/cron/crontabs/
  291.   chgrp crontab        $FS/.ori/var/spool/cron/crontabs/
  292.  
  293.   touch                $FS/.ori/var/spool/cron/crontabs/root
  294.   chmod 600            $FS/.ori/var/spool/cron/crontabs/root
  295.   chgrp crontab        $FS/.ori/var/spool/cron/crontabs/root
  296.  
  297.   cp -a $FS/var/spool/cron/crontabs/root /var/spool/cron/crontabs/
  298.  
  299. ### samba_
  300.   ori s     /etc/samba/smb.conf
  301.   ln -fs $FS/etc/samba/smb.conf                      /etc/samba/
  302.  
  303.   ln -s  $FS/etc/samba/shares                        /etc/samba/
  304.  
  305.   touch  $FS/.ori/etc/samba/smbpasswd
  306.   cp -a  $FS/etc/.cp/smbpasswd                       /etc/samba/
  307.  
  308. ### php_
  309.   ori s     /etc/php5/apache2/php.ini
  310.   ln -fs $FS/etc/php5/apache2/php.ini                /etc/php5/apache2/
  311.  
  312. ### mysql_
  313.   ori s     /etc/mysql/my.cnf
  314.   cp -a  $FS/etc/.cp/my.cnf                          /etc/mysql/
  315. # mysql -h localhost -u root -p
  316. # dpkg-reconfigure mysql-server-5.5
  317.  
  318. ### pgsql_
  319.   ori s     /etc/postgresql/9.1/main/pg_hba.conf
  320.   ln -fs $FS/etc/postgresql/9.1/main/pg_hba.conf     /etc/postgresql/9.1/main/
  321.   chown -h postgres:postgres                         /etc/postgresql/9.1/main/pg_hba.conf
  322.  
  323.   ori s     /etc/postgresql/9.1/main/postgresql.conf
  324.   ln -fs $FS/etc/postgresql/9.1/main/postgresql.conf /etc/postgresql/9.1/main/
  325.   chown -h postgres:postgres                         /etc/postgresql/9.1/main/postgresql.conf
  326.  
  327. ### apache_
  328.   ori s     /etc/apache2/ports.conf
  329.   ln -fs $FS/etc/apache2/ports.conf                  /etc/apache2/
  330.  
  331.   ori s     /etc/apache2/conf.d/security
  332.   ln -fs $FS/etc/apache2/conf.d/security             /etc/apache2/conf.d/
  333.  
  334.   # /~user_
  335.   ori s     /etc/apache2/mods-available/userdir.conf
  336.   ln -fs $FS/etc/apache2/mods-available/userdir.conf /etc/apache2/mods-available/
  337.   cp -a  $FS/etc/apache2/mods-enabled/*              /etc/apache2/mods-enabled/
  338.  
  339.   # php__
  340.   ori s     /etc/apache2/mods-available/php5.conf
  341.   ln -fs $FS/etc/apache2/mods-available/php5.conf    /etc/apache2/mods-available/
  342.  
  343.   # phpmyadmin_
  344.   ori s     /etc/phpmyadmin/apache.conf
  345.   mv        /etc/apache2/conf.d/phpmyadmin.conf      /etc/apache2/conf.d/phpmyadmin
  346.   ln -fs $FS/etc/phpmyadmin/apache.conf              /etc/phpmyadmin/
  347.  
  348.   ori s     /etc/phpmyadmin/config.inc.php
  349.   ln -fs $FS/etc/phpmyadmin/config.inc.php           /etc/phpmyadmin/
  350.  
  351.   # phppgadmin_
  352.   ori s     /etc/apache2/conf.d/phppgadmin
  353.   cp -a  $FS/etc/apache2/conf.d/phppgadmin           /etc/apache2/conf.d/
  354.   ln -fs $FS/etc/phppgadmin/apache.conf              /etc/phppgadmin/
  355.  
  356.   ori s     /etc/phppgadmin/config.inc.php
  357.   ln -fs $FS/etc/phppgadmin/config.inc.php           /etc/phppgadmin/
  358.  
  359.   sudo -u postgres /usr/bin/psql -d template1 -U postgres -c "ALTER USER postgres WITH PASSWORD 'admin'"
  360.   echo -e "admin\nadmin" | passwd postgres 2> /dev/null
  361.  
  362.   # www_
  363.   mkdir -p $FS/.ori/etc/apache2/sites-enabled/
  364.   cp -a            /etc/apache2/sites-enabled/000-default $FS/.ori/etc/apache2/sites-enabled/
  365.   rm               /etc/apache2/sites-enabled/000-default
  366.   ln -fs   $FS/etc/apache2/sites-available/*                      /etc/apache2/sites-available/
  367.   ln -fs                ../sites-available/svl                    /etc/apache2/sites-enabled/0
  368.   ln -fs                ../sites-available/audax                  /etc/apache2/sites-enabled/1
  369.   ln -fs                ../sites-available/oclaje                 /etc/apache2/sites-enabled/2
  370.   ln -fs                ../sites-available/ikcomposer             /etc/apache2/sites-enabled/3
  371.   ln -fs                ../sites-available/iars                   /etc/apache2/sites-enabled/4
  372.  
  373.   apachectl restart
  374.  
  375. ### msmtp_
  376.   touch  $FS/.ori/etc/mail.rc
  377.   ln -fs $FS/etc/mail.rc /etc/
  378.  
  379.   touch  $FS/.ori/etc/msmtprc
  380.   ln -fs $FS/etc/msmtprc /etc/
  381.  
  382. ### lightdm_
  383.   ori s     /etc/lightdm/lightdm.conf
  384.   # apt-get install --reinstall ubuntu-desktop software-properties-gtk dbus lightdm
  385.   #
  386.   # dpkg-reconfigure lightdm
  387.   #
  388.   # software-properties-gtk
  389.   #
  390.   # chown -R lightdm:lightdm             /var/lib/lightdm
  391.   # chown -R avahi-autoipd:avahi-autoipd /var/lib/avahi-autoipd
  392.   # chown -R colord:colord               /var/lib/colord
  393.   #
  394.   # service lightdm start
  395.  
  396. ### gui
  397.   ori s     /etc/gnome/defaults.list
  398.   ori s     /etc/xdg/autostart/loginsound.desktop
  399.   ori s     /usr/share/applications/mimeinfo.cache
  400.   ori s     /usr/share/unity-2d/shell/common/IconTile.qml
  401.   ori s     /usr/share/unity-2d/shell/launcher/LauncherList.qml
  402.   ori s     /usr/share/unity-2d/shell/launcher/Launcher.qml
  403.   ori s     /usr/share/unity-2d/shell/launcher/LauncherItem.qml
  404.   ori s     /usr/share/unity-2d/shell/Shell.qml
  405.  
  406. ### youtube_dl
  407.   youtube-dl -U
  408.   echo | youtube-dl -h
  409.  
  410. ### ifconfig_
  411.   ori s     /etc/udev/rules.d/70-persistent-net.rules
  412.   cp -a  $FS/etc/.cp/70-persistent-net.rules /etc/udev/rules.d/
  413. # reboot
  414.  
  415. ### asqm_
  416.   touch  $FS/.ori/etc/asqm
  417.   ln -fs $FS/etc/asqm /etc
  418.  
  419. ### users_
  420.   ori s     /etc/{passwd,shadow,group}
  421.  
  422.   # <http://serverfault.com/a/259750>
  423.  
  424.   USERS=$(sed -r 's/#.*//g;/^$/d' $FS/etc/users)
  425.  
  426.    base="/export/home"
  427.   shell="/bin/bash"
  428.    meth="sha-512"
  429.   salts="8"
  430.   saltd="00000000"
  431.  
  432. #  salt=$(< /dev/urandom tr -cd [:alnum:] | head -c$salts)
  433. # crypt=$(mkpasswd -m $meth $pass $salt)
  434.  
  435.   typeset -A crypt
  436.  
  437.   crypt[admin]='$6$'$saltd'$S49JIO.A6yuOcC..SvpCfzKbuMMqKlYsbR6zjv93CCkhA1N0l.o.SHWsuGliK79HDg3/oyzFOUmkCyDzFg/ts.'
  438.   crypt[user]='$6$'$saltd'$azTYn4E0j6ufCcmc/d2713SmhlF59rTS4f7I/1cKeyTUW4P1fYJN046ZboNGXbBl4HC4kqkCLQaxRgXyv64PI/'
  439.   crypt[mude-me]='$6$'$saltd'$CVck5Is3F.MdyDm0k8kauYCI2x8Bhk8CUeD5XX9ItoJ4DHGqa85/4HMaD1G7pdgHwJf/rtVzCrRW4oI50djza0'
  440.  
  441.   echo "$USERS" | while read uid u pass name rest
  442.   do
  443.     case "$pass" in
  444.       x ) pstr="";;
  445.       = ) pstr=$(mkpasswd -m $meth $u $saltd);;
  446.       * ) pstr="${crypt[$pass]}" && [ "$pass" = "x" ] && pstr="";;
  447.     esac
  448.     useradd -u $uid -U -b $base -M -p "$pstr" -s $shell -c "$name,,," $u
  449.     echo "created user $u"
  450.   done
  451.  
  452.   for u in administrador usuario convidado
  453.   do
  454.  
  455. #   h="/export/home/$u"
  456.  
  457.     h="/home/$u"
  458.     usermod -d  $h $u
  459.  
  460.     mkdir -p    $h
  461.     chown $u:$u $h
  462.     chmod 2751  $h
  463.     ln -fs /fs/home/.face/$u/face $h/.face
  464.     chown -h $u $h/.face
  465.     echo "created dir $h"
  466.  
  467.   done
  468.  
  469.   cp -a /etc/{passwd,shadow,group} /fs/etc/.cp/
  470.  
  471.   echo "$USERS" | while read uid u rest
  472.   do
  473.     h="/export/home/$u"
  474.     mkdir -p    $h
  475.     chown $u:$u $h
  476.     chmod 2751  $h
  477.     ln -fs /fs/home/.face/$u/face $h/.face
  478.     chown -h $u $h/.face
  479.     echo "created dir $h"
  480.   done
  481.  
  482.   echo "$USERS" | while read uid u rest
  483.   do
  484.     userdel $u
  485.     echo "deleted user $u"
  486.   done
  487.  
  488.  
  489.  
  490.   for u in root administrador
  491.   do
  492.   # groups="scanner,vboxsf"
  493.     groups="adm,disk,lp,cdrom,floppy,tape,sudo,audio,dip,www-data,video,plugdev,users,lpadmin,sambashare,vboxusers"
  494.     usermod -G $groups $u
  495.   done
  496.  
  497.   for u in arkanon alexsmith
  498.   do
  499.   # groups="scanner,vboxsf,administracao"
  500.     groups="adm,disk,lp,cdrom,floppy,tape,sudo,audio,dip,www-data,video,plugdev,users,lpadmin,sambashare,vboxusers"
  501.     usermod -G $groups $u
  502.   done
  503.  
  504.   for u in vitor alexandre
  505.   do
  506.   # groups="administracao"
  507.     groups="users"
  508.     usermod -G $groups $u
  509.   done
  510.  
  511.   for u in george cassiano usuario convidado
  512.   do
  513.     groups="users"
  514.     usermod -G $groups $u
  515.   done
  516.  
  517.  
  518.  
  519. ### user_environment
  520.  
  521.   USERS="arkanon alexsmith vitor alexandre george cassiano"
  522.   GROUP="imagemaerears"
  523.   TRASH="/mnt/local-raid/lixeira/libtrash"
  524.  
  525.   for u in root administrador $USERS
  526.   do
  527.  
  528.     g="$GROUP"   && [ "$u" = "root" ] && g="$u"
  529.     h="/home/$u" && [ "$u" = "root" ] && h="/$u"
  530.  
  531.     if [ "$u" = "root" ]
  532.     then
  533.       ln -nfs /mnt/local-raid  $h/lraid
  534.       ln -nfs /mnt/remote-raid $h/rraid
  535.     fi
  536.  
  537.     # bash__
  538.     rm -f $h/.bashrc
  539.     rm -f $h/.profile
  540.  
  541.     # ssh__
  542.     cp -a  $FS/home/.ssh/root $h/.ssh/
  543.     chown -R root:root        $h/.ssh/
  544.  
  545.     # top
  546.     ln -fs $FS/etc/toprc      $h/.toprc
  547.  
  548.     # lynx_
  549.     ln -fs $FS/home/.lynxrc   $h/
  550.  
  551.     # fonts_
  552.     ln -fs $FS/home/.fonts    $h/
  553.  
  554.     # home_page
  555.     mkdir -p $h/public_html/
  556.     echo '<?="<h1>Hello World!</h1>"?>' >| $h/public_html/index.php
  557.  
  558.     # libtrash__
  559.     trash="$TRASH/$u"
  560.     mkdir -p $h
  561.     mkdir -p $trash
  562.     rm -rf $h/Trash
  563.     ln -nfs /etc/libtrash.conf $h/.libtrash
  564.     ln -nfs $trash $h/.trash
  565. #   mkdir -p       $h/.trash
  566.     chown -Rh $u:$g $h
  567.     chown -R  $u:$g $trash
  568.     chmod -R  2770  $trash
  569.     chmod     2751  $h
  570.  
  571.     # inkscape
  572.     # gimp
  573.     # shortcuts
  574.     # virtualbox
  575.     # x11vnc
  576.  
  577.     # diminuir o tamanho do icone do unity-2d
  578.     # desabilitar as teclas super e alt no unity-2d
  579.     # deixar apenas 1 desktop virtual
  580.     # remover a lixeira e a preview do destop no unity-2d
  581.     # instalar os driver proprietarios
  582.     # definir o relogio como hh:mm:ss
  583.     # desabilitar o autolaunch dos dispositivos de armazenamento
  584.     # habilitar control+alt+bs para matar o X
  585.     # habilitar o som do login
  586.     # corrigir o defeito do wakeup apos um sleep
  587.     # definir smplayer como media player default
  588.  
  589.     # habilitar o tray menu para qualquer aplicativo
  590. #   gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
  591.  
  592.     # separar o fundo de tela do login do ambiente do usuario
  593. #   dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User.SetBackgroundFile string:/usr/share/backgrounds/warty-final-ubuntu.png
  594.  
  595.     # /.ori/home/administrador/examples.desktop
  596.     # /.ori/home/administrador/.bash_logout
  597.  
  598.   done
  599.  
  600.  
  601.  
  602. # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement