Advertisement
arkanon

slashfs-setup

Aug 4th, 2013
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 8.58 KB | None | 0 0
  1. # $FS/SETUP
  2.  
  3. # Custom FS Hierarchy Config
  4. #
  5. # Arkanon <arkanon@lsd.org.br>
  6. # 2013/08/04 (Sun) 19:13:13 (BRS)
  7. # 2013/07/24 (Wed) 16:09:53 (BRS)
  8. # 2013/02/14 (Qui) 16:48:40 (BRD)
  9. # 2013/02/08 (Sex) 18:00:22 (BRD)
  10. # 2013/02/07 (Qui) 09:52:08 (BRS)
  11. # 2013/02/05 (Ter) 17:19:03 (BRS)
  12. # 2013/01/30 (Qua) 08:35:30 (BRS)
  13. # 2013/01/29 (Ter) 11:27:34 (BRS)
  14. #
  15. # Guide To Setting Up LXDE, The Lightweight Champion <http://lxlinux.com>
  16.  
  17. ### habilita login do root
  18.   sudo su -
  19.   passwd
  20.  
  21. ### root fs
  22.   eval $(blkid $(df / | tail -n1 | cut -d\  -f1) | tr " " "\n" | grep LABEL)
  23.   # RLABEL="local-07-ext4"
  24.   touch /.$RLABEL
  25.  
  26. ### swap
  27.     DISK="/dev/sda"
  28.    SPART=$(sgdisk -p $DISK | grep 8200 | awk -F" +" '{print $NF}')
  29.   SLABEL=$(sgdisk -p $DISK | grep 8200 | awk -F" +" '{print $NF}')
  30.   swaplabel -L $SLABEL $DISK$SPART
  31.  
  32. ### distro name, flavor and version
  33.   which gnome-session && FLAVOR=""
  34.   which lxsession     && FLAVOR="l"
  35.   which xde-session   && FLAVOR="x"
  36.   which kde-session   && FLAVOR="k"
  37.  
  38.   . /etc/os-release
  39.   # NAME="Ubuntu"
  40.   # VERSION="13.04, Raring Ringtail"
  41.   # ID=ubuntu
  42.   # ID_LIKE=debian
  43.   # PRETTY_NAME="Ubuntu 13.04"
  44.   # VERSION_ID="13.04"
  45.   # HOME_URL="http://www.ubuntu.com/"
  46.   # SUPPORT_URL="http://help.ubuntu.com/"
  47.   # BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
  48.  
  49.   ARCH=$(uname -m | grep -qw x86_64 && echo 64 || echo 32)
  50.   # 32
  51.  
  52.   touch /.$FLAVOR$ID-$VERSION_ID-$ARCH
  53.  
  54. ### data partitions
  55.   rmdir /cdrom/
  56.  
  57.   mkdir /mnt/{1,2,3,4}
  58.  
  59.   mkdir /mnt/mp1-media
  60.   mount /dev/disk/by-label/mp1-media /mnt/mp1-media
  61.  
  62.   mkdir /mnt/mp2-23-export
  63.   mount /dev/disk/by-label/mp2-23-exportmp2-23-export /mnt/mp2-23-export
  64.  
  65. ### slash fs
  66.   export FS="/fs"
  67.        HOST="spiderman"
  68.        NETW="lsd"
  69.   mkdir -p /export
  70.   mount /dev/disk/by-label/local-10-export /export
  71.   ln -nfs export/fs $FS
  72.   mkdir -p /var/fs
  73. # cp -a /export/fs-repo/etc/$NETW-$HOST/ubuntu-11.10-64/ /export/fs-repo/etc/$NETW-$HOST/$ID-$VERSION_ID-$ARCH/
  74.   ln -nfs ../../export/fs-repo/etc/$NETW-$HOST/$ID-$VERSION_ID-$ARCH /var/fs/etc
  75.  
  76. # alias  h='history'
  77. # alias  l='ls -lap --color'
  78. # alias df='df -haT'
  79. # alias du='du -chs'
  80. # export PATH=$FS/sbin:$FS/bin:$PATH
  81.  
  82.   . $FS/etc/profile
  83.  
  84. ### apt-get
  85.   rm -rf   /var/cache/apt/archives
  86.   mkdir -p /export/data/archives/$ID-$VERSION_ID-$ARCH/{incoming,repo}
  87.   ln -nfs  /export/data/archives/$ID-$VERSION_ID-$ARCH ~/archives
  88.   cp -al   ~/archives/repo/*.deb                       ~/archives/incoming/
  89.   ln -nfs  ~/archives/incoming                         /var/cache/apt/archives
  90.   ln -nfs  $FS/etc/apt/sources.list.d/more.list        /etc/apt/sources.list.d/
  91.   . <(grep aptkey /etc/apt/sources.list.d/more.list | grep '^ ' | cut -c5-)
  92. # sed -i 's/oneiric/quantal/' /etc/apt/sources.list.d/more.list # $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)
  93.   time apt-get update
  94.  
  95.   udisksctl mount -b /dev/sda6
  96.   mkdir /var/cache/oracle-jdk7-installer/
  97.   cp -a /media/administrador/local-06-ext4/var/cache/oracle-jdk7-installer/jdk-7u25-linux-i586.tar.gz /var/cache/oracle-jdk7-installer/
  98.  
  99.   cp -al ~/archives/repo/* ~/archives/incoming/
  100.  
  101.   time apt-get -y             remove  $(sed -r 's/#.*//g;/^$/d' REM)
  102.   time apt-get -y --force-yes install $(sed -r 's/#.*//g;/^$/d' ADD-{0..6}*)
  103.  
  104.   time apt-file update
  105.   time update-apt-xapian-index # <http://forums.bodhilinux.com/index.php?/topic/5597-quick-search-missing-synaptic/>
  106.  
  107.   du ~/archives/{repo,incoming}
  108.  
  109.   mv ~/archives/incoming/*.deb ~/archives/repo/
  110.  
  111. ### system default appss
  112.   update-alternatives --get-selections | grep x-www-browser
  113.   update-alternatives --list x-www-browser
  114.   update-alternatives --set x-www-browser /usr/bin/chromium-browser
  115.  
  116.   update-alternatives --get-selections | grep gnome-www-browser
  117.   update-alternatives --list gnome-www-browser
  118.   update-alternatives --set gnome-www-browser /usr/bin/chromium-browser
  119.  
  120. ### user apps
  121.   ln -fs $FS/etc/toprc    ~/.toprc
  122.   ln -fs $FS/home/.lynxrc ~/
  123.  
  124. ### synaptic
  125.   mkdir -p $FS/.ori/root/.synaptic/
  126.   touch    $FS/.ori/root/.synaptic/synaptic.conf
  127.   ln -fs   $FS/home/.synaptic/synaptic.conf ~/.synaptic/synaptic.conf
  128.  
  129. ### libtrash
  130.   unset  LD_PRELOAD
  131.   touch  $FS/.ori/etc/libtrash.conf
  132.   touch  $FS/.ori/root/.libtrash
  133.   ln -fs $FS/etc/libtrash.conf /etc
  134.   ln -fs /etc/libtrash.conf    ~/.libtrash
  135.   rm -r  ~/Trash
  136.   mkdir  ~/.trash/
  137.  
  138. ### xorg
  139.   ori s  /etc/X11/xorg.conf
  140.   rm -f  /etc/X11/xorg.conf
  141.  
  142. ### bash
  143.   ori s  ~/.bashrc
  144.   rm -f  ~/.bashrc
  145.  
  146.   ori s  ~/.profile
  147.   rm -f  ~/.profile
  148.  
  149.   ori s  /etc/profile
  150.   ln -fs $FS/etc/profile  /etc/
  151.  
  152.   ori s  /etc/bash.bashrc
  153.   ln -fs $FS/etc/profile  /etc/bash.bashrc
  154.  
  155.   ori s  /etc/bash_completion.d/apport_completion
  156.   ln -fs $FS/etc/bash_completion.d/apport_completion /etc/bash_completion.d/
  157.   ln -fs $FS/etc/bash_completion.d/misc              /etc/bash_completion.d/
  158.  
  159.   cp -a  /bin/sh $FS/.ori/bin/
  160.   ln -fs bash    /bin/sh
  161.  
  162.   ori s  /etc/screenrc
  163.   ln -fs $FS/etc/screenrc /etc/
  164.  
  165. ### vim
  166.   ori s  /etc/vim/
  167.   rm -rf /etc/vim
  168.   ln -fs $FS/etc/vim /etc/
  169.  
  170. ### fstab
  171.   ori s  /etc/fstab
  172.   cp -a  $FS/etc/.cp/fstab /etc/
  173.  
  174. ### grub
  175.   ori s  /etc/default/grub
  176.   ln -fs $FS/etc/default/grub     /etc/default/
  177.  
  178.   ori s  /etc/grub.d/10_linux
  179.   ln -fs $FS/etc/grub.d/10_linux  /etc/grub.d/
  180.  
  181.   ori s  /etc/grub.d/40_custom
  182.   ln -fs $FS/etc/grub.d/40_custom /etc/grub.d/
  183.  
  184.   update-grub
  185.  
  186. ### host
  187.   echo $HOST >| /etc/hostname
  188.  
  189.   ori s  /etc/hosts
  190.   ln -fs $FS/etc/hosts   /etc
  191.  
  192. ### nfs
  193.   ori s  /etc/exports
  194.   ln -fs $FS/etc/exports /etc
  195.   rc.nfs start
  196.   exportfs -a
  197.   showmount -e
  198.  
  199. ### ssh
  200.   ori s  /etc/ssh/sshd_config
  201.   ln -fs $FS/etc/ssh/sshd_config /etc/ssh
  202.  
  203.   ori s  /etc/ssh/ssh_config
  204.   ln -fs $FS/etc/ssh/ssh_config  /etc/ssh
  205.  
  206.   cp -a  $FS/home/.ssh/root      ~/.ssh
  207.   chown -R root:root             ~/.ssh/
  208.  
  209. ### no-ip
  210.   ln -fs $FS/etc/rc2.d/S90noip2 /etc/rc2.d/
  211.   rc.noip2 status
  212.   rc.noip2 start
  213.  
  214. ### init
  215.   for i in $FS/.ori/etc/rc2.d/*; do echo rm /etc/rc2.d/$(basename $i); done
  216.  
  217.   for i in $FS/etc/init/*
  218.   do
  219.     echo ori s  /etc/init/$(basename $i)
  220.     echo ln -fs $i /etc/init
  221.   done
  222.  
  223. ### scanner/impressora
  224.   # <http://www.meier-geinitz.de/sane/gt68xx-backend/>
  225.   # <http://ubuntuforums.org/archive/index.php/t-24087.html>
  226.   ln -s $FS/share/sane/gt68xx /usr/share/sane/
  227.   cupsd
  228.   id root
  229.   usermod -G lp,lpadmin
  230.   # <logout-login>
  231.   mkdir ~/.hplip
  232.   touch ~/.hplip/hplip.conf
  233.   # <http://hplipopensource.com/hplip-web/install/install/index.html>
  234.   # <http://hplipopensource.com/hplip-web/release_notes.html>
  235.   hp-check -t
  236.   hp-plugin -i
  237.   scanimage -L
  238.   scanimage > /dev/null
  239.  
  240. ### log
  241.   l  /var/log/{,*/}*.{gz,0,1,old}
  242.   rm /var/log/{,*/}*.{gz,0,1,old}
  243.  
  244. ### lesspipe
  245.   (
  246.     cpanm App::TarColor
  247.     cd $FS/src
  248.     wget http://www-zeuthen.desy.de/~friebel/unix/less/lesspipe.tar.gz
  249.     ver=$(tar tvf lesspipe.tar.gz | head -n1 | awk -F- '{print$NF}' | cut -d/ -f1) # 1.82
  250.     mv lesspipe.tar.gz lesspipe-$ver.tar.gz
  251.     tar zxf lesspipe-$ver.tar.gz
  252.     cd lesspipe-$ver
  253.     ./configure # y n n
  254.     cp -ai code2color lesspipe.sh $FS/bin
  255.   )
  256.  
  257. ### users
  258.   ori s /etc/{passwd,shadow,group}
  259.  
  260. ### sudo
  261.   ori s /etc/sudoers
  262.  
  263. ### crontab
  264.   ori s /var/spool/cron/crontabs/arkanon
  265.  
  266. ### /etc/samba/smb.conf
  267. ### /etc/lightdm/lightdm.conf
  268. ### /etc/gnome/defaults.list
  269. ### /etc/xdg/autostart/loginsound.desktop
  270. ### /usr/share/applications/mimeinfo.cache
  271. ### /usr/share/unity-2d/shell/common/IconTile.qml
  272. ### /usr/share/unity-2d/shell/launcher/LauncherList.qml
  273. ### /usr/share/unity-2d/shell/launcher/Launcher.qml
  274. ### /usr/share/unity-2d/shell/launcher/LauncherItem.qml
  275. ### /usr/share/unity-2d/shell/Shell.qml
  276.  
  277. ### user environment
  278.   # diminuir o tamanho do icone do unity-2d
  279.   # desabilitar as teclas super e alt no unity-2d
  280.   # deixar apenas 1 desktop virtual
  281.   # remover a lixeira e a preview do destop no unity-2d
  282.   # instalar os driver proprietarios
  283.   # definir o relogio como hh:mm:ss
  284.   # desabilitar o autolaunch dos dispositivos de armazenamento
  285.   # habilitar control+alt+bs para matar o X
  286.   # habilitar o som do login
  287.   # corrigir o defeito do wakeup apos um sleep
  288.   # definir smplayer como media player default
  289.  
  290.   # habilitar o tray menu para qualquer aplicativo
  291.   gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
  292.  
  293.   # separar o fundo de tela do login do ambiente do usuario
  294.   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
  295.  
  296.   # /.ori/home/administrador/examples.desktop
  297.   # /.ori/home/administrador/.bash_logout
  298.  
  299. # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement