Advertisement
arkanon

slashfs-setup

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