Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # $FS/SETUP
- # Custom FS Hierarchy Config
- #
- # Arkanon <arkanon@lsd.org.br>
- # 2013/08/11 (Sun) 06:33:16 (BRS)
- # 2013/08/08 (Qui) 17:57:59 (BRS)
- # 2013/08/07 (Qua) 19:17:31 (BRS)
- # 2013/08/06 (Ter) 17:53:43 (BRS)
- # 2013/08/04 (Sun) 19:13:13 (BRS)
- # 2013/07/24 (Wed) 16:09:53 (BRS)
- # 2013/02/14 (Qui) 16:48:40 (BRD)
- # 2013/02/08 (Sex) 18:00:22 (BRD)
- # 2013/02/07 (Qui) 09:52:08 (BRS)
- # 2013/02/05 (Ter) 17:19:03 (BRS)
- # 2013/01/30 (Qua) 08:35:30 (BRS)
- # 2013/01/29 (Ter) 11:27:34 (BRS)
- # Guide To Setting Up LXDE, The Lightweight Champion <http://lxlinux.com>
- #
- # Table Of Contents
- #
- # | root_login | fstab_ | php_ | youtube_dl | user_environment |
- # | root_fs | grub_ | mysql_ | ifconfig_ | bash__ |
- # | swap | host_ | pgsql_ | asqm_ | ssh__ |
- # | distro | nfs_ | apache_ | | top |
- # | slash_fs | ssh_ | /~user_ | | lynx_ |
- # | data_partitions | no_ip | php__ | | fonts_ |
- # | apt_get | init_ | phpmyadmin_ | | home_page |
- # | system_def_apps | printer_scanner | phppgadmin_ | | libtrash__ |
- # | synaptic_ | log_clean | www_ | | inkscape |
- # | libtrash_ | lesspipe_ | msmtp_ | | gimp |
- # | xorg_ | sudo_ | lightdm_ | | shortcuts |
- # | bash_ | crontab_ | gui | | virtualbox |
- # | vim_ | samba_ | users_ | | x11vnc |
- # TODO
- #
- # | live_partitions | firefox
- # | svn | chrome
- # | git | google_earth
- # | raid | apt_file (dists/all/Contents-amd64.gz)
- # | synergy
- # | wine
- # | doom
- unset LD_PRELOAD # disable libtrash
- ### root_login
- sudo su -
- passwd
- ### root_fs
- eval R$(blkid $(df / | tail -n1 | cut -d\ -f1) | tr " " "\n" | grep LABEL)
- # RLABEL="local-07-ext4"
- touch /.$RLABEL
- ### swap
- DISK="/dev/sda"
- SPART=$(sgdisk -p $DISK | grep 8200 | awk -F" +" '{print $NF}')
- SLABEL=$(sgdisk -p $DISK | grep 8200 | awk -F" +" '{print $NF}')
- swaplabel -L $SLABEL $DISK$SPART
- ### distro (name, flavor and version)
- which gnome-session && FLAVOR=""
- which lxsession && FLAVOR="l"
- which xde-session && FLAVOR="x"
- which kde-session && FLAVOR="k"
- . /etc/os-release
- # NAME="Ubuntu"
- # VERSION="13.04, Raring Ringtail"
- # ID=ubuntu
- # ID_LIKE=debian
- # PRETTY_NAME="Ubuntu 13.04"
- # VERSION_ID="13.04"
- # HOME_URL="http://www.ubuntu.com/"
- # SUPPORT_URL="http://help.ubuntu.com/"
- # BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
- ARCH=$(uname -m | grep -qw x86_64 && echo 64 || echo 32)
- # 32
- touch /.$FLAVOR$ID-$VERSION_ID-$ARCH
- ### slash_fs
- export FS="/fs"
- HOST="spiderman"
- NETW="lsd"
- mkdir -p /export
- mount /dev/disk/by-label/local-10-export /export
- ln -nfs export/fs $FS
- mkdir -p /var/fs
- # cp -a /export/fs-repo/etc/$NETW-$HOST/ubuntu-11.10-64/ /export/fs-repo/etc/$NETW-$HOST/$ID-$VERSION_ID-$ARCH/
- ln -nfs ../../export/fs-repo/etc/$NETW-$HOST/$ID-$VERSION_ID-$ARCH /var/fs/etc
- # alias h='history'
- # alias l='ls -lap --color'
- # alias df='df -haT'
- # alias du='du -chs'
- # export PATH=$FS/sbin:$FS/bin:$PATH
- . $FS/etc/profile
- ### data_partitions
- # mkdir /mnt/{1,2,3,4,efi}
- # mkdir /mnt/mp1-media
- # mkdir /mnt/mp2-23-export
- rmdir /cdrom /selinux /srv
- cp -a $FS/mnt/* /mnt/
- mount /dev/disk/by-label/mp1-media /mnt/mp1-media
- mount /dev/disk/by-label/mp2-23-exportmp2-23-export /mnt/mp2-23-export
- ### apt_get
- rm -rf /var/cache/apt/archives
- mkdir -p /export/data/archives/$ID-$VERSION_ID-$ARCH/{incoming,repo}
- ln -nfs /export/data/archives/$ID-$VERSION_ID-$ARCH ~/archives
- cp -al ~/archives/repo/*.deb ~/archives/incoming/
- ln -nfs ~/archives/incoming /var/cache/apt/archives
- ln -nfs $FS/etc/apt/sources.list.d/more.list /etc/apt/sources.list.d/
- . <(grep aptkey /etc/apt/sources.list.d/more.list | grep '^ ' | cut -c5-)
- # sed -i 's/oneiric/quantal/' /etc/apt/sources.list.d/more.list # $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)
- time apt-get update
- udisksctl mount -b /dev/sda6
- mkdir /var/cache/oracle-jdk7-installer/
- cp -a /media/administrador/local-06-ext4/var/cache/oracle-jdk7-installer/jdk-7u25-linux-i586.tar.gz /var/cache/oracle-jdk7-installer/
- cp -al ~/archives/repo/* ~/archives/incoming/
- time apt-get -y remove $(sed -r 's/#.*//g;/^$/d' REM)
- time apt-get -y --force-yes install $(sed -r 's/#.*//g;/^$/d' ADD-{0..6}*)
- time apt-file update
- time update-apt-xapian-index # <http://forums.bodhilinux.com/index.php?/topic/5597-quick-search-missing-synaptic/>
- du ~/archives/{repo,incoming}
- mv ~/archives/incoming/*.deb ~/archives/repo/
- ### system_def_apps
- for i in {x,gnome}-www-browser
- do
- update-alternatives --get-selections | grep "^$i"
- update-alternatives --list $i
- update-alternatives --set $i /usr/bin/chromium-browser
- echo
- done
- update-alternatives --get-selections | grep "^www-browser"
- update-alternatives --list www-browser
- update-alternatives --set www-browser /usr/bin/lynx
- ### synaptic_
- mkdir -p $FS/.ori/root/.synaptic/
- touch $FS/.ori/root/.synaptic/synaptic.conf
- ln -fs $FS/home/.synaptic/synaptic.conf ~/.synaptic/synaptic.conf
- ### libtrash_
- unset LD_PRELOAD
- touch $FS/.ori/etc/libtrash.conf
- touch $FS/.ori/root/.libtrash
- ln -fs $FS/etc/libtrash.conf /etc
- ### xorg_
- ori s /etc/X11/xorg.conf
- rm -f /etc/X11/xorg.conf
- ### bash_
- ori s ~/.bashrc
- ori s ~/.profile
- ori s /etc/profile
- ln -fs $FS/etc/profile /etc/
- ori s /etc/bash.bashrc
- ln -fs $FS/etc/profile /etc/bash.bashrc
- ori s /etc/bash_completion.d/apport_completion
- ln -fs $FS/etc/bash_completion.d/apport_completion /etc/bash_completion.d/
- ln -fs $FS/etc/bash_completion.d/misc /etc/bash_completion.d/
- cp -a /bin/sh $FS/.ori/bin/
- ln -fs bash /bin/sh
- ori s /etc/screenrc
- ln -fs $FS/etc/screenrc /etc/
- ### vim_
- ori s /etc/vim/
- rm -rf /etc/vim
- ln -fs $FS/etc/vim /etc/
- ### fstab_
- ori s /etc/fstab
- cp -a $FS/etc/.cp/fstab /etc/
- ln -fs /proc/mounts /etc/mtab
- ### grub_
- ori s /etc/default/grub
- ln -fs $FS/etc/default/grub /etc/default/
- ori s /etc/grub.d/10_linux
- ln -fs $FS/etc/grub.d/10_linux /etc/grub.d/
- ori s /etc/grub.d/40_custom
- ln -fs $FS/etc/grub.d/40_custom /etc/grub.d/
- update-grub
- ### host_
- echo $HOST >| /etc/hostname
- ori s /etc/hosts
- ln -fs $FS/etc/hosts /etc
- ### nfs_
- ori s /etc/exports
- ln -fs $FS/etc/exports /etc
- rc.nfs start
- exportfs -a
- showmount -e
- ### ssh_
- ori s /etc/ssh/sshd_config
- ln -fs $FS/etc/ssh/sshd_config /etc/ssh
- ori s /etc/ssh/ssh_config
- ln -fs $FS/etc/ssh/ssh_config /etc/ssh
- ### no_ip
- ln -fs $FS/etc/rc2.d/S90noip2 /etc/rc2.d/
- rc.noip2 status
- rc.noip2 start
- ### init_
- for i in $FS/.ori/etc/rc2.d/*; do echo rm /etc/rc2.d/$(basename $i); done
- for i in $FS/etc/init/*
- do
- echo ori s /etc/init/$(basename $i)
- echo ln -fs $i /etc/init
- done
- ### printer_scanner
- # <http://www.meier-geinitz.de/sane/gt68xx-backend/>
- # <http://ubuntuforums.org/archive/index.php/t-24087.html>
- ln -s $FS/share/sane/gt68xx /usr/share/sane/
- cupsd
- id root
- usermod -G lp,lpadmin
- # <logout-login>
- mkdir ~/.hplip
- touch ~/.hplip/hplip.conf
- # <http://hplipopensource.com/hplip-web/install/install/index.html>
- # <http://hplipopensource.com/hplip-web/release_notes.html>
- hp-check -t
- hp-plugin -i
- scanimage -L
- scanimage > /dev/null
- ### log_clean
- l /var/log/{,*/}*.{gz,0,1,old}
- rm /var/log/{,*/}*.{gz,0,1,old}
- ### lesspipe_
- (
- cpanm App::TarColor
- cd $FS/src
- wget http://www-zeuthen.desy.de/~friebel/unix/less/lesspipe.tar.gz
- ver=$(tar tvf lesspipe.tar.gz | head -n1 | awk -F- '{print$NF}' | cut -d/ -f1) # 1.82
- mv lesspipe.tar.gz lesspipe-$ver.tar.gz
- tar zxf lesspipe-$ver.tar.gz
- cd lesspipe-$ver
- ./configure # y n n
- cp -ai code2color lesspipe.sh $FS/bin
- )
- ### sudo_
- ori s /etc/sudoers
- cp -a $FS/etc/.cp/sudoers /etc/
- ### crontab_
- mkdir -p $FS/.ori/var/spool/cron/crontabs/
- chmod u=rwx,g=wx,o=t $FS/.ori/var/spool/cron/crontabs/
- chgrp crontab $FS/.ori/var/spool/cron/crontabs/
- touch $FS/.ori/var/spool/cron/crontabs/root
- chmod 600 $FS/.ori/var/spool/cron/crontabs/root
- chgrp crontab $FS/.ori/var/spool/cron/crontabs/root
- cp -a $FS/var/spool/cron/crontabs/root /var/spool/cron/crontabs/
- ### samba_
- ori s /etc/samba/smb.conf
- ln -fs $FS/etc/samba/smb.conf /etc/samba/
- ln -s $FS/etc/samba/shares /etc/samba/
- touch $FS/.ori/etc/samba/smbpasswd
- cp -a $FS/etc/.cp/smbpasswd /etc/samba/
- ### php_
- ori s /etc/php5/apache2/php.ini
- ln -fs $FS/etc/php5/apache2/php.ini /etc/php5/apache2/
- ### mysql_
- ori s /etc/mysql/my.cnf
- cp -a $FS/etc/.cp/my.cnf /etc/mysql/
- # mysql -h localhost -u root -p
- # dpkg-reconfigure mysql-server-5.5
- ### pgsql_
- ori s /etc/postgresql/9.1/main/pg_hba.conf
- ln -fs $FS/etc/postgresql/9.1/main/pg_hba.conf /etc/postgresql/9.1/main/
- chown -h postgres:postgres /etc/postgresql/9.1/main/pg_hba.conf
- ori s /etc/postgresql/9.1/main/postgresql.conf
- ln -fs $FS/etc/postgresql/9.1/main/postgresql.conf /etc/postgresql/9.1/main/
- chown -h postgres:postgres /etc/postgresql/9.1/main/postgresql.conf
- ### apache_
- ori s /etc/apache2/ports.conf
- ln -fs $FS/etc/apache2/ports.conf /etc/apache2/
- ori s /etc/apache2/conf.d/security
- ln -fs $FS/etc/apache2/conf.d/security /etc/apache2/conf.d/
- # /~user_
- ori s /etc/apache2/mods-available/userdir.conf
- ln -fs $FS/etc/apache2/mods-available/userdir.conf /etc/apache2/mods-available/
- cp -a $FS/etc/apache2/mods-enabled/* /etc/apache2/mods-enabled/
- # php__
- ori s /etc/apache2/mods-available/php5.conf
- ln -fs $FS/etc/apache2/mods-available/php5.conf /etc/apache2/mods-available/
- # phpmyadmin_
- ori s /etc/phpmyadmin/apache.conf
- mv /etc/apache2/conf.d/phpmyadmin.conf /etc/apache2/conf.d/phpmyadmin
- ln -fs $FS/etc/phpmyadmin/apache.conf /etc/phpmyadmin/
- ori s /etc/phpmyadmin/config.inc.php
- ln -fs $FS/etc/phpmyadmin/config.inc.php /etc/phpmyadmin/
- # phppgadmin_
- ori s /etc/apache2/conf.d/phppgadmin
- cp -a $FS/etc/apache2/conf.d/phppgadmin /etc/apache2/conf.d/
- ln -fs $FS/etc/phppgadmin/apache.conf /etc/phppgadmin/
- ori s /etc/phppgadmin/config.inc.php
- ln -fs $FS/etc/phppgadmin/config.inc.php /etc/phppgadmin/
- sudo -u postgres /usr/bin/psql -d template1 -U postgres -c "ALTER USER postgres WITH PASSWORD 'admin'"
- echo -e "admin\nadmin" | passwd postgres 2> /dev/null
- # www_
- mkdir -p $FS/.ori/etc/apache2/sites-enabled/
- cp -a /etc/apache2/sites-enabled/000-default $FS/.ori/etc/apache2/sites-enabled/
- rm /etc/apache2/sites-enabled/000-default
- ln -fs $FS/etc/apache2/sites-available/* /etc/apache2/sites-available/
- ln -fs ../sites-available/svl /etc/apache2/sites-enabled/0
- ln -fs ../sites-available/audax /etc/apache2/sites-enabled/1
- ln -fs ../sites-available/oclaje /etc/apache2/sites-enabled/2
- ln -fs ../sites-available/ikcomposer /etc/apache2/sites-enabled/3
- ln -fs ../sites-available/iars /etc/apache2/sites-enabled/4
- apachectl restart
- ### msmtp_
- touch $FS/.ori/etc/mail.rc
- ln -fs $FS/etc/mail.rc /etc/
- touch $FS/.ori/etc/msmtprc
- ln -fs $FS/etc/msmtprc /etc/
- ### lightdm_
- ori s /etc/lightdm/lightdm.conf
- # apt-get install --reinstall ubuntu-desktop software-properties-gtk dbus lightdm
- #
- # dpkg-reconfigure lightdm
- #
- # software-properties-gtk
- #
- # chown -R lightdm:lightdm /var/lib/lightdm
- # chown -R avahi-autoipd:avahi-autoipd /var/lib/avahi-autoipd
- # chown -R colord:colord /var/lib/colord
- #
- # service lightdm start
- ### gui
- ori s /etc/gnome/defaults.list
- ori s /etc/xdg/autostart/loginsound.desktop
- ori s /usr/share/applications/mimeinfo.cache
- ori s /usr/share/unity-2d/shell/common/IconTile.qml
- ori s /usr/share/unity-2d/shell/launcher/LauncherList.qml
- ori s /usr/share/unity-2d/shell/launcher/Launcher.qml
- ori s /usr/share/unity-2d/shell/launcher/LauncherItem.qml
- ori s /usr/share/unity-2d/shell/Shell.qml
- ### youtube_dl
- youtube-dl -U
- echo | youtube-dl -h
- ### ifconfig_
- ori s /etc/udev/rules.d/70-persistent-net.rules
- cp -a $FS/etc/.cp/70-persistent-net.rules /etc/udev/rules.d/
- # reboot
- ### asqm_
- touch $FS/.ori/etc/asqm
- ln -fs $FS/etc/asqm /etc
- ### users_
- ori s /etc/{passwd,shadow,group}
- # <http://serverfault.com/a/259750>
- USERS=$(sed -r 's/#.*//g;/^$/d' $FS/etc/users)
- base="/export/home"
- shell="/bin/bash"
- meth="sha-512"
- salts="8"
- saltd="00000000"
- # salt=$(< /dev/urandom tr -cd [:alnum:] | head -c$salts)
- # crypt=$(mkpasswd -m $meth $pass $salt)
- typeset -A crypt
- crypt[admin]='$6$'$saltd'$S49JIO.A6yuOcC..SvpCfzKbuMMqKlYsbR6zjv93CCkhA1N0l.o.SHWsuGliK79HDg3/oyzFOUmkCyDzFg/ts.'
- crypt[user]='$6$'$saltd'$azTYn4E0j6ufCcmc/d2713SmhlF59rTS4f7I/1cKeyTUW4P1fYJN046ZboNGXbBl4HC4kqkCLQaxRgXyv64PI/'
- crypt[mude-me]='$6$'$saltd'$CVck5Is3F.MdyDm0k8kauYCI2x8Bhk8CUeD5XX9ItoJ4DHGqa85/4HMaD1G7pdgHwJf/rtVzCrRW4oI50djza0'
- echo "$USERS" | while read uid u pass name rest
- do
- case "$pass" in
- x ) pstr="";;
- = ) pstr=$(mkpasswd -m $meth $u $saltd);;
- * ) pstr="${crypt[$pass]}" && [ "$pass" = "x" ] && pstr="";;
- esac
- useradd -u $uid -U -b $base -M -p "$pstr" -s $shell -c "$name,,," $u
- echo "created user $u"
- done
- for u in administrador usuario convidado
- do
- # h="/export/home/$u"
- h="/home/$u"
- usermod -d $h $u
- mkdir -p $h
- chown $u:$u $h
- chmod 2751 $h
- ln -fs /fs/home/.face/$u/face $h/.face
- chown -h $u $h/.face
- echo "created dir $h"
- done
- cp -a /etc/{passwd,shadow,group} /fs/etc/.cp/
- echo "$USERS" | while read uid u rest
- do
- h="/export/home/$u"
- mkdir -p $h
- chown $u:$u $h
- chmod 2751 $h
- ln -fs /fs/home/.face/$u/face $h/.face
- chown -h $u $h/.face
- echo "created dir $h"
- done
- echo "$USERS" | while read uid u rest
- do
- userdel $u
- echo "deleted user $u"
- done
- for u in root administrador
- do
- # groups="scanner,vboxsf"
- groups="adm,disk,lp,cdrom,floppy,tape,sudo,audio,dip,www-data,video,plugdev,users,lpadmin,sambashare,vboxusers"
- usermod -G $groups $u
- done
- for u in arkanon alexsmith
- do
- # groups="scanner,vboxsf,administracao"
- groups="adm,disk,lp,cdrom,floppy,tape,sudo,audio,dip,www-data,video,plugdev,users,lpadmin,sambashare,vboxusers"
- usermod -G $groups $u
- done
- for u in vitor alexandre
- do
- # groups="administracao"
- groups="users"
- usermod -G $groups $u
- done
- for u in george cassiano usuario convidado
- do
- groups="users"
- usermod -G $groups $u
- done
- ### user_environment
- USERS="arkanon alexsmith vitor alexandre george cassiano"
- GROUP="imagemaerears"
- TRASH="/mnt/local-raid/lixeira/libtrash"
- for u in root administrador $USERS
- do
- g="$GROUP" && [ "$u" = "root" ] && g="$u"
- h="/home/$u" && [ "$u" = "root" ] && h="/$u"
- if [ "$u" = "root" ]
- then
- ln -nfs /mnt/local-raid $h/lraid
- ln -nfs /mnt/remote-raid $h/rraid
- fi
- # bash__
- rm -f $h/.bashrc
- rm -f $h/.profile
- # ssh__
- cp -a $FS/home/.ssh/root $h/.ssh/
- chown -R root:root $h/.ssh/
- # top
- ln -fs $FS/etc/toprc $h/.toprc
- # lynx_
- ln -fs $FS/home/.lynxrc $h/
- # fonts_
- ln -fs $FS/home/.fonts $h/
- # home_page
- mkdir -p $h/public_html/
- echo '<?="<h1>Hello World!</h1>"?>' >| $h/public_html/index.php
- # libtrash__
- trash="$TRASH/$u"
- mkdir -p $h
- mkdir -p $trash
- rm -rf $h/Trash
- ln -nfs /etc/libtrash.conf $h/.libtrash
- ln -nfs $trash $h/.trash
- # mkdir -p $h/.trash
- chown -Rh $u:$g $h
- chown -R $u:$g $trash
- chmod -R 2770 $trash
- chmod 2751 $h
- # inkscape
- # gimp
- # shortcuts
- # virtualbox
- # x11vnc
- # diminuir o tamanho do icone do unity-2d
- # desabilitar as teclas super e alt no unity-2d
- # deixar apenas 1 desktop virtual
- # remover a lixeira e a preview do destop no unity-2d
- # instalar os driver proprietarios
- # definir o relogio como hh:mm:ss
- # desabilitar o autolaunch dos dispositivos de armazenamento
- # habilitar control+alt+bs para matar o X
- # habilitar o som do login
- # corrigir o defeito do wakeup apos um sleep
- # definir smplayer como media player default
- # habilitar o tray menu para qualquer aplicativo
- # gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
- # separar o fundo de tela do login do ambiente do usuario
- # 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
- # /.ori/home/administrador/examples.desktop
- # /.ori/home/administrador/.bash_logout
- done
- # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement