Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 16.31 KB  |  hits: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/csh
  2. @ last = $#
  3. @ penultimate = ($last - 1)
  4. set root = $argv[$penultimate]
  5. set directory = $argv[$last]
  6. set file_exclude = ''
  7. set file_edit = ''
  8. while ($argv[1])
  9.         set option = $argv[1]
  10.         shift
  11.         switch ($option)
  12.                 case '--exclude'
  13.                         set file_exclude = $argv[1]
  14.                         shift
  15.                         breaksw
  16.                 case '--edit'
  17.                         set file_edit = $argv[1]
  18.                         shift
  19.                         breaksw
  20.                 default
  21.                         return 0
  22.         endsw
  23. done
  24. set files = `ls -a $root/$directory/`
  25. foreach file ($files)
  26.         if (($file != '.') && ($file != '..')) then
  27.                 if (-e $root/$directory/$file) then
  28.                         if ($file_exclude) set exclude = `grep "^/$directory/$file$" $file_exclude`
  29.                         if ((-f $root/$directory/$file) && !($exclude)) then
  30.                                 cat $root/$directory/$file >> /$directory/$file
  31.                                 if ($file_edit) set edit = `grep "^/$directory/$file$" $file_edit`
  32.                                 if ($edit) then
  33.                                         $EDITOR /$directory/$file
  34.                                 endif
  35.                         endif
  36.                         if ($file_exclude) set exclude = `grep "^/$directory/$file/$" $file_exclude`
  37.                         if ((-d $root/$directory/$file/) && !($exclude)) then
  38.                                 mkdir /$directory/$file/
  39.                                 $0 --exclude $exclude --edit $edit $root $directory/$file/
  40.                         endif
  41.                 else
  42.                         echo "Error: $file is not a file."
  43.                 endif
  44.         endif
  45. done
  46. ______________________________________________________________________________________________
  47.  
  48. #!/bin/csh
  49. set root = `dirname $0`
  50. while (`basename $root` != 'FreeBSD')
  51.         set root = `dirname $root`
  52. end
  53. # Setting up the X.Org server – http://www.freebsd.org/doc/en/books/handbook/x-config.html {
  54. Xorg -configure && cp /root/xorg.conf.new /etc/X11/xorg.conf
  55. # }
  56. # Setting up the sound card – http://www.freebsd.org/doc/en/books/handbook/sound-setup.html {
  57. kldload snd_driver
  58. cat /dev/sndstat >> /boot/loader.conf
  59. # }
  60. # Setting up network interface cards – http://www.freebsd.org/doc/en/books/handbook/config-network-setup.html {
  61. # Using Microsoft Windows NDIS (Network Driver Interface Specification) {
  62. # Unfortunately, there are still many vendors that do not provide schematics for their drivers to the open source community because they regard such information as trade secrets. Consequently, the developers of FreeBSD and other operating systems are left two choices: develop the drivers by a long and pain-staking process of reverse engineering or using the existing driver binaries available for the Microsoft® Windows platforms. Most developers, including those involved with FreeBSD, have taken the latter approach.
  63. # The FreeBSD NDISulator (otherwise known as Project Evil) takes a Windows driver binary and basically tricks it into thinking it is running on Windows.
  64. # NDISulator requirements:
  65. # – kernel sources;
  66. # – Windows XP driver binary (.sys extension);
  67. # – Windows XP driver configuration file (.inf extension).
  68. # Locate the files for the specific card. Generally, they can be found on the included CDs (Compact Discs) or at the vendors’ websites.
  69. # Note: it may have to extract Microsoft cabinet (.cab extension) files.
  70. # The next step is to compile the driver binary into a loadable kernel module.
  71. #cd /boot/modules/ && ndisgen /<path_to>/<network_driver>.inf /<path_to>/<network_driver>.sys # \
  72. ## > <network_kernel_module>.ko
  73. kldload <network_kernel_module> # load the network kernel module.
  74. kldload ndis # load the NDIS driver wrapper.
  75. kldload if_ndis # load the actual network interface.
  76. # Then, add the following line to /boot/loader.conf: <network_kernel_mudule>_load="YES".
  77. # }
  78. # }
  79. # VirtualBox configuration {
  80. # /boot/loader.conf # /boot/modules/vboxdrv: VirtualBox kernel module.
  81. # /etc/rc.conf # /usr/local/etc/rc.d/vboxnet: VirtualBox kernel modules for bridged or host-only networking.
  82. # pw groupmod vboxusers -m <user_name>[,]… # add all users that need VirtualBox.
  83. # }
  84. # Pivot {
  85. set tmp = "$root/usr/home/beastie/.tmp/"
  86. csh merge.csh --exclude $tmp/wide_list_exclude --edit $tmp/wide_list_edit $root ./
  87. # }
  88. # Using localization – http://www.freebsd.org/doc/en/books/handbook/using-localization.html {
  89. # Localization settings are based on three main terms: LanguageCode_CountryCode.Encoding.
  90. #/etc/login.conf \
  91. #       language_name|Account Type Description: \
  92. #               :charset=MIME_charset: \
  93. #               :lang=locale_name: \
  94. #               :tc=default:
  95. cap_mkdb /etc/login.conf # create capability database.
  96. # }
  97. # Make changes {
  98. vipw # \
  99. ## > <user_name>:<password>:1001:1001:<language>:0:0:<first_name> <last_name>:/home/user:/[usr/local]/bin/<shell>
  100. # }
  101. ____________________________________________________________________________________________
  102.  
  103. #!/bin/csh
  104. set root = `dirname $0`
  105. while (`basename $root` != 'FreeBSD')
  106.         set root = `dirname $root`
  107. end
  108. # Default compiler: Clang/LLVM (Low Level Virtual Machine).
  109. make CC='clang'
  110. make CXX='clang++'
  111. # Global
  112. # Note: search the other ports with “cd /usr/ports/ && make search display=path key=<key_search>”.
  113. cd /usr/ports/archivers/cabextract/ && make install clean -DBATCH
  114. cd /usr/ports/archivers/p7zip/ && make install clean -DBATCH
  115. cd /usr/ports/archivers/unrar/ && make install clean -DBATCH
  116. cd /usr/ports/archivers/xarchiver/ && make install clean -DBATCH
  117. cd /usr/ports/astro/celestia/ && make install clean -DBATCH
  118. cd /usr/ports/audio/rhythmbox/ && make install clean -DBATCH
  119. cd /usr/ports/converters/libiconv/ && make install clean -DBATCH
  120. cd /usr/ports/deskutils/calibre/ && make install clean -DBATCH
  121. cd /usr/ports/deskutils/fbreader/ && make install clean -DBATCH
  122. cd /usr/ports/devel/git/ && make install clean -DBATCH # \
  123. ## > /hand/book/git.viki
  124. cd /usr/ports/devel/sdl12/ && make install clean -DBATCH
  125. cd /usr/ports/editors/kile/ && make install clean -DBATCH
  126. cd /usr/ports/editors/libreoffice/ && make install clean -DBATCH
  127. cd /usr/ports/editors/vim/ && make install clean -DBATCH
  128. cd /usr/ports/emulators/dolphin-emu-devel/ && make install clean -DBATCH # Gamecube (project Dolphin: 2001-09-14) and Wii (2006-11-19) emulator – Dolphin.
  129. cd /usr/ports/emulators/fceux/ && make install clean -DBATCH # Nintendo Entertainment System (1983-07-15) emulator – FCEUX (Family Computer Emulator Ultra X).
  130. cd /usr/ports/emulators/mupen64/ && make install clean -DBATCH # Nintendo Entertainment System 64 (project Reality: 1996-06-23) emulator – Mupen64 (Multi-Platform Emulator for the Nintendo Entertainment System 64).
  131. cd /usr/ports/emulators/virtualbox-ose/ && make install clean -DBATCH # VirtualBox OSE (Open Source Edition).
  132. cd /usr/ports/emulators/wine/ && make install clean -DBATCH # Wine (Wine Is Not an Emulator), Microsoft Windows compatibility layer for UNIX-like systems.
  133. cd /usr/ports/emulators/zsnes/ && make install clean -DBATCH # Super Nintendo Entertainment System (1990-11-21) emulator – ZSNES (Z Super Nintendo Entertainment System). Note: Z letter may refer to zsKnight – and _Demo_, the authors.
  134. cd /usr/ports/ftp/filezilla/ && make install clean -DBTACH
  135. cd /usr/ports/ftp/wget/ && make install clean -DBATCH
  136. cd /usr/ports/games/py-pychess/ && make install clean -DBATCH # \
  137. ## > http://www.freechess.org/
  138. cd /usr/ports/graphics/blender/ && make install clean -DBATCH
  139. cd /usr/ports/graphics/dia/ && make install clean -DBATCH && \
  140.         sed -i '' -e "s/dia \%F/dia --integrated \%F/" /usr/local/share/applications/dia.desktop
  141. cd /usr/ports/graphics/feh/ && make install clean -DBATCH
  142. cd /usr/ports/graphics/gimp/ && make install clean -DBATCH
  143. cd /usr/ports/graphics/ImageMagick/ && make install clean -DBATCH
  144. cd /usr/ports/graphics/xpdf/ && make install clean -DBATCH
  145. cd /usr/ports/graphics/zathura/ && make install clean -DBATCH
  146. cd /usr/ports/irc/xchat/ && make install clean -DBATCH
  147. cd /usr/ports/lang/clisp/ && make install clean -DBATCH # Common Lisp (list processing) is an impure functional language Lisp family – ANSI (American National Standards Institute) implementation (actually, it is not an implementation but rather a language specification, that Lisp implementations try to comply).
  148. cd /usr/ports/lang/perl5.14/ && make install clean -DBATCH
  149. cd /usr/ports/lang/python32/ && make install clean -DBATCH
  150. cd /usr/ports/lang/ruby19/ && make install clean -DBATCH
  151. cd /usr/ports/lang/squeak/ && make install clean -DBTACH # Smalltalk-80 implementation.
  152. cd /usr/ports/lang/swi-pl/ && make install clean -DBATCH # SWI-Prolog is derived from Sociaal-Wetenschappelijke Informatica (Social Science Informatics), the former name of the group at the University of Amsterdam). Note: the name of this group has changed to HCS (Human-Computer Studies).
  153. cd /usr/ports/mail/fetchmail/ && make install clean -DBATCH
  154. cd /usr/ports/mail/mutt-devel/ && make install clean \ # development version: the use of port (/usr/ports/mail/mutt/) does not enable to add some bundles.
  155.         WITH_MUTT_CYRUS_SASL2=yes \ # enable SASL2 (Simple Authentication and Security Layer) support – SMTP (Simple Mail Transfer Protocol) authentication requires SASL.
  156.         WITH_MUTT_SIDEBAR_PATCH=yes \ # enable sidebar.
  157.         WITH_MUTT_SMTP=yes \ # enable SMTP (Simple Mail Transfer Protocol) relay support.
  158.         BATCH=yes
  159. cd /usr/ports/mail/mutt/ && make install clean -DBATCH
  160. cd /usr/ports/mail/p5-Mail-SpamAssassin/ && make install clean -DBATCH
  161. cd /usr/ports/mail/procmail/ && make install clean -DBATCH
  162. cd /usr/ports/mail/sendmail/ && make install clean -DBATCH
  163. cd /usr/ports/multimedia/vlc/ && make install clean -DBATCH
  164. cd /usr/ports/net-im/psi/ && make install clean -DBATCH
  165. cd /usr/ports/net-mgmt/aircrack-ng/ && make install clean -DBATCH
  166. cd /usr/ports/net-p2p/transmission/ && make install clean -DBATCH
  167. cd /usr/ports/net/rsync/ && make install clean -DBATCH # remote synchronization.
  168. cd /usr/ports/ports-mgmt/pkg/ && make install clean -DBATCH
  169. cd /usr/ports/ports-mgmt/portmaster/ && make install clean \ # use “portmaster [<category>/<port>] [<flag>…]”.
  170.         WITH_ZSH=yes \
  171.         BATCH=yes
  172. cd /usr/ports/ports-mgmt/portshaker/ && make install clean -DBATCH
  173. cd /usr/ports/ports-mgmt/portshaker-config/ && make install clean \
  174.         WITH_TEXLIVE=yes \
  175.         BATCH=yes
  176. cd /usr/ports/print/cups/ && make install clean -DBATCH # Common UNIX Printing System \
  177. ## > /boot/loader.conf # load lpt, ulpt, unlpt.
  178. ## > /etc/rc.conf # enable cupsd and set localrules.
  179. ## > /etc/devfs.rules # CUPS group local rules: give a path to required devices.
  180. ## > cd /dev/ && ls lpt* ulpt* unlpt*
  181. ## > http://localhost:631/
  182. ### > Add Printer:
  183. #### > set a name for the printer;
  184. #### > provide a PPD file – look in /usr/local/share/ppd/;
  185. ##### > Note: PPD (PostScript Printer Description) files are created by vendors to describe the entire set of features and capabilities available for their PostScript printers.
  186. ## > lpstat -p # display printers.
  187. ## > lpstat -d <printer_name> # default destination.
  188. ## > /usr/local/bin/lpr # LPR (Line Printer Remote) works with CUPS instead of LPD (Line Printer DAEMON).
  189. cd /usr/ports/print/ghostscript9/ && make install clean -DBATCH
  190. cd /usr/ports/print/ghostview/ && make install clean -DBATCH
  191. cd /usr/ports/print/texlive/ && make install clean -DBATCH
  192. cd /usr/ports/print/xdvi/ && make install clean -DBATCH
  193. cd /usr/ports/security/sudo/ && make install clean -DBATCH # \
  194. ## > uncomment '#' . '%wheel ALL=(ALL) ALL' /usr/local/etc/sudoers
  195. cd /usr/ports/security/tor/ && make install clean -DBATCH # Tor (The Onion Router).
  196. cd /usr/ports/shells/zsh/ && make install clean -DBATCH # \
  197. ## > pw usermod <user_name> -s /usr/local/bin/zsh
  198. cd /usr/ports/sysutils/conky/ && make install clean \
  199.         WITH_XFT=yes \
  200.         BATCH=yes
  201. cd /usr/ports/sysutils/tmux/ && make install clean -DBATCH
  202. cd /usr/ports/sysutils/tracker/ && make install clean \
  203.         WITH_GNOME=yes \
  204.         BATCH=yes
  205. cd /usr/ports/textproc/stardict3/ && make install clean -DBATCH # \
  206. ## Note: push dictionaries to /usr/local/share/stardict/dic/; a comprehensive list of dictionaries is maintained by Polyglotte and available from http://polyglotte.tuxfamily.org/doku.php?id=donnees:dicos_bilingues.
  207. ## > XDXF (XML Dictionary Exchange Format): http://xdxf.sourceforge.net/.
  208. ### > english to french: http://sourceforge.net/projects/xdxf/files/dicts-stardict-form-xdxf/001/stardict-comn_sdict_axm03_English_French-2.4.2.tar.bz2/download.
  209. ### > french to english: http://sourceforge.net/projects/xdxf/files/dicts-stardict-form-xdxf/001/stardict-comn_sdict_axm03_French_English-2.4.2.tar.bz2/download.
  210. cd /usr/ports/www/chromium/ && make install clean -DBATCH # \
  211. ## > AdBlock Plus
  212. ## > DuckDuckGo Zero-click Info
  213. ## > Google Dictionary (by Google)
  214. ## > Search by Image (by Google)
  215. ## > Vrome
  216. cd /usr/ports/www/links/ && make install clean -DBATCH
  217. cd /usr/ports/x11-fm/pcmanfm/ && make install clean -DBATCH # \
  218. ## > build automation: /usr/local/share/applications/mimeinfo.cache.
  219. ## > build hand: $HOME/.local/share/applications/mimeapps.list.
  220. cd /usr/ports/x11-fonts/freefonts/ && make install clean -DBATCH
  221. cd /usr/ports/x11-fonts/liberation-fonts-ttf/ && make install clean -DBATCH
  222. cd /usr/ports/x11-fonts/urwfonts/ && make install clean -DBATCH
  223. cd /usr/ports/x11-fonts/webfonts/ && make install clean -DBATCH
  224. cd /usr/ports/x11-themes/openbox-themes/ && make install clean -DBATCH
  225. cd /usr/ports/x11-wm/devilspie/ && make install clean -DBATCH
  226. cd /usr/ports/x11-wm/obconf/ && make install clean -DBATCH
  227. cd /usr/ports/x11-wm/obmenu/ && make install clean -DBATCH
  228. cd /usr/ports/x11-wm/obpager/ && make install clean -DBATCH
  229. cd /usr/ports/x11-wm/openbox/ && make install clean -DBATCH
  230. cd /usr/ports/x11-wm/transset-df/ && make install clean -DBATCH
  231. cd /usr/ports/x11-wm/xcompmgr/ && make install clean -DBATCH
  232. cd /usr/ports/x11/gnome2/ && make install clean -DBATCH
  233. cd /usr/ports/x11/slim/ && make install clean -DBATCH
  234. cd /usr/ports/x11/tint/ && make install clean -DBATCH
  235. cd /usr/ports/x11/wmctrl/ && make install clean -DBATCH
  236. cd /usr/ports/x11/xdialog/ && make install clean -DBATCH
  237. cd /usr/ports/x11/xorg/ && make install clean -DBATCH
  238. cd /usr/ports/x11/xterm/ && make deinstall clean && make install clean \ # fix a side effect: x11/xorg/, x11/xorg-apps/, x11/xterm/. Note: it is a way to crap; fortunately, you can can place “cd /usr/ports/x11/xterm/ && make config” in first, but this script is not intended to be interactive.
  239.         WITH_256_COLOR=yes \
  240.         BATCH=yes
  241. cd /usr/ports/x11/zenity/ && make install clean -DBATCH
  242. # Restricted
  243. # Note: redistribution not allowed.
  244. ## Adobe Flash Player
  245. kldload linux
  246. # GNU/Linux mode (Fedora 10)
  247. cd /usr/ports/emulators/linux_base-f10/ && make install clean -DBATCH
  248. # Adobe Flash Player ported on GNU/Linux (Fedora 10).
  249. # Note: the use of port will install binaries (object files) without accompanying source.
  250. # Adobe Flash Player NPAPI plug-in.
  251. cd /usr/ports/www/linux-f10-flashplugin11/ && make install clean -DBATCH \
  252.         && mkdir /usr/local/lib/browser_plugins/ ; ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so /usr/local/lib/browser_plugins/libflashplayerplugin.so
  253. # NSPluginWrapper: a compatibility plug-in for Mozilla NPAPI (Netscape Plugin Application Programming Interface) plug-ins.
  254. cd /usr/ports/www/nspluginwrapper/ && make install clean -DBATCH \
  255.         && nspluginwrapper --verbose --auto --install
  256. # Note: emulate GNU/Linux process file system is required for the complete operation of some GNU/Linux binaries.
  257. mount -t linprocfs linproc /compat/linux/proc/
  258. echo 'linproc /compat/linux/proc linprocfs rw 0 0' >> /etc/fstab
  259. ## Java
  260. # Note: OpenJDK requires FreeBSD Foundation license and Oracle license:
  261. # FreeBSD Foundation license:
  262. ## > Caffe Diablo (i386): http://www.freebsdfoundation.org/cgi-bin/download?download=oem/diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2
  263. ## > Caffe Diablo (amd64): http://www.freebsdfoundation.org/cgi-bin/download?download=oem/diablo-caffe-freebsd7-amd64-1.6.0_07-b02.tar.bz2
  264. mkdir /usr/ports/distfiles/ ; cp $root/FreeBSD/usr/ports/distfiles/diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2 /usr/ports/distfiles/
  265. # Oracle license
  266. ## > JDK DST Timezone Update Tool: http://www.oracle.com/technetwork/java/javase/downloads/.
  267. mkdir /usr/ports/distfiles/ ; cp $root/FreeBSD/usr/ports/distfiles/tzupdater-1_3_45-2011n.zip /usr/ports/distfiles/
  268. cd /usr/ports/java/openjdk7/ && make install clean -DBATCH
  269. # IcedTea-Web: a free Java plug-in and Java Web Start for OpenJDK.
  270. cd /usr/ports/java/icedtea-web/ && make install clean -DBATCH \
  271.         && mkdir /usr/local/lib/browser_plugins/ ; ln -s /usr/local/lib/IcedTeaPlugin.so /usr/local/lib/browser_plugins/libjavaplugin.so
  272. # Note: FreeBSD process file system is required for the complete operation of some FreeBSD binaries.
  273. mount -t procfs proc /proc/
  274. echo 'proc /proc procfs rw 0 0' >> /etc/fstab
  275. # Unofficial ports
  276. portshaker
  277. ## TeX Live
  278. cd /usr/ports/print/texlive-scheme-full/ && make install clean -DBATCH