From cb66c63b762555f83f72e7d2492d33e1d0514479 Mon Sep 17 00:00:00 2001 From: Ambrevar Date: Fri, 29 Jun 2012 17:13:47 +0100 Subject: [PATCH] Luakit: added some search engines. Shell: added some functions (lsofstat,pacman-official). .save: smarter way to get pacman official packages. --- .arch-pkg-aur-zeus | 2 ++ .arch-pkg-explicit-zeus | 5 +++++ .arch-pkg-official-zeus | 6 ++++++ .config/luakit/globals.lua | 7 ++----- .save | 5 ++--- .shell.d/funs_rc | 20 ++++++++++++++++++-- README | 16 ++++++++++++---- 7 files changed, 47 insertions(+), 14 deletions(-) diff --git a/.arch-pkg-aur-zeus b/.arch-pkg-aur-zeus index 3956a23a..e38e70a0 100644 --- a/.arch-pkg-aur-zeus +++ b/.arch-pkg-aur-zeus @@ -1,10 +1,12 @@ auto-complete bashmount +bustle dropbox dropbox-cli emacs-yasnippet emacs-yasnippet-latex-git gsharkdown +linux-custom movgrab otf-texgyre package-query diff --git a/.arch-pkg-explicit-zeus b/.arch-pkg-explicit-zeus index a06b0118..6311df14 100644 --- a/.arch-pkg-explicit-zeus +++ b/.arch-pkg-explicit-zeus @@ -11,6 +11,7 @@ bash-completion bashmount binutils bison +bustle bzip2 bzr calc @@ -73,6 +74,7 @@ libtool licenses links linux +linux-custom linux-docs linux-lts logrotate @@ -137,6 +139,7 @@ syslog-ng sysvinit tar task +tcpdump texinfo texlive-genericextra texlive-latexextra @@ -156,6 +159,8 @@ waf wget which wireless_tools +wireshark-cli +wireshark-gtk wpa_supplicant xf86-input-synaptics xf86-video-intel diff --git a/.arch-pkg-official-zeus b/.arch-pkg-official-zeus index b55afead..cab9a9c1 100644 --- a/.arch-pkg-official-zeus +++ b/.arch-pkg-official-zeus @@ -374,6 +374,8 @@ pcre perl perl-error perl-locale-gettext +perl-test-pod +perl-yaml-syck pidgin pinentry pixman @@ -442,6 +444,7 @@ t1lib talloc tar task +tcpdump tdb texinfo texlive-bin @@ -471,6 +474,8 @@ wget which wildmidi wireless_tools +wireshark-cli +wireshark-gtk wpa_supplicant wxgtk x264 @@ -492,6 +497,7 @@ xfsprogs xineramaproto xkeyboard-config xmlrpc-c +xmlto xorg-bdftopcf xorg-fonts-alias xorg-fonts-encodings diff --git a/.config/luakit/globals.lua b/.config/luakit/globals.lua index a7abe287..7d146802 100644 --- a/.config/luakit/globals.lua +++ b/.config/luakit/globals.lua @@ -1,9 +1,6 @@ -- Global variables for luakit globals = { homepage = "about:blank", - -- homepage = "http://google.com/", - -- homepage = "http://luakit.org/", - -- homepage = "http://github.com/mason-larobina/luakit", scroll_step = 40, zoom_step = 0.1, max_cmd_history = 100, @@ -54,8 +51,6 @@ soup.accept_policy = cookie_policy.always -- See: http://www.lua.org/manual/5.1/manual.html#pdf-string.format search_engines = { - -- arch = "http://wiki.archlinux.org/wiki/Special:Search?search=%s", - -- debbugs = "http://bugs.debian.org/%s", -- duckduckgo = "http://duckduckgo.com/?q=%s", -- luakit = "http://luakit.org/search/index/luakit?q=%s", -- sourceforge = "http://sf.net/search/?words=%s", @@ -68,6 +63,8 @@ search_engines = { wb = "http://en.wikibooks.org/wiki/Special:Search?search=%s", wbf = "http://fr.wikibooks.org/wiki/Special:Search?search=%s", wf = "http://fr.wikipedia.org/wiki/Special:Search?search=%s", + wkf = "http://fr.wiktionary.org/wiki/Special:Search?search=%s", + wk = "http://en.wiktionary.org/wiki/Special:Search?search=%s", wr = "http://www.wordreference.com/enfr/%s", youtube = "http://www.youtube.com/results?search_query=%s", } diff --git a/.save b/.save index 27bcb4c6..3ba13e11 100755 --- a/.save +++ b/.save @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################ ## Home Config Backup Script -## 2012-06-21 +## 2012-06-29 ################################################################################ ## Note for Zsh: because of the KSH-style arrays (index starting at 0), you ## cannot use array index to append elements to arrays -- or the KSH_ARRAYS @@ -115,9 +115,8 @@ if [ -e "/usr/bin/pacman" ]; then PKG_LOCAL='pacman -Qq | sort' PKG_FOREIGN='pacman -Qmq | sort' PKG_EXPLICIT='pacman -Qeq | sort' - PKG_FILTER='grep \< | cut -f2 -d" "' - diff <(eval "${PKG_LOCAL}") <(eval "${PKG_FOREIGN}") | eval "${PKG_FILTER}" >"${ARCH_PKG_OFFICIAL}-$(hostname)" + diff <(eval "${PKG_LOCAL}") <(eval "${PKG_FOREIGN}") --new-line-format='' --unchanged-group-format='%>' >"${ARCH_PKG_OFFICIAL}-$(hostname)" eval "${PKG_EXPLICIT}" >"${ARCH_PKG_EXPLICIT}-$(hostname)" eval "${PKG_FOREIGN}" >"${ARCH_PKG_AUR}-$(hostname)" diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index dfc7716c..7b7534dd 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -323,8 +323,16 @@ cleanvcs() fi } - - +## LSOF stats. Print number of open files per process. +lsofstat() +{ + LSOFOUT=$(lsof|awk '{print $1}') + + for i in $(echo $LSOFOUT |sort -u);do + echo -n "$i " + echo $LSOFOUT | grep ^$i | wc -l + done +} ##============================================================================== ## Pacman Functions @@ -355,6 +363,14 @@ if [ -f "/usr/bin/pacman" ]; then pacman -Qi $1 | grep "Size" | sed 's/^[^[:digit:]]*//' } fi + +## Retrieve official packages list. +if [ -f "/usr/bin/pacman" ]; then + pacman-official() + { + diff <(pacman -Qq|sort) <(pacman -Qmq | sort) --new-line-format='' --unchanged-group-format='%>' + } +fi ## Compare installed packages with list. if [ -f "/usr/bin/pacman" ]; then diff --git a/README b/README index 2578e95b..d6206528 100644 --- a/README +++ b/README @@ -1,13 +1,12 @@ ################################################################################ # Unix Home Configuration # # Author: Ambrevar # -# Date: 2012-06-21 # +# Date: 2012-06-29 # ################################################################################ Synopsis ******** This repository contains configuration files for various Unix-programs. - Target distribution: Arch Linux (might work for most Unices as well) Generic Comments @@ -18,7 +17,7 @@ technical support. (Especially for applications that do not provide examples in their documentation.) There is no use in blind-copying the content of any file into your personal home folder. At best it might break things. -In case you still want to copy some files -- for quick genuine testing purpose +In case you still want to copy some files -- for quick and dirty testing purpose -- do not forget that most of the files are in hidden folders. Also note that in some shells, the '*' joker will NOT match hidden files, that is @@ -27,7 +26,16 @@ in some shells, the '*' joker will NOT match hidden files, that is will copy non-hidden folders only. To match all folders, use the following joker instead: - cp -r source-dir/.??* dest-dir/ + cp -r source-dir/{.*,*} dest-dir/ # zsh + cp -r source-dir/{.??*,*} dest-dir/ # bash + +Still, the solution for bash is not perfect as it affects 3 characters files +only. A more convenient solution: + + # bash only. + shopt -s dotglob + cp -r source-dir/* dest-dir/ + Some applications will need extra dependencies other than the default ones. You might have a look at the .arch-pkg-explicit* files to see what software I've