title: Variable Substitution in Awk Print Statement -v

text: I've spent over an hour poking at this. It can't be this hard... I want to print a column of data from one file to another file. The column I want to print is dependent on what is passed in and stuff happening earlier in the script, but it is called COL. The file I need to pull the information from is called $1.db, $1 being the first argument passed in (already checked that it exists). What I have currently:               awk -v colvar="$COL" '{ print $colvar }' "$1.db"  >> tmp2.tmp      This results in the entire contents of $1.db being printed to tmp2.tmp, not just the column. When I sh -xv it, I see               awk -v colvar="$COL" '{ print $colvar }' "$1.db"  >> tmp2.tmp     + awk -v colvar=3 '{ print $colvar }' cop4342.db      So, I see that the awk var is being set to the value of COL, but it isn't being substituted inside the print statement. I suspect that is due to the single quotes, but don't know what to do about it. Any help appreciated : )


title: /usr/bin/cmake: is a directory. Not able to grab the version of cmake?

text: I just have installed CMAKE in my ubuntu machine.. So when I do whereis cmake, it gives me the actual path               username@phx7b02c-ee1b:~/CMAKE/cmake-2.8.11$ whereis cmake     cmake: /usr/bin/cmake      But whenever I try to get the version of cmake, I always get the below message.. I am not sure what wrong I am doing here?               username@phx7b02c-ee1b:~/CMAKE/cmake-2.8.11$ /usr/bin/cmake --version     -bash: /usr/bin/cmake: is a directory      Can anyone help me here?


title: Daemontools multilog loses log line time information. How to fix it?

text: I am using daemontools to monitor a process and its output log. I am using multilog to write the logs to disk. The run script for the log is:               #!/bin/bash     PATH=/usr/local/bin:/usr/bin:/bin     cd /usr/local/script_dir     exec multilog t s16777215 n50 '!tai64nlocal' '!/bin/gzip' /var/log/script_log      The process being monitored, also writes output to stderr. So in the run script for the process there is the following lines to redirect stderr to stdout:               exec 2>&1     exec ./my_process      However, while tailing the log file, I see hundreds of lines of output coming in bursts (the monitored process writes output every few seconds), and the timestamp on the log lines differs in sub-microsecond levels. I know from the nature of the process that time difference between the log lines is not so small. Clearly multilog is buffering output and then adding the timestamp when it is ready to write to file. I would like the timestamps to more closely reflect the time at which the line was output. How can this be fixed?


title: Delete all files in directories except those whose path are listed in a file

text: Given the following files:               data/A/a.txt     data/B/b.pdf     ...     date/P/whatever.log     ...     data/Z/z.jpg      I would like to delete all files in the `data/A/`, `data/B/`, ..., `data/Z/` directories _except_ those files that are situated under one of the directories listed in the file `data/dont_clean.txt`. For example, if we have `data/P` listed in `data/dont_clean.txt` then nothing should be touched under `data/P/`, etc. Something like:               find data/ -mindepth 2 -maxdepth 2 -type f -not -path {listed in data/dont_clean} -delete      Of course it is not a valid command. I have also tried variants of               find data/ -mindepth 2 -maxdepth 2 -type f -exec grep data/dont_clean.txt '{}' \;      but I only created either an invalid command or I had no idea why I got the output I did. I am using bash on Ubuntu 12.10


title: Add and edit bookmarks to pdf

text: By getting metadata from some pdf files with bookmarks by `pdftk`, I observe the format of bookmarks in pdf metadata. So I am guessing that with `pdftk`, it is possible to add and edit bookmarks of a pdf file. Here are three steps that I follow:   1. I firstly get the metadata (including bookmarks if any) from a pdf file into a text file by `pdftk in.pdf dump_data > in.info`.   2. Next I add some bookmarks into the metadata text file `in.info`, changing it from              InfoKey: Creator     InfoValue: PScript5.dll Version 5.2     InfoKey: Title     InfoValue: SSReader Print.     InfoKey: Producer     InfoValue: Acrobat Distiller 7.0 (Windows)     InfoKey: Author     InfoValue: Administrator     InfoKey: ModDate     InfoValue: D:20050605073244+08'00'     InfoKey: CreationDate     InfoValue: D:20050605073244+08'00'     PdfID0: 591a87c91dc76881fdf2ccf3811e72a5     PdfID1: 6b6ab11de8824e438e4f5eb1d85ec72     NumberOfPages: 400     PageLabelNewIndex: 1     PageLabelStart: 1     PageLabelNumStyle: DecimalArabicNumerals      to              InfoKey: Creator     InfoValue: PScript5.dll Version 5.2     InfoKey: Title     InfoValue: SSReader Print.     InfoKey: Producer     InfoValue: Acrobat Distiller 7.0 (Windows)     InfoKey: Author     InfoValue: Administrator     InfoKey: ModDate     InfoValue: D:20050605073244+08'00'     InfoKey: CreationDate     InfoValue: D:20050605073244+08'00'     PdfID0: 591a87c91dc76881fdf2ccf3811e72a5     PdfID1: 6b6ab11de8824e438e4f5eb1d85ec72     NumberOfPages: 400     BookmarkTitle: Front cover     BookmarkLevel: 1     BookmarkPageNumber: 1     BookmarkTitle: About the Author     BookmarkLevel: 1     BookmarkPageNumber: 5     BookmarkTitle: Title page     BookmarkLevel: 1     BookmarkPageNumber: 6     BookmarkTitle: Copyright page     BookmarkLevel: 1     BookmarkPageNumber: 7     BookmarkTitle: Foreword     BookmarkLevel: 1     PageLabelNewIndex: 1     PageLabelStart: 1     PageLabelNumStyle: DecimalArabicNumerals        3. Then I try to put the edited metadata back to the pdf file by `pdftk in.pdf update_info in.info output out.pdf`. But when I open the new pdf file `out.pdf` in evince or adobe reader, there is no bookmark in the new pdf file. If I get the metadata from the new pdf file `out.pdf` by `pdftk out.pdf dump_data > out.info`, there will be no bookmarks in `out.info`. It looks like the bookmarks were not added successfully. I was wondering if there are some mistakes? How shall I add and edit bookmarks of a pdf file, not necessarily by pdftk?


title: Items in context menu in Lubuntu

text: I am using Lubuntu 11.10. When I call the context menu (right click) many programs appear to open some file. For example, for `.tex` files, besides TeXstudio and Leafpad, Gnumeric (what a strange option!) and text editor also appear. So, I'd like to remove those bad options. For some extensions (`.txt` for example) I could remove the wrong programs by deleting the `.desktop` files somewhere in `.config` subfolders. How should I do this?


title: GUI is blurred after yum update in fedora 15

text: Since last few days I was using fedora 15 without any issue. But after updating fedora 15 using yum update command. Here is the screen shot ![enter image description here](http://i.stack.imgur.com/92JPr.jpg) How to fix this issue, is there any missing package ?


title: Can't do backward search with big N in vim, some plugins override it

text: I just found I couldn't do the backward search with `N` anymore, it looks like to be overridden by some other plugins, ![enter image description here](http://i.stack.imgur.com/oPMjG.png) Not sure how that happened, how do I find out which plugin got this?


title: Squid block site except for some pages

text: I have Squid proxy server installed on my machine. I created a file `/etc/squid/block.acl`, where all the bad domains are written. And added the following statement to squid.conf:               acl bad_url url_regex "/etc/squid/block.acl"     http_access deny bad_url      Suppose, there is a domain: finam.ru. I want to block access to all its pages, except for these pages: `finam.ru/analysis/*` How to do it? I tried regexp, but it doesn't work.


title: Xdotool using "DISPLAY=:0" not works in Crontab

text: I need to run shell script contains Xdotool codes in `/home/z/Desktop/tempo/run.sh`. I've tried many ways of `DISPLAY=:0` but always not works. I've tried each of below codes, and not works:               * * * * * export DISPLAY=:0 cd /home/z/Desktop/tempo; ./run.sh     * * * * * export DISPLAY=:0; cd /home/z/Desktop/tempo; ./run.sh     * * * * * export DISPLAY=:0 && cd /home/z/Desktop/tempo; ./run.sh     * * * * * DISPLAY=:0 cd /home/z/Desktop/tempo; ./run.sh     * * * * * DISPLAY=:0; cd /home/z/Desktop/tempo; ./run.sh     * * * * * DISPLAY=:0 && cd /home/z/Desktop/tempo; ./run.sh      Running directly also not works:               * * * * * export DISPLAY=:0 xdotool mousemove 20 20     * * * * * export DISPLAY=:0; xdotool mousemove 20 20     * * * * * export DISPLAY=:0 && xdotool mousemove 20 20     * * * * * DISPLAY=:0 xdotool mousemove 20 20     * * * * * DISPLAY=:0; xdotool mousemove 20 20     * * * * * DISPLAY=:0 && xdotool mousemove 20 20      I always dont see my mouse moving on each line of codes above I've also tested Xdotool codes to make invalid website URI request and see the logs. Sadly the logs still blank.


title: Routing an Email from my server

text: I am a C# programmer and doing an internship as a programmer, where i have to work with _linux_ , which I've never done before. I have installed and configured `postfix` successfully on a Linux server (Debian). My company has some online server (e.g. with IP `11.100.200.250`). And I have checked it by sending email through `telnet`, and it's working fine. Now my boss wants me, that an email ID, `mailsend@ourcompanydomain.com`. He is using `Outlook`. Whenever he sends an email from this address, the email should be routed from the online server (11.100.200.250) on which I have installed and configured `postfix`. I have searched a lot on Google, but so far I have been unable to find out what exactly I have to do.


title: What is the purpose of the 'install' command?

text: I've seen the `install` command used in a lot of Makefiles, and its existence and usage are kind of confusing. From the manpages, it seems like a knockoff of `cp` with less features, but I assume it wouldn't be used unless it had some advantage over `cp`. What's the deal?


title: How to download Microsoft Media Pack plugin for Moonlight?

text: I know that Moonlight is no longer supported, but it's still available to download. But to play videos I need Microsoft Media Pack. Microsoft also no longer supports it, but do you know about an alternative source when I can download it ? I use debian 7.


title: How to concatenate two files on the fly and reference result as new file?

text: I want to concatenate two files, i.e. staticEntries.dic and dynamicEntries.dic. As the names might show, the content of staticEntries.dic stays the same over time (contains common words), but to the contrary, dynamicEntries.dic might change over time (contains abbreviations that are extracted from DB). In my editor, I want to provide a mydict.dic, which contains the content of both files. I could do that via Shell, of course, but then I would have to replace the dynamicEntries.dic stuff from the mydict.dic file before concatenating a new version of dynamicEntries.dic to my resulting mydict.dic. -> I would like to create a mydict.dic file that contains a command to concatenate the two other files, but I don't know how to do that. Since it is not executed or called by my editor (I guess), I can't use bash commands. Subsequently a simple example: Content of staticEntries.dic               house     dog     horse      Content of dynamicEntries.dic. This content is generated based upon a database, so it changes over time.               EGB38     PD     UH7ZT      Pursued content of mydict.dic               house     dog     horse     EGB38     PD     UH7ZT      If I do that combination via shell, I have a problem if a new version of the file dynamicEntries.dic is generated: how to avoid duplicate entries in the mydict.dic file? So I would like to put the concatenation command in a file and reference it as a normal file I can provide as dictionary file to my editor. I don't know whether this is possible or if I have to apply another approach.


title: playonlinux crashing on Fedora 19

text: I installed playonlinux using the default repository and when I run the command `'playonlinux'` its getting crash and prints this output               Traceback (most recent call last):       File "mainwindow.py", line 34, in <module>         import wx, wx.aui       File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/__init__.py", line 45, in <module>         from wx._core import *       File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 4, in <module>         import _core_     ImportError: /lib/libgbm.so.1: undefined symbol: wayland_buffer_is_drm     /usr/share/playonlinux/playonlinux: line 144: python2.6: command not found      Do anyone know a solution for this?


title: Internal Microphone Not Working When Running elementary OS on Galago UltraPro

text: I am running elementary OS on a Galago UltraPro laptop. Originally, some of the hardware was not working because elementary uses the Ubuntu 12.04 kernel and the Galago UltraPro uses the relatively new Haswell processor and graphics drivers. However, I managed to get the graphics drivers working properly by running the command: `sudo apt-get install linux-generic-lts-raring xserver-xorg-lts-raring`. Now, the only thing that appears to not be working is the internal mic. I read here: http://ubuntuforums.org/showthread.php?t=2170623, that by plugging in a 3.5mm jack into the microphone jack, the internal mic would work again. When I tried this, the microphone works somewhat for a brief moment, but then fails again. I am imagining the microphone problems have something to do with the fact that elementary OS Luna is based upon Ubuntu 12.04 because when I boot into Manjaro Linux, the internal microphone works as expected. Is there some way to fix this issue by updating sound drivers, or something like that?


title: Why system call hooking produces different result everytime in Linux/Android 2.6.29?

text: I have implemented system call hooking for `Android 2.6.29` kernel through a `LKM module`. I am tracing down one Android app for system calls. But interestingly, it returns different results every time I get a list of system calls. I am not able to make bold text in the code section, so I have put ** to show where the difference starts. For example, first run:               our_sys_gettid ---> uid = 10028        our_sys_open ---> uid = 10028 with filename= /dev/cpuctl//tasks, flags= 131073, mode=0       our_sys_write ---> uid = 10028 with fd= 30, buf = 230 and count=3       our_sys_close ---> uid = 10028 with fd= 30        our_sys_setpriority ---> uid = 10028 with which= 0, who=230 and niceval=0       our_sys_futex ---> uid = 10028 with uadd=������, op=1, val=1, utime=<NULL>, uaddr2=������ and val3=        **our_sys_gettid ---> uid = 10028        our_sys_open ---> uid = 10028 with filename= /dev/cpuctl//tasks, flags= 131073, mode=0       our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3196467192       our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3196467192 **      our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3196466496       our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3196466496       our_sys_dup ---> uid = 10028 with fildes=32       our_sys_close ---> uid = 10028 with fd= 32        .....................      Second run:               our_sys_gettid ---> uid = 10028        our_sys_open ---> uid = 10028 with filename= /dev/cpuctl//tasks, flags= 131073, mode=0       our_sys_write ---> uid = 10028 with fd= 30, buf = 228 and count=3       our_sys_close ---> uid = 10028 with fd= 30        our_sys_setpriority ---> uid = 10028 with which= 0, who=228 and niceval=0       our_sys_futex ---> uid = 10028 with uadd=������, op=1, val=1, utime=<NULL>, uaddr2=������ and val3=        **our_sys_gettid ---> uid = 10028        our_sys_open ---> uid = 10028 with filename= /dev/cpuctl//tasks, flags= 131073, mode=0       our_sys_write ---> uid = 10028 with fd= 30, buf = 228 and count=3       our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198662648       our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198662648       our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198661952**       our_sys_close ---> uid = 10028 with fd= 30        our_sys_setpriority ---> uid = 10028 with which= 0, who=228 and niceval=0       our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=1181359656       our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198661952       our_sys_dup ---> uid = 10028 with fildes=32       our_sys_close ---> uid = 10028 with fd= 32        ....................      Third run:               our_sys_gettid ---> uid = 10028        our_sys_open ---> uid = 10028 with filename= /dev/cpuctl//tasks, flags= 131073, mode=0       our_sys_write ---> uid = 10028 with fd= 31, buf = 228 and count=3       our_sys_close ---> uid = 10028 with fd= 31        our_sys_setpriority ---> uid = 10028 with which= 0, who=228 and niceval=0       our_sys_futex ---> uid = 10028 with uadd=������, op=1, val=1, utime=<NULL>, uaddr2=������ and val3=X{�D        **our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198035960       our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198035960       our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_clock_gettime ---> uid = 10028 with which_clock=<NULL>, tp =         our_sys_munmap ---> uid = 10028 with addr=1183178752 and len=770048       our_sys_close ---> uid = 10028 with fd= 32**        our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198035264       our_sys_ioctl ---> uid = 10028 with fd=21, cmd=3222823425 and arg=3198035264       our_sys_dup ---> uid = 10028 with fildes=31       our_sys_close ---> uid = 10028 with fd= 31        ........................      Any idea why it's producing different results every time? Is there any other better tool to trace system calls? I heard of `strace/ptrace`, `auditd` etc but not sure if they are usable for Android or not.


title: Curl with ipv6 not working by default

text: I am trying to curl ipv6 addresses, but without success. If I try lets say: > curl https://google.com I wait for a timeout and get `network unreachable` If I force `ipv4`, everything is fine. > curl -4 https://google.com Then again if I force ipv6, like this: > curl -6 https://google.com I get: > curl: (7) Failed to connect to 2800:3f0:4001:806::1005: Network is > unreachable I suppose it has to do somehow with resolving `ipv6` addresses. I saw that on other computers that have a newer version of some Linux distro, these requests go fine, so I'm guessing it has to do something with me using `Ubuntu 10.10`, where this problem isn't solved. I want to be able to curl normally without using the option: `-4`, what do I have to modify to be able to use curl normally with `ipv6` addresses?


title: May have broken a Debian installation: 'sudo dpkg --configure -a' won't run

text: I did an `apt-get upgrade` on my Jessie vps, hosted by DigitalOcean. As many people know, DigitalOcean provides kernels from the host, rather than allowing the VM to boot from its own kernel image. Thankfully there is a workaround using kexec to reboot, loading a newer, more up-to-date kernel if DO falls behind on security fixes. Now, I cannot get `dpkg` to configure libselinux1:amd64. An update for it was put out, but `dpkg` just causes a kernel panic. This happened originally on my `apt-get upgrade`, and now it's happening when I run `dpkg --configure -a`. I'm not sure what to do at this point. Any tips would be helpful. I'm running the 3.10.11 Jessie kernel through kexec, but when the VM first boots, it boots from a 3.11.5 Sid kernel supplied by DigitalOcean because for some reason in their kernel management they only have Stable and Unstable and no 64-bit Testing kernels. Go figure.               init: log.c:861: Assertion failed in log_serialise: log->io     init: Caught abort, core dumped     Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000600      The install still works, I'm just unable to update any packages until this is fixed.


title: Unable to add source via command line

text: I am trying to install latest version of glusterfs in Ubuntu by running this command:               apt-add-repository ppa:semiosis/glusterfs-3.2      It does not give any result. The session won't even close (Ctrl+C not working). I had to close the terminal window to end the session. Error shown is:               Traceback (most recent call last):       File "/usr/bin/add-apt-repository", line 88, in <module>         ppa_info = get_ppa_info_from_lp(user, ppa_name)       File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py",             line 80, in get_ppa_info_from_lp         curl.perform()     pycurl.error: (28, 'connect() timed out!')


title: Network bandwidth measurement on Solaris

text: I want to install `pathtest` or a program like it in a Sparc server running solaris 10. The purpose is to make a speedtest server to my remote sites. It is mentioned in pathtest FAQ that it only installs in x86 Windows and Linux variants.   1. Is there a way to install it? or    2. Is there any equivalent function? (I've searched in sunfreeware but naught) or    3. Do I have to resort to install another OS on top of Solaris 10?


title: Trailing space when generating md5

text: I apologize if this has already been answered, or if the answer is simpler than I realize, but I can't seem to figure out the following: When I try to generate an md5 from a string, either with               echo -n "string" | md5sum | cut -f1 -d' '         or with               echo -n "string" | openssl md5         the result is not 32 characters, as I would expect, but rather 33 (using `wc -c`).    So, I have a few questions:   1. Why do both md5sum and openssl add a trailing space?   2. Is there another way to generate an md5 hash without a trailing newline or space?   3. Does the trailing space really matter?    Thank you all in advance.


title: Installing prstat package command on Ubuntu Linux

text: I'm trying to run the prstat command on my Ubuntu server, but it doesn't seem to be installed, I have searched the web for the package name needed to install it but without any luck for some reason.. I'm still surprised that `vmstat, iostat` and `vmstat` come pre-installed and work fine but `prstat` doesnt seem to exist...


title: How can I avoid the prompts when installing a FreeBSD port?

text: When I install a port, I am often presented with a menu screen to select configuration options. If I'm going to install a really big package with lots of dependencies, that will be extremely inconvenient. Is there a make flag for accepting the default answers for all such prompts?


title: Change OS Name from email send by exim

text: OS: FREEBSD 9 OS ROLE: SERVER MAIL SERVER: EXIM When I send mail from my freebsd server to gmail. and when i click on show original. I shows my os name too along with mta name. as in first line of following quote.               Received: from root by myprivateserver.org with local (Exim 4.80.1 (FreeBSD))         (envelope-from )         id 1WL5v6-0000XL-3E         for nishananand@gmail.com; Wed, 05 Mar 2014 07:07:12 +0000     To: nishananand@gmail.com     Subject: hello     Message-Id:      From: Charlie Root      Date: Wed, 05 Mar 2014 07:07:12 +0000      My question is this that can I hide the the freebsd from               (Exim 4.80.1 (FreeBSD)) Or can htis line be customized at least.


title: system boot appears in last but not in /var/log/messages

text: I am looking after a Red Hat Enterprise Linux 5.4 server. A user sent me a copy of the output from the `last` command and it shows multiple reboots on different days (there is no visible pattern to the reboots) and, most of these reboots were not done by a user. When I checked the `/var/log/messages` files (all four of them), they all showed no reboots. I've checked the `/var/log/boot.log` files (five of them) and they're all blank - in fact they're all zero bytes in length. The entries in the `/var/log/messages` files do not show any "break" for the time that the last command shows that the system was rebooted. Why does one application record that the system was rebooted and another application has no record of the reboots?


title: How to fix boot failure after update

text: I did a `apt-get update` on Debian. After reboot the system lost its mount point and failed to boot. How could be accomplished to fix the boot failure?


title: tar + how to extract from /var/tmp in order to place the directories under /

text: I work with solaris 9 machine In order to extract the **list.tar** file I need to change directory to / And from there I do:                tar -xvf list.tar      Example               Cd /          tar -xvf list.tar                x usr/local/cds/api/SNMP/s_trap.pl, 7644 bytes, 15 tape blocks      x usr/local/cww/lib/Storage/SW.pl, 76537 bytes, 150 tape blocks      x etc/cs/shared/functions.pl, 13801 bytes, 27 tape blocks      x etc/cp/shared/globals.pl, 4042 bytes, 8 tape blocks      my question how to do the                tar –xvf from /var/tmp ? ( is it possible )      if I do that from /var/tmp , then tar will create the directorates under /var/tmp , in place to create then under / example                  /var/tmp/usr/…….      solaris tar usuage:                     Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...


title: How to check my account on embedded linux without "/etc/passwd"?

text: On some embedded linux systems, there is no `/etc/passwd` file and `/etc` directory is not writable (which means I cannot set user account and password?). Then what is my (default) account name and password, or how to set account and password? I need to get account and password on embedded linux to run `ssh` server, which requires user account and password for `ssh` login.


title: dd remove range of bytes

text: Given this file               $ cat hello.txt     hello doge world      I would like to remove a range of bytes to end up with this               $ cat hello.txt     heorld      I would like to do this with `dd` if possible. The reason is because I am already using `dd` to overwrite bytes in this manner               printf '\x5E' | dd conv=notrunc of=hello.txt bs=1 seek=$((0xE))      I prefer to write back to the same file, but a different output file would be okay.


title: Problem with file permissions in shared directory under /srv between OS X and Ubuntu

text: I'm setting up some folders where any user in the `users` group can collaborate on files, on a Ubuntu 12.04 LTS server. It seems that `users` on my machine have no problems editing each other's files (I have configured ACL group permission). However, we have `users` connecting through the Mac OS X Finder `Network` window, and these users are not able to edit files created on the Ubuntu box, nor vice versa. They are able to create and edit their own files. I can see their created files, but not edit them. They don't appear to respect the ACL mask. Any idea what might be causing this? -- Updates: Responses to Questions -- Joseph R - I don't know the answer to your question. I have used `setfacl` to configure the appropriate permissions for the `users` group, and I (likely wrongly) assumed that OS X would respect these settings. robbat2 - Last night I determined that I was using AFP, which might actually be the root of the issue (I'm using `netatalk` on Ubuntu). I'm beginning to think that the solution will be to force users to use NFS. Would this be the prudent choice?


title: Pin Lock Screen

text: Is there a way to replace password lock screen in Linux (Mint Debian Edition) with a pin lock screen? Like the one found in Windows 8 for example. It's annoying/inconvenient to have to input 16 character-long passwords every time I lock my computer, and insecure to decrease the password length to a pin- friendly length. Clarification: Pin: 4 character-long password that's used only in the lock screen. i.e. the regular user password to execute functions is still the same throughout the OS (for security).


title: Is there a way to embed a GPG public key in a script without adding it to the keyring?

text: I have a script that basically needs to do the following:               #!/bin/bash           GPG_PUBLIC_KEY=<<EOF     -----BEGIN PGP PUBLIC KEY BLOCK-----     Version: GnuPG v1.4.12 (GNU/Linux)     ...     -----END PGP PUBLIC KEY BLOCK-----     EOF          gpg --encrypt --with-public-key "$GPG_PUBLIC_KEY" myfile.txt      Is there a way to do this without importing the GPG key to the keyring first?


title: Is a bad NFS mount preventing a clean boot?

text: I'm on Ubuntu server 11.10 (x86) and I basically ran into this problem as this: http://serverfault.com/questions/56588/unmount-a-nfs-mount-where-the- nfs-server-has-disappeared The `umount` command didn't work, so I tried to just use the ol' reboot. Now the machine gets an error when booting:               FS-Cache:netfs 'nfs' registered for caching     <two minutes later>     init: udevtrigger post-stop process (345) terminated with status 1      I tried booting in recovery mode so I could just comment out the bad NFS mount in my `/etc/fstab` file, but I wasn't able to write the changes. I basically just want to get the machine booting properly again so that I can erase the bad mount point, either order is fine. This assumes that the FS- Cache error is due to the bad NFS mount, and that might be a poor assumption. What are my options here?


title: xrandr detects amplifier as monitor

text: To help with setting up multi-monitor X I'm using a simple script to get screen resolution information using `xrandr`. This was working fine until I tried attaching an amplifier to attempt to use HDMI audio output. Now the `xrandr` output contains extraneous information about a monitor which is not present. Is there some way to avoid `xrandr` detecting this device as another monitor? The device is an Onkyo TX-NR509. An obvious workaround is to detach the amplifier every time I start X.


title: Modifying TG3 Broadcom driver

text: I was wondering whether it's possible to modify the said driver in order to prevent adapter from using embedded SRAM, and use system RAM instead. And if so, how to do it. I have a laptop with Broadcom Netlink (BCM57780) Ethernet adapter, which apparently has bad memory chip: ![enter image description here](http://i.stack.imgur.com/HAmiu.jpg) It's fully functional (establishes connection with router and connects to Internet) for few seconds after plugging in the cable. Then it stops working, and immediately brings whole system to halt.


title: How to display every message in a thread with at least one new message?

text: I currently have a macro to quickly show only new messages:               macro index ,sn "l ^a^k~N\n"  "show only new messages"      However, this macro loses the context for new messages in ongoing threads. I would like to be able to modify it so that I'm able to display every message from a thread that has at least one new message in it. I've read the mutt manual a few times, but I don't see an obvious way to achieve this using standard limit patterns.


title: How to get comfortable in linux as an ex-windows user?

text: I've been using linux full time for about 8 years. Now and then I help someone else migrate from windows to linux. Because I don't often use windows, I often find myself forgetting some of the differences between the operating systems. I would like a guide that I can give to such users, to help them get more comfortable with using linux. The guide should include things like the drive mounting systems (`C:\bar\` vs. `/foo/bar/`), and software installation. There are lots of guides out there called "migrating/moving from windows to linux" or similar, but nearly all of them seem to be full of linux propaganda, or installation instructions. That's fine for other purposes, but I want a guide for someone who has already decided to move, (e.g. because they like the concept of open source), and for whom the system has already been installed. So a post-install "I've moved from windows to linux, now what?" kind of guide that covers _practical_ differences (i.e. not philosophical or highly technical) that an average windows user (Someone who uses a computer for websurfing, document editing, movie watching, game playing, etc.) might encounter. Do any such guides exist?


title: Which of these three commands is telling the TRUE Redhat release information

text: I was checking for the Redhat release so this time I used three different commands. Two commands gave the same result but the third command gave different result. Which one is right.               [root@DBtest2 ~]# cat /etc/redhat-release         Red Hat Enterprise Linux Server release 4 (Tikanga)         [root@DBtest2 ~]# /usr/bin/lsb_release --d         Description:    Red Hat Enterprise Linux Server release 4 (Tikanga)         [root@DBtest2 ~]# cat /etc/issue         Red Hat Enterprise Linux Server release 5.5 (Tikanga)         Kernel \r on an \m


title: Bot requesting odd resource in apache logs

text: While studying for the RHSCA exam I set up my first home server and quickly found that bots had already started requesting commonly vulnerable files. It was alarming at first, then just purely amusing once I found out how harmless and ineffective these particular attempts were. Now I am seeing some odd requests in my apache access_log that I just don't understand and was hoping someone could help clarify for me. I don't understand why the bot would request another server from within my server's path. It's my understanding that the bot is requesting the following resource in the log shown below: http://MY.IP.ADD.RESS/http://61.152.144.145/judge.php               58.218.199.250 - - [15/Sep/2012:06:47:38 -0500] "GET http://61.152.144.145/judge.php HTTP/1.1" 404 287 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"      That just doesn't even make any sense. I am getting quite a few of these nonsensicle requests and I was wondering if requesting another server from someone else's server might in someway prove useful for an intruder or if this is just a retarded script kiddie that has no idea what he's doing. Some more examples of this in my access log.               58.218.199.250 - - [14/Sep/2012:05:28:48 -0500] "GET http://59.53.91.9/proxy/judge.php HTTP/1.1" 404 289 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"     59.53.91.9 - - [14/Sep/2012:08:26:55 -0500] "GET http://59.53.91.9/proxyheader.php HTTP/1.0" 404 289 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     59.53.91.9 - - [14/Sep/2012:08:26:57 -0500] "GET http://www.yahoo.com/ HTTP/1.0" 200 101 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     59.53.91.9 - - [14/Sep/2012:13:11:58 -0500] "GET http://59.53.91.9/proxyheader.php HTTP/1.0" 404 289 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     59.53.91.9 - - [14/Sep/2012:13:11:59 -0500] "GET http://www.yahoo.com/ HTTP/1.0" 200 101 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     58.218.199.227 - - [14/Sep/2012:15:34:53 -0500] "GET http://59.53.91.9/httpproxy/proxyheader.php HTTP/1.1" 404 299 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"      I am thinking that maybe these bots are requesting these files to encourage host administrators to actually visit these addresses due to their curiosity with the goal of gathering data, or something. I am thinking this mainly because I visited one and it did a whois lookup on me and displayed that information on the page. I only tried one so I don't know if that is a common pattern. In short, why are these bots requesting other websites from the file structure of my website? I'm using CentOs.


title: Emacs M-x query-replace wrap around the document?

text: I use `M-x query-replace` on Emacs (`M-%`) quite often, and I like that I have the flexibility to choose between these options:               Spacebar               Replace text and find the next occurrence     Del                    Leave text as is and find the next occurrence     . (period)             Replace text, then stop looking for occurrences     ! (exclamation point)  Replace all occurrences without asking     ^ (caret)              Return the cursor to previously replaced text      Is there a way to:   * Cycle back to the beginning of the document after we hit the end of the document?    * Reverse the direction of the search-and-replace in the middle of the execution of the command.


title: Securely running LAMP under a specific user

text: I'm setting up a sandbox type of server that will be used by a couple users as a development environment and knowledge base. The server will have a web frontend so I've installed Apache, MySQL and PHP. Out of the box, everything under `/var/www` is owner by `root:root`. I haven't run a web server in a while but I'm pretty sure this isn't the best way of doing things. I vaguely remember the `www-data` user existing. How can I get apache et al. to run as these users and have files in `/var/www` owned by that user and group (to which I can add my own user too)?


title: Passing arguments to KOrganizer event reminder bash/yad scripts

text: I am refining a bash/yad script which runs when an event reminder is triggered in KOrganizer. (yad is a drop-in replacement for zenity. It is being actively developed and has many more features and options.) When a "normal" KOrganizer reminder is triggered - especially a recurring one, you get a lot of information that is less than useful. This is a very simple script, but it makes a big difference. It pops up an information box on top of the reminder that can have whatever you want in it to clearly describe the event. I'm having trouble getting it to work again. (It worked fine around a year ago when I last used it.) I have isolated the problem to the way KOrganizer passes arguments to the script. Passing HAPPY_BIRTHDAY works. Modifying the script to accept multiple arguments and passing it HAPPY BIRTHDAY works. But, what I want to pass it is something like               "\t\t\t\tHAPPY BIRTHDAY\!\n\n\t\t\t\t\tTo ME\!"       which works from the command line, but I have no idea how to do it from KOrganizer. The script works fine from the command line.               #!/bin/bash     ## custom_reminder     ## Copyleft 01/26/2013 - JPmicrosystems     ## Creates a pop up reminder for use with     ## korganizer          ## Usage: custom_reminder "reminder text"     ##   reminder text can contain some special characters like \n"     ##   Theoretically, it can also conatain some markup tags     ##   Got simple span to work in bash, but not insde korganizer yet          if [ -z "${1}" ]     then       MSG="ERROR - NO MESSAGE"     else       MSG="${1}"     fi          kstart --ontop -- yad --title "Personal Event Calendar" --info --text="${MSG}" --width=300 --height=100      The script is installed using edit existing reminder. Select What: Run application/script and enter the script name "custom_reminder" in Application/Script and the text in Arguments:. Any ideas would be appreciated.


title: How to unprotect Excel sheets in Linux (Debian/Squeeze)

text: I have a fairly complex (by my standards) process that extracts Excel files (`.xls`) from certain inbound emails and saves them in a directory on my Debian/Squeeze machine. My next step would have been to use `xls2csv` (`catdoc`) to convert the `.xls` files into `.csv`, before modifying it using regex and loading it into a database. However, I just realized that each sheet in the `.xls` files is locked, preventing `xls2csv` from converting them into `.csv` format. Is there a command/solution to **batch** unprotect the sheets in `.xls` files in a directory? (The idea is to unprotect them in-place, without opening them one at a time.)


title: What is the easiest way to install Meld on RedHat Linux RHEL 5.4?

text: My company has RedHat RHEL 5.4 on the Linux box, and I need to install Meld on it. How can it be done?               $  sudo yum install meld     No package meld available.     Nothing to do          $  sudo yum search meld     No Matches found      The website http://meldmerge.org/ has the download but there is no instructions on how to install it, and the website http://pkgs.repoforge.org/meld/ has `meld-1.1.5-1.el5.rf.noarch.rpm` and `meld-1.1.5-1.rf.src.rpm` Are they the ones to be used for RHEL 5.4 (not the `src` one?) and how to install it -- is it by using `rpm`? Can you give the exact lines on the command lines. Thanks.


title: Diverting a file write to process

text: I have an OSX GUI application which I can't change - it writes new CVS lines to a log file when it completes a job. I'd like to work with these new lines, but they are constantly being added. Is there a way to redirect the application's output directly into a script where I can then process the new lines as it generates them? Reading the file every X seconds to pick up changes isn't desirable, and while I could use `launchd` to detect changes to the file and process them that way - I'm looking for something a bit more elegant. Any ideas (with examples - I'm learning) would be much appreciated. ### EDIT I'm not sure it's the best approach, but I've managed to get instant results via tail's -F flag. While I'm able to filter for the last line, the first time it runs, when the file is updated, it outputs all the lines not just the last one (as desired).               tail -F -n 2 '/path/to/Epson4880_audit.txt' | grep "."


title: Mounting a squashfs filesystem in read-write

text: I have a Clonezilla installation on a USB stick and I'd like to make some modifications to the operating system. Specifically, I'd like to insert a runnable script into `/usr/sbin` to make it easy to run my own backup command to make backups less painful. The main filesystem lives under `/live/filesystem.squashfs` on the USB FAT-32 partition. How can I mount this read/write on my Linux machine in order to be able to add/remove/change files? I'm running an Ubuntu 12.04 derivative.


title: What do the fields in the libata device probe line in dmesg mean?

text: When the kernel boots, it prints out lines like this for each SATA device:               [    0.919450] ata2.00: ATA-8: ST2000DM001-1CH164, CC24, max UDMA/133     [    0.919487] ata2.00: 3907029168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA      What do those fields mean?


title: 'sh: 0: Can't open HoNClient-3.4.3.sh' when I try to run the HoNClient

text: I've been trying to install HoN on my laptop. It's running 32-bit Linux Mint 15. The problem I've run into is this: When I try to run the client in the terminal, using the command:               sudo sh HoNClient-3.4.3.sh      it gives me this:               sh: 0: Can't open HoNClient-3.4.3.sh      I've gone through and made the file executable, but it still doesn't work. Same thing happens when I try:               ./HoNClient-3.4.3.sh      I'm just not sure what's going on, as I've never had this problem before. Any help would be appreciated.


title: List only commands with lsof

text: I tried with               lsof -F c somefile      But I get               p1     cinit     p231     cmountall     p314     cupstart-udev-br     p317     cudevd      Instead of               init     mountall     ...      Any way to get just the command?


title: How to start application after login on CentOS?

text: I am trying to start GUI application with upstart script on CentOS. I have test script located /etc/init/ folder.               start on desktop-session-start     stop on desktop-shutdown          respawn          script     export DISPLAY=:0     sleep 5     exec /.1/Projects/UpstartTest/start.sh &          end script      start.sh scripts is running binary files for GUI application. After reboot my computer. When I typed:               [root@mg-CentOS ~]# initctl status test     test stop/waiting      So my upstart is not runnig. When i type > initctl start test manually it works fine without any problem. How can I run this upstart script after user login (desktop started) ? I am trying to find detailed documents for CentOS for upstart but there is no.


title: CentOS VNC-Server

text: Are there any instructions how to install a VNC-Server on CentOS? Some of them explain how to setup a terminal server, but I primarily want to use the currently logged in desktop.


title: How to mount a flushed hard disk in Xubuntu

text: I want to recover data from an internal hard disk with Windows Vista. I`m using a live CD of Xubuntu. But when I write:               sudo fdisk -l      I obtain only the USB disk in which I have Xubuntu live. How can I retrieve the path of the Windows hard disk and mount it? I have tried with those commands:               xubuntu@xubuntu:~$ udisks --mount /dev/disk/by-id/ata-TSSTcorp_CDDVDW_TS-L633A      Mount failed: Error mounting: mount: no medium found on /dev/sr0          xubuntu@xubuntu:~$ ls -l /dev/disk/by-id/ata-TSSTcorp_CDDVDW_TS-L633A      lrwxrwxrwx 1 root root 9 Nov 11 12:31 /dev/disk/by-id/ata-TSSTcorp_CDDVDW_TS-L633A -> ../../sr0      I think the disk is `/dev/sr0` but the mount doesn`t work...


title: How do I install drjava in linux from terminal?

text: I've downloaded `drjava-stable-20100816-r5366.jar` file which is the drjava version for Linux. How do I install it on my machine? I'm running Ubuntu 11.10. I have OpenJDK Java 6 runtime and Sun Java 6 runtime on my machine already.


title: Creating numerous directories using mkdir

text: I would like to create many directories using `mkdir`. Each directory name will consist of a prefix (a string) and an index (an integer). Suppose that I would like the prefix to be "s" and the indices to range from 1 to 50. This means that I would like to create directories titled: `s1`, `s2`, ... , `s49`, `s50` Is there a way to do this automatically using `mkdir`? Thanks for your time.


title: Play sound when connecting to network

text: I thought it would be fun to play a sound when connecting to a network of some sort (wireless or otherwise), kind of like the dial-up sounds of yesteryear. EDIT: Clarification: when connecting to the network, so the sound starts playing when the connection attempt is initiated, and stops when the connection is successfully established A google doesn't bring up anything obvious.. Any ideas? (I'm willing to [attempt to] write a plugin or something, if someone could point me in the right direction)


title: Data Recovery programs in Unix?

text: I did not expect to miss Windows when I changed it to Debian here. Now I need to get the installation-media back. By which tool can I get the installation media back in Unix? I use Debian.


title: What does this "matching lines means"?

text: The grep manual says "By default, grep prints the matching lines.". What does this matching lines says. When I tried its prints the whole paragraph containing the pattern.


title: Sample file for grep

text: Can anyone please point to some good sample files that helps to learn grep. This is for academic use. It should be a large one so that students could understand its importance


title: Tmux Terminfo problem with Zsh key bindings

text: Zsh in Emacs edit mode comes with the default key binding `ALT` + `Backspace` to delete a word on the right side of the cursor and `ALT` + `D` to delete a word on the left side. I would like to add the latter function to `ALT` + `DEL` additionally. I tried to use the `terminfo` database to set the escape sequence for the key combination for every `$TERM` correctly. In `man terminfo` I read about `kDC3` being the Capname which I probably need to use for `ALT` + `DEL`. I added the following line to my `~/.zshrc`:               bindkey -e `tput kDC3` kill-word      This works nicely when I connect to my machine directly through SSH (`$TERM` is `xterm`). But when I start Zsh inside a Tmux-session (`$TERM` is `screen`) I get the following error message:               tput: unknown terminfo capability 'kDC3'      Could that really mean that it's impossible to bind anything to `ALT` + `DEL` in Tmux? Or am I just doing something wrong? Maybe `kDC3` is not the correct sequence? I'm running Debian Wheezy Beta 4 x86_64.


title: How to diff two folders by inodes

text: I'm currently using a script to backup files on my computer. In a nutshell, it works like this:               rsync --link-dest=$FOLDER/current $SOURCE $DESTINATION      However, I think that my script may be duplicating some files rather than hard linking them. I would like to verify which files are (or aren't) detected as duplicates. I know that the file has been hardlinked correctly of the two files share the same inode. **How can I do a diff of two folders by inodes?**


title: Provide passphrase to plymouth ask-for-password from command line

text: I'm working on booting a headless server (Fedora 16), entering the passphrase to decrypt the root disk (LUKS) over SSH using dropbear. I've got dropbear all working: I can SSH to the server while it's sitting and waiting for the password. But I can't figure out how to actually pass the password to use. The crypt script that asks for the password and decrypts the volume uses the `plymouth ask-for-password` command; is there a way to pass the password into this command from the command line? I've tried writing to the process's stdin, but that didn't work. Is there some other way I can do it?


title: How to Kill Difficult Task in Mac Terminal

text: I ran this grep:               grep -r "\-\-\-foo\-\-\-" * | grep -vi bar      For the past 5 minutes my Mac has been running hot (I can hear the fan) and I can't hit `Ctrl``z` or `x` or `c` to kill the current task. Even the clock on my Mac hasn't updated in 6 minutes. How can I kill the task?


title: Hash symbol on a teletype

text: My issue is a bit unusual, so I want to provide a short background. I was looking at old winners of the International Obfucated C Code Contest, and came across an entry written for the PDP-11 (the entry is here, for those interested). So, I searched for an emulator, which I found at http://simh.trailing-edge.com/, and booted it with UNIX v7 (from the same site). Again, for those interested, I found instructions on booting it at http://wandel.ca/homepage/unixdemo.html. With that background in mind, here is my actual issue. As I was typing the program into ed, it was being funny about hash characters. They wouldn't actually save in the file. After a lot of research, I discovered it was emulating a physical teletypewriter (!), and since you couldn't backspace a character printed on paper, a hash meant "ignore the previous character". So my question is this: How do I actually type a hash character?


title: Can I install ubuntu on a Virtualbox image and use it anywhere?

text: I am wondering if I install ubuntu once on a virtual machine running inside virtualbox, could I then use it as a portable OS and launch it from virtualbox on any machine? Or would I have to match the hardware of the original host? I am just wondering if it would be smarter to do this or get a live CD and just create snapshots as I add more stuff into it. (kind of a pain but I will if need be.) I am new to both VMS and *nix so if is a silly question then pardon my ignorance.


title: Flash disk USB Fedora installation reset counting

text: I have created a flash disk with pen drive Linux universal USB installer to install Fedora 18 on my system but after booting, a counter starts and then reset and never installation begin. My system is Asus eee pc 1025ce, any suggestion?


title: python vs bc in evaluating 6^6^6

text: I am evaluating the expression `6^6^6` using `python` and `bc` separately. The content of the python file is `print 6**6**6`. When I execute `time python test.py`, I get the output as               real        0m0.067s     user        0m0.050s     sys         0m0.011s      And then, I ran the command `time echo 6^6^6 | bc` which gave me the following output               real        0m0.205s     user        0m0.197s     sys         0m0.005s      From these results it is clear that the sys time taken by python and bc was 11ms and 5ms respectively. The **bc command outperformed python at sys time level** but when it comes to **user and real time python was almost 4 times faster than bc**. What might have gone there. I haven't given any priority to the processes as such. I am trying to understand this situation.


title: Where should I look for error messages after a freeze-up and reboot in Linux?

text: I was forced to shutdown (using the power button) and reboot after my laptop froze with just a black screen. After such an incident, where should I look for error messages etc. that might indicate what caused the freeze? I am running Xubuntu (Lucid) with Fluxbox as my window manager. Any suggestions are welcome but I generally prefer to use the CLI.


title: Can I upgrade to a newer Ubuntu version on a Ubuntu-based distribution?

text: I'm currently running elementary OS Luna, which is based on Ubuntu 12.04. Can I upgrade my installation to have a Ubuntu 13.04 base, but still use elementary OS's desktop environment and applications? Would elementary OS's packages break because they expect the dependency versions in Ubuntu 12.04? Would I be better off installing 13.04, building elementary OS's packages from source, and then reconfiguring all my preferences for everything?


title: How do I create a GUI application launcher for xfce4-terminal with fish but inheriting the environment variables from bash?

text: If I run `fish` from a `bash` prompt, it will inherit the environment variables I have set in my `.bashrc` and `.profile` files, including the important `$PATH` variable. So far so good. Now, I want `xfce4-terminal`, my terminal emulator, to use fish instead of bash. I found that it supports a `-e` command line parameter for that but if I run `xfce4-terminal -e fish` from a GUI application launcher1 then I don't get the environment variables from bash. What gives? * * * 1 Launching xfce4-terminal from an interactive bash prompt also didn't work but gnome-terminal, who has a similar command line switch did. However, gnome- terminal also didn't get the variables when launched from a GUI shortcut.


title: Copy and paste a file/directory from command line

text: Instead of using the following command: > cp {source file} {dest file} I want to be able to copy a file into the clipboard, and paste it somewhere else, in another directory. something like this: > **/usr/local/dir1#** cp {source file}   >  **/usr/local/dir1#** cd /usr/local/dir2   >  **/usr/local/dir2#** paste Is it possible?


title: Since Android has malware, does it mean no Unix is immune from malware?

text: Android has virus: Android.Counterclank, Android.Tonclank (seal info, back- door). Does it prove that FreeBSD, Solaris, Fedora, CentOS, ArchLinux, Ubuntu all is running and having similar virus/trojan/malware, but not in publicly well known? Basically in general linux/unix desktop or server, we do not see because there is no scanner/nor better tools available nor we care by saying Linux/Unix do no thave virus. But Android shout proves it every Linux/Unix has trojan/virus/malware sitting and sleeping somewhere which is stealing business logic, confidentical information, transactions, paswords etc same like Windows?


title: How does Bash path completion work with sudo?

text: Tab path completion does not work (at least on Ubuntu and AFAIK Arch) with               sudo mount <whatever>      The iso file I am trying to mount is not in `/etc/fstab`. If I just type               mount <whatever>      the completion works (but of course the command fails as I am not root). Apparently it is `sudo` that breaks it. How can make completion work with sudo? It is surprising that with               sudo umount <whatever>      completion works. How is it achieved? Does it look into `/etc/fstab`? **Solution:** I just put a shell script into `/usr/local/bin` that calls `sudo mount ...` with the arguments passed to it. Completion works when calling this script since there is no `sudo` in the way.


title: Getting Samba 4.1's "internal DNS" to update hostnames from dhcpd

text: Samba 4 comes with its own "internal DNS" which can be used rather than BIND. Since Samba 4's main new feature is AD replacement, I would figure that its DNS would function similarly to Windows Server's DNS, inasmuch as a client being given an address from a DHCP service on the same machine should notice the DNS of the client's hostname and new IP. However, running Samba 4.1.3 with internal DNS, alongside `dhcpd`, on CentOS 6.4, I am experiencing the scenario that some DHCP clients do not get their hostnames registered. It may just be ones connecting through a wireless router, I haven't checked all of them. Such clients, I guess because they aren't reverse-DNS-able, and thus don't conform to the minimums needed for AD participation, cannot access the Samba fileshare (e.g. via `\\\sambaserver` in Windows Explorer), but can only access our intranet server and the internet. (Interestingly, some clients are pingable by their `client-hostname` fields as found in `/var/lib/dhcpd/dhcpd.leases`, but return via a different name on the same domain than the one pinged. I.e. I `ping a` and it says `PING a.my.dom` followed by `64 bytes from a2.my.dom`. I'm not sure whether I consider this to be a problem, or if it's related to the above problem, but I include it in case it indicates some relevant information.) How can I ensure that DHCP clients get their hostnames registered with DNS?   I've set `allow client-updates;` in `dhcpd.conf` and restarted the service.


title: login with xdm and umlaut in password

text: I want use `xdm` to login to my machine and start my session. My password contains an umlaut. I'd rather not change the password as it is quite long and complex and I just memorized it. Login works fine in `xdm` if there is no umlaut in password. Login works fine if I login to shell directly with umlaut in password (I start my X Session from there currently). So my assumption was that login in `xdm` should work fine with umlaut as well. My `LANG` parameter is `de_DE.UTF-8`. I can become `root` on the machine. If I type the Password in the username field of xdm it looks perfectly valid and displays the umlaut correctly. So, maybe its a `ISO-8859-15` vs. `UTF-8` problem, but I have no idea how to probe that.


title: Why does the Linux kernel report "out of disk space" when in reality it is out of i-nodes

text: A friend of mine who likes programming in the Linux environment, but doesn't know much about the administration of Linux recently ran into a problem where his OS (Ubuntu) was reporting "out of disk space on XXX volume." But when he went to check the volume, there was still 700 GB left. After much time wasted, he was eventually able to figure out that he was out of inodes. (He was storing lots of little incremental updates from a backup system on this volume and burned thru all his inodes.) He asked me why the Linux kernel reported the error message ("out of disk space") instead of properly reporting ("out of inodes"). I didn't know, so I figured I would ask StackExchange. Anyone know why this happens? and why it hasn't been fixed after all these years? (I remember a different friend telling me about this problem in 1995.)


title: Delete XML node containing certain element

text: I want to remove all Placemarks from a KML file that contain the element `<tessellate>`. The following block should be **wholly** removed:               <Placemark>         <styleUrl>#m_ylw-pushpin330</styleUrl>         <LineString>             <tessellate>1</tessellate>             <coordinates>                 0.0000000000000,0.0000000000000,0 0.0000000000000,0.0000000000000,0             </coordinates>         </LineString>     </Placemark>      I have tried some non-greedy perl regex with no luck (a lot of stuff is removed together with the first `<Placemark>`):               sed -r ':a; N; $!ba; s/\n\t*//g' myplaces.kml |     perl -pe 's|<Placemark>.*?<tessellate>.*?</Placemark>||g'      I believe a XML parser is the way to go, but I read the documentation for xmlstarlet and got nowhere. So any solutions in xmlstarlet, python, etc. are also welcome!


title: vim on FreeBSD does not react on arrow keys correctly and other vi-like behaviours

text: I tried to use vim on FreeBSD (via ssh on Linux xterm-compatible terminal). However vim behaves similar to vi out-of-box. For example it does not react on delete key, insert F character instead of going up while on insert mode etc. On FreeBSD X11 is not installed. **Edit** : As asked I post `vim --version`               # vim --version     VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jul 28 2010 11:48:54)     Included patches: 1-6, 8-35, 37-48, 50-70, 73, 75-87, 90-92, 94-100, 102-137, 139-149, 151-171,     173-190, 192-193, 195-203, 206-211, 213-215, 217-218, 220-232, 234-246, 251-259, 261-301, 303-319, 321-322, 324-335, 337-351, 353-361, 363, 366-371, 373, 375-376, 378-383, 385-387, 389-398, 401-402, 404-411     Compiled by root@enterprise.piechotka.com.pl     Big version without GUI.  Features included (+) or not (-):     +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent      -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments      +cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic      +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path      +float +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand      +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap      +menu +mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm      -mouse_jsbterm +mouse_netterm +mouse_sysmouse +mouse_xterm +multi_byte      +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript      +printer -profile -python +quickfix +reltime +rightleft -ruby +scrollbind      +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax      +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse      +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual      +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup      -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save         system vimrc file: "$VIM/vimrc"          user vimrc file: "$HOME/.vimrc"           user exrc file: "$HOME/.exrc"       fall-back for $VIM: "/usr/local/share/vim"     Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/local/include  -O2 -pipe -fno-strict-aliasing  -D_FORTIFY_SOURCE=1             Linking: cc   -L/usr/local/lib -o vim       -lm -ltermlib -liconv


title: Strings enclosed in '' are ignored when using grep

text: When I tried searching for a string within a file, the results didn't include those that were enclosed in single quotes. For example:               grep -rn text folder/      The results didn't include strings the looked like this:               'text'      Care to tell me what I'm doing wrong? UPDATE: I just tested it with a new file and it worked! It looks like it only happened in one particular file (a ruby file). Maybe its concerned with encoding?


title: list of vitualization technology that run on linux

text: We decide to select a solution for virtualization. > Is there any benchmark for comparing them by eachother? I have list of vitualization technology that run on Linux


title: How can I either encrypt or render my shell script unreadable?

text: How can I encrypt or scramble my shell script so that it's unreadable to the naked eye? Either method would be acceptable, please provide specific steps.


title: useradd fails on archlinux

text: testing out archlinux in a vm by following a tutorial on youtube.. all is fine up until the point where i reboot, boot with the hard disk and enter `root` at the login screen. i am trying to add a new user with the useradd function like the guy does in his walkthrough. I enter:               useradd -m -g users -G lp, scanner, audio, video, optical, storage, network, power, games, wheel -s /bin/bash iKlsR       upon entering that i get this error > useradd: group `` does not exist I followed his instructions as closely as possible yet his works and mine doesn't, is the syntax accurate and or there any pitfalls to adding a user this way, im thinking about trying the interactive `adduser` but im interested in what this does and understanding the switches etc.


title: Restricting D-Bus access to the logged-in user via ConsoleKit or systemd

text: I need to restrict the client of a D-Bus service to only the user logged into the system locally, via ConsoleKit or systemd. How must I configure or write the D-Bus service to do so?


title: Running gnome-keyring-daemon in CentOS?

text: I successfully installed MySQL Workbench in Centos 6.2. When I run MySQL Workbench and try to store a password by clicking "Store in Keychain", I get the following error: > Could not store password: The gnome-keyring-daemon application is not > running. N.B: after clicking "Store in Keychain", I do enter a the MySQL user/password. When I try to run the following `command /usr/bin/gnome-keyring-daemon -d`, I get the following message: > gnome-keyring-daemon: couldn't lookup ssh component setting: Failed to > contact configuration server; > > some possible causes are that you need to enable TCP/IP networking for > ORBit, or you have stale NFS locks due to a system crash. See > http://projects.gnome.org/gconf/ for information. > > (Details - 1: Server ping error: IDL:omg.org/CORBA/COMM_FAILURE:1.0)gnome- > keyring-daemon: > > couldn't lookup pkcs11 component setting: Failed to contact configuration > server; some possible causes are that you need to enable TCP/IP networking > for ORBit, or you have stale NFS locks due to a system crash. See > http://projects.gnome.org/gconf/ for information. > > (Details - 1: Server ping error: IDL:omg.org/CORBA/COMM_FAILURE:1.0) > GNOME_KEYRING_SOCKET=/tmp/keyring-FazjOu/socket SSH_AUTH_SOCK=/tmp/keyring- > FazjOu/socket.ssh GNOME_KEYRING_PID=20933


title: NOPASSWD option not applying to second command

text: I'm sure that I'm just missing something really simple here, but I have the following sudoers file where I'm intending certain users to be allowed to run a couple of commands as the `repomgr` user without a passphrase:               lambda@host:~$ sudo cat /etc/sudoers.d/repo     Cmnd_Alias REPO_LOAD_PASSPHRASE = /bin/bash -c /home/repomgr/preset-passphrase.sh     Cmnd_Alias REPO_PULL = /bin/bash -c /usr/bin/reprepro -b /var/packages/devel pull          %qa     ALL = (repomgr) NOPASSWD: REPO_LOAD_PASSPHRASE, \                   (repomgr) NOPASSWD: REPO_PULL      Now, the `REPO_LOAD_PASSPHRASE` command works fine; I run that and it doesn't prompt me for a password:               lambda@host:~$ sudo -K     lambda@host:~$ sudo -u repomgr -i /home/repomgr/preset-passphrase.sh     lambda@host:~$      However, the second command, the `REPO_PULL` command, continues to prompt me for a password despite the `NOPASSWD` setting:               lambda@host:~$ sudo -K     lambda@host:~$ sudo -u repomgr -i reprepro -b /var/packages/devel pull     [sudo] password for lambda:      If I check how `sudo` interprets it, indeed everything but the `NOPASSWD` is present for the second command:               lambda@host:~$ sudo -l     Matching Defaults entries for lambda on this host:         env_reset,         secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin          User lambda may run the following commands on this host:         (ALL : ALL) ALL         (repomgr) NOPASSWD: /bin/bash -c /home/repomgr/preset-passphrase.sh,         (repomgr) /bin/bash -c /usr/bin/reprepro -b /var/packages/devel pull      Why isn't this working? What would cause the `NOPASSWD` declaration to just be dropped from the second command?


title: Uncompress files when rsync'in

text: I have 22,000 gzip files on a remote server, which I would like to trasnfer to my machine. I would also like to uncompress these files before/while transferring. Is it possible? My rsync command currently is:               rsync -chavzP test@server1:/var/www/html/reports/id00003383.gz /home/myself/reports/id00003383.pdf      Note: file id00003383.pdf resides within the gz file id00003383.gz. If it is not possible, do I have any other alternative?


title: Counting consecutive repetitions of a specific character (e.g. ,)

text: Say I have a file with lines like the two following:               foo,bar,,baz,xy     foo,,bar,baz,xy,,      I would like to count how many times I have `,,` (two consecutive commas surrounded by any other character) in each line. My approach so far: I thought I could first get rid of **everything** but any pair of consecutive commas on each line, **and then** replace those two commas by a single comma so that I can count them later. How can I do this? The answer above should be (if we substitute the double comma by a single comma throwing everything else away):               ,     ,,      or simply:               1     2


title: Kernel 3.13 on Ubuntu ARM + Android kernel options compatibility

text: I've installed ubuntu 12.04 LTS with the kernel 3.13 on my ARM Samsung / Google Chromebook,using this tutorial : http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/ I have to say that ubuntu works really good. Now I would like to add the Android kernel options inside the `.config` file of the kernel. Can you explain to me why when I add the options listed below to the kernel they disappear after the recompilation? If I look inside the .config file after the kernel is re-compiled, I don't see them anymore! These are the options that I need to enable:               CONFIG_ANDROID=y     CONFIG_ANDROID_BINDER_IPC=y     CONFIG_ASHMEM=y     CONFIG_ANDROID_LOGGER=y     CONFIG_ANDROID_PERSISTENT_RAM=y     CONFIG_ANDROID_RAM_CONSOLE=y     CONFIG_ANDROID_TIMED_OUTPUT=y     CONFIG_ANDROID_LOW_MEMORY_KILLER=y      Maybe because this kernel is not compatible with Android? What should I do to make it what I want?


title: Parallel execution of bash script

text: I have a table `URL_Experiment` in my database ( _mySQL database_ ). I have 2 million URL links in this table. For each URL, I am checking if some particular text is present in the URL and updating the information back in my `URL_Experiment` table. Now, I need to make the script run fast. The easy solution that comes to my mind is: split the `URL_Experiment` into 10 tables (each with 200,000 rows) and run the script 10 times simultaneously. This way, I can ensure that the updates happen properly. But for this, I need to save 10 scripts, each accessing the correct table (I need to rename the tables from 1 to 10). Though the above seems a pretty neat solution, I am looking for a more sophisticated solution. Something which will execute the same script simultaneously (in parallel) as 10 processes. My concern is the execution time. I do not want the resources to be wasted when they can be utilized.


title: Nginx Configuration - Cache headers on certain paths

text: From my understanding of nginx docs, locations can't be nested (or rather if they are the effects aren't inheritable) and `proxy_pass` can't belong at the `server {}` level. So my configuration at the moment is like this, I know I can alleviate some by using filepaths but let's pretend I want different cache headers on different paths whilst using `proxy_pass`. Presumably there is a better way to write this without the repition:               server {       listen  80;       server_name salessystem.acmecorp.com;            location /extjs/ {         ## proxy_buffers 128 256k;         proxy_pass http://localhost:5400/;         proxy_set_header Host $host;         proxy_set_header X-Real-IP $remote_addr;         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         add_header 'X-UA-Compatible' 'IE=Edge;chrome=1';         expires max;         gzip  on;         gzip_http_version 1.1;         gzip_vary on;         gzip_comp_level 7;         gzip_proxied any;         gzip_types text/html text/css text/pdf application/json application/x-javascript text/javascript;         access_log off;         break;       }            location / {         ## proxy_buffers 128 256k;         proxy_pass http://localhost:5400/;         proxy_set_header Host $host;         proxy_set_header X-Real-IP $remote_addr;         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         add_header 'X-UA-Compatible' 'IE=Edge;chrome=1';         expires epoch;         gzip  on;         gzip_http_version 1.1;         gzip_vary on;         gzip_comp_level 7;         gzip_proxied any;         gzip_types text/html text/css text/pdf application/json application/x-javascript text/javascript;         access_log off;         break;       }     }


title: How do I redefine a bash function in terms of old definition?

text: Is there any way I can redefine a bash function in terms of its old definition? For example I would like to add the following block of code to the preamble of the function `command_not_found_handle ()`,               # Check if $1 is instead a bash variable and print value if it is     local VAL=$(eval echo \"\$$1\")     if [ -n "$VAL" ] && [ $# -eq 1 ]; then         echo "$1=$VAL"         return $?     fi      It is currently defined in /etc/profile.d/PackageKit.sh and sourced by bash start-up scripts. That way I can query the value of an environment variable at the command prompt by simply typing the variable name (and provided that no such command by that name exists). e.g.               user@hostname ~:$ LANG     LANG=en_AU.utf8      I know I could just copy and paste the current definition and add my own changes in `~/.bashrc`, but I am looking for a more elegant way that involves code reuse. Better ways of achieving my goal or code improvements/extensions are also appreciated.


title: Installing ruby 2.1 on Arch via RVM

text: I have problems installing ruby 2.1.0 via RVM on Arch. My vagrant provisioning file looks like this:               sudo pacman -Syu --noconfirm     sudo pacman -S --needed base-devel --noconfirm     sudo pacman -S vim --noconfirm     sudo pacman -S git --noconfirm     sudo pacman -S wget --noconfirm     sudo pacman -S gcc --noconfirm     sudo pacman -S clang --noconfirm     sudo pacman -S libyaml --noconfirm      rvm installs 'fine' and I'm able to install ruby 1.9.3 via it. However it fails for 2.0.0 or 2.1.0:               [vagrant@vagrant-archlinux ~]$ rvm install 2.1.0     ruby-2.1.0 - #removing src.     Searching for binary rubies, this might take some time.     No binary rubies available for: arch/libc-2.19/x86_64/ruby-2.1.0.     Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.     Checking requirements for arch.     Requirements installation successful.     Installing Ruby from source to: /home/vagrant/.rvm/rubies/ruby-2.1.0, this may take a while depending on your cpu(s)...     ruby-2.1.0 - #downloading ruby-2.1.0, this may take a while depending on your connection...     ruby-2.1.0 - #extracting ruby-2.1.0 to /home/vagrant/.rvm/src/ruby-2.1.0.     ruby-2.1.0 - #applying patch /home/vagrant/.rvm/patches/ruby/2.1.0/changeset_r44327.diff.     ruby-2.1.0 - #applying patch /home/vagrant/.rvm/patches/ruby/libyaml015.patch.     ruby-2.1.0 - #applying patch /home/vagrant/.rvm/patches/ruby/GH-488.patch.     ruby-2.1.0 - #configuring....................................................     ruby-2.1.0 - #post-configuration.     ruby-2.1.0 - #compiling..................|     ..     Error running '__rvm_make -j1',     showing last 15 lines of /home/vagrant/.rvm/log/1392246637_ruby-2.1.0/make.log     transdb.h unchanged     making trans     make[1]: Entering directory '/home/vagrant/.rvm/src/ruby-2.1.0'     compiling ./enc/trans/transdb.c     linking transcoder transdb.so     compiling ./enc/trans/big5.c     gcc: internal compiler error: Killed (program cc1)     Please submit a full bug report,     with preprocessed source if appropriate.     See <https://bugs.archlinux.org/> for instructions.     enc.mk:760: recipe for target 'enc/trans/big5.o' failed     make[1]: *** [enc/trans/big5.o] Error 4     make[1]: Leaving directory '/home/vagrant/.rvm/src/ruby-2.1.0'     uncommon.mk:560: recipe for target 'trans' failed     make: *** [trans] Error 2     There has been an error while running make. Halting the installation.      Ideas?


title: Issues of using sort and comm

text: I was trying to find the intersection of two plain data files, and found from a previous post that it can be done through               comm -12 <(sort test1.list) < (sort test2.list)      It seems to me that `sort test1.list` aims to sort test1.list in order. In order to understand how `sort` works, I tried `sort` against the following file, test1.list as `sort test1.list > test2.list`               100     -200     300     2     92     15     340      However, it turns out that test2.list is               100     15     2     -200     300     340     92      This re-ordered list make me quite confused about how this sort works, and how does sort and comm work together.


title: Copy and Paste between two guests in RHEV and/or VMware ESXi, is possible?

text: I do have two different setup:   1. setup is with RHEV 3.3 and   2. setup with VMware ESXi Is it possible to copy and paste between the two assigned guests to user, one guest is of Windows 7 and another guest is of `Centos 6.5.` Both this machines are under same user access. I would like to make enable files drag and drop and text copy and paste from clipboard, for both set-ups.Any Help


title: Collate tab-delimited files

text: I want to compare the information from mapping files to retrieve crosslinked information in a tab-delimited file format. For example, one file contains               COG0001 882.DVU3168     COG0002 883.DvMF_2502     COG0001 1140.Synpcc7942_0645     COG0001 1148.SYNGTS_2220      The other file               COG0001 H     COG0002 E      The final file should contain the following information:               COG0001 882.DVU3168 H     COG0002 883.DvMF_2502   E     COG0001 1140.Synpcc7942_0645    H     COG0001 1148.SYNGTS_2220    H      **EDIT** Coming back to my question, I would also like to print information from file 2 to file 3. My command is:               awk -F $'\t' 'FNR==NR{a[$2]++;next}a[$1]''{print $0, ..... }' file2 file1 > file3      This would give me everything from file1 based on what is matching column 2 (file2) to column 1 (file1). How to set so I can also print information from file 2?


title: How to understand the unix time format?

text: How does the Unix time format work? For example, the Unix time for 3:00 PM is:               Normal time format <----3:00PM = 1402565420----> Unix Time      How can I make it understand the time as **3:00 PM** ?


title: Use find command to convert markdown files to html

text: Lets suppose I have files on my harddisk having extensions as `.md`. I want to convert all those files to `.html` through `find` and the `-exec` option. The command to convert a markdown file to html is               markdown readme.md > readme.html      I am trying to use something like:               find / -name "*.md" -type f -exec markdown {} > {}.html \;      Of course, the above doesn't work. So, how do I do that using only `find` and `exec`?


title: How can I ignore "zip warning: name not matched" when using zip command with -d option?

text: I am creating an sh file to run multiple commands in the background. At some line in this file, there is a command to update a zip file like:               zip -d archive.zip file.txt      This file.txt might not be a part of the archive.zip always. When it isn't, the shell script breaks in that line with:               zip warning: name not matched      I want it to continue to the following lines with ignoring non-existence of this file. How can I accomplish this?


title: Reject ssh connections made from proxies

text: I was seeing this question which was concerned with blocking access to the users who do not belong to a particular region. I am sure that blocking is possible but I see there is a workaround to this.   1. I login to the region's proxy from here.   2. I give this URL as the site to visit.   3. Now, I am in the region's proxy and I am able to login to the server as well. Is there a way to reject such circumvented attempts in the `iptables`? I see this as a pretty dangerous security concern.


title: Disable emulated scroll wheel (EmulateWheel) for specific programs

text: Is it possible to disable evdev's EmulateWheel option when using specific programs? In my use case, I would like to be able to interact with the Acme text editor and with some VMs using my Thinkpad's middle-trackpoint-button as just an ordinary middle button rather than an "EmulateWheelButton". It would be less convenient, but acceptable, if there were a simple command to turn emulation on and off, so that I could bind this command to a hotkey so I can toggle it manually.


title: Convert .out file to .pdf using shell script

text: I have a `.out` file I want convert this file to PDF format. Is there any script available for this? File Format :o53770855.out I want to convert this into o53770855.pdf


title: How to control network bandwidth using Linux

text: Currently my Internet is really slow. But I want to allocate all resources to a browser that is loading a movie. How do I do that?


title: Can one move the OCRed text from one PDF to another PDF file?

text: Given a PDF file with OCRed text, is it possible to move the OCRed text to another PDF file?


title: Is this an array?

text: I'm currently looking at an existing script that have something like this:               variable='val1 val2 val3 val4'      Is this another way of setting an array? If not, what is it?


title: How can OCRed text be preserved while converting between djvu and pdf files?

text: Suppose a pdf file has OCRed text. How can we convert it to a djvu file and pass the OCRed text to the djvu file? Conversely, if exchange "pdf" and "djvu" in the above? Thanks!


title: Syntax error in bash script: near unexpected token `else'

text: #!/bin/bash          input=""          echo "Does a wall needs to be sent?"     read input          if [ $input="yes" ]; then        echo "Sending message to all users"        echo ""     else if [ $input="no"]; then         exit         fi     fi     echo "Is this a reboot or shutdown?"           read input     if [ $input="reboot" ]; then        reboot     elif [ $input="shutdown" ]; then     else     echo ""     echo "Goodbye"


title: Pacman -Syu fails `/bin exists in filesystem`

text: I was trying to upgrade my arch linux with `pacman -Syu` after having returned from vacation and now I get this error that I cannot quite make sense of:               (133/133) checking for file conflicts              [######################] 100%     error: failed to commit transaction (conflicting files)     filesystem: /bin exists in filesystem     filesystem: /sbin exists in filesystem     filesystem: /usr/sbin exists in filesystem     Errors occurred, no packages were upgraded.      do you have an idea what is wrong here? The arch linux installation is quite new so I did not expect any serious upgrade issues for some time...


title: Can't change group of files on mount point

text: I have mounted some ntfs drives. `/etc/fstab` looks like this:               /dev/mapper/fedora-root /                       ext4    defaults        1 1     UUID=b6603ac8-e004-4cd6-b141-9bc95409e32a /boot                   ext4    defaults        1 2     /dev/mapper/fedora-home /home                   ext4    defaults        1 2     /dev/mapper/fedora-swap swap                    swap    defaults        0 0     /dev/sda1       /mnt/media  ntfs-3g defaults 0 0     /dev/sda5       /mnt/setups ntfs-3g defaults 0 0     /dev/sda6       /mnt/documents  ntfs-3g defaults 0 0      I want to change the group of all files at path `/mnt/setups/linux`               [root@localhost linux]# ll     total 1075560     -rwxrwxrwx. 1 root root      4256 Sep 22 19:19 adobe-release-x86_64-1.0-1.noarch.rpm     -rwxrwxrwx. 1 root root   5255423 Aug 25 07:21 node-v0.10.17-linux-x64.tar.gz     -rwxrwxrwx. 1 root root  13637009 Aug 25 07:17 node-v0.10.17.tar.gz      I executed the following command:               [root@localhost linux]# chgrp -v admin *     changed group of ‘adobe-release-x86_64-1.0-1.noarch.rpm’ from root to admin     changed group of ‘node-v0.10.17-linux-x64.tar.gz’ from root to admin     changed group of ‘node-v0.10.17.tar.gz’ from root to admin      But, the group still remains as `root`               [root@localhost linux]# ll     total 1075560     -rwxrwxrwx. 1 root root      4256 Sep 22 19:19 adobe-release-x86_64-1.0-1.noarch.rpm     -rwxrwxrwx. 1 root root   5255423 Aug 25 07:21 node-v0.10.17-linux-x64.tar.gz     -rwxrwxrwx. 1 root root  13637009 Aug 25 07:17 node-v0.10.17.tar.gz


title: RapidIO packet filtering in Linux

text: I was wondering if there is support in Linux Kernel for RapidIO packets filtering, something similar to `iptables`, but based on RapidIO header?


title: Where do installed RPMs go?

text: I download and install packages on my Red Hat Enterprise Linux Server 6 machine using **YUM** package manager in command-line mode. When I install **apk** files on my _Android_ phone, they go to `/data/app` directory, I am wondering where _RHEL6_ keeps its installed **rpm** files?


title: Linux as virtualisation host and client performance under Core i7?

text: (to skip the details, jump to last paragraph) A few months ago I built what I thought was a beefed up box with an AMD Phenom II X4 955, 8 GB DDR3 1333 mHz RAM plus a nice motherboard (can't remember exact specs). However I couldn't get a VirtualBox Windows XP guest machine to perform well in it, and later read that AMD CPUs don't work so well in general (???). Anyway, I have been asked to configure and buy a new notebook for a family member, who needs to run a few legacy Windows apps but really wants to use Ubuntu as the main OS to try to squeeze good multimedia performance out of it. Right now I am looking at AVADirect Clevo W860CU with NVIDIA® GeForce® GTX 460M, 8 GB DDR3 1333mHz RAM, and a 7200-rpm hard drive. Due to past experience, I am not confident about virtualisation. One question is: Would a quad core i7 (say 840QM) with slower clockspeed perform better (or worse) than a dual core i7 (say 620M) with higher clockspeed for virtualised guests under Linux? Or should I just tell the person to go with a different host OS?


title: Unable to change xterm colors from .Xresources

text: I'm configuring the look of `xterm` modifying the `.Xresources` but I'm having some trouble changing the colors. I tried with               XTerm*vt100.background:           #000000     XTerm*vt100.foreground:           #666699          XTerm*vt100.color0:               #333366     XTerm*vt100.color8:               #333399          XTerm*vt100.color1:               #6666CC     XTerm*vt100.color9:               #9999FF          XTerm*vt100.color2:               #0099CC     XTerm*vt100.color10:              #00CCFF          XTerm*vt100.color3:               #3366CC     XTerm*vt100.color11:              #6699FF          XTerm*vt100.color4:               #006699     XTerm*vt100.color12:              #0099CC          XTerm*vt100.color5:               #0066FF     XTerm*vt100.color13:              #0099FF          XTerm*vt100.color6:               #669999     XTerm*vt100.color14:              #66CCCC          XTerm*vt100.color7:               #99CCCC     XTerm*vt100.color15:              #CCFFFF      it seems to be recognizing only the `background` and `foreground` colors. After that I found the following theme:                *background: rgb:00/00/00      *foreground: rgb:ff/ff/ff      *color0:     rgb:00/00/00      *color1:     rgb:d3/62/65      *color2:     rgb:ae/ce/91      *color3:     rgb:e7/e1/8c      *color4:     rgb:7a/7a/b0      *color5:     rgb:96/3c/59      *color6:     rgb:41/81/79      *color7:     rgb:be/be/be      *color8:     rgb:66/66/66      *color9:     rgb:ef/81/71      *color10:    rgb:e5/f7/79      *color11:    rgb:ff/f7/96      *color12:    rgb:41/86/be      *color13:    rgb:ef/9e/be      *color14:    rgb:71/be/be      *color15:    rgb:ff/ff/ff      but again it only recognized the `background` and `foreground` colors (black and white). So my question is: What could be wrong and how can I fix it? * * * **EDIT:** Maybe is useful that I post the output of `xrdb -query`:               XTerm*termName: xterm-256color     XTerm*vt100.background: #000000     XTerm*vt100.color0: #333366     XTerm*vt100.color1: #6666CC     XTerm*vt100.color10:    #00CCFF     XTerm*vt100.color11:    #6699FF     XTerm*vt100.color12:    #0099CC     XTerm*vt100.color13:    #0099FF     XTerm*vt100.color14:    #66CCCC     XTerm*vt100.color15:    #CCFFFF     XTerm*vt100.color2: #0099CC     XTerm*vt100.color3: #3366CC     XTerm*vt100.color4: #006699     XTerm*vt100.color5: #0066FF     XTerm*vt100.color6: #669999     XTerm*vt100.color7: #99CCCC     XTerm*vt100.color8: #333399     XTerm*vt100.color9: #9999FF     XTerm*vt100.colorMode:  true     XTerm*vt100.faceName:   Liberation Mono     XTerm*vt100.faceSize:   12     XTerm*vt100.foreground: #666699     XTerm*vt100.geometry:   100x24+0+0     XTerm*vt100.on2Clicks:  line     XTerm*vt100.rightScrollBar: true     XTerm*vt100.saveLines:  2000     Xft.dpi:    96     Xft.antialias:  1     Xft.hintstyle:  hintfull     Xft.rgba:   none     Xcursor.theme:       Xcursor.size:   0     Xcursor.theme_core: 1


title: Check & filter outgoing mails in Postfix

text: I am looking for a way to check outgoing mails with rules like :   * mails sent to a particular domain    * mails sent without subject or with a specific subject   * mails with an attachment of a certain size   * mails sent to x recipients What I want to do when a mail is recognised by one of these rules could be to send it to a special address, to save it with smtp-sink or return a special message. Is this possible to do this check and apply an action within postfix or a couple of scripts called by postfix ?


title: Change GTK themes on the fly

text: I'm not running xfce4 or gnome, so I can't use their respective settings manager. Now I want to alter the GTK theme of all running apps, do you think that's possible? I think there's a signal or whatever can do that, but I couldn't find one. Any ideas? It should works for both gtk2 and gtk3 apps.


title: cannot work out red5 link in linux to input rtmp for player

text: I have red5 server working on Centos 6 thanks to answers in this forum but now I am stuck trying to get linking correct for viewing through player with component requiring RTMP link. I created my own player in flash cs6 and i can see the folder of streams on my linux system but can't configure link correctly. If the path is /usr/local/red5/webapps/oflaDemo/streams/hobbit_vp6.flv how does this translate as an rtmp link? Anyway I can view both streaming live and streaming saved video via the red5 testing page but as I said can't seem to work out link to get it to play in my player for a webpage. VideoError: 1000: Unable to make connection to server or to find FLV on server update: this might be answer looking for : http://blog.endpoint.com/2012/04/streaming-live-with-red5-media-server.html


title: Linux Mint 15 : how to share wifi connection with other devices connected to Ethernet port?

text: My laptop connects to our apartment network via Wifi. I'd like to share this connection using the laptop's Ethernet port, i.e. be able to plug another system into Ethernet and have it also use the Wifi. How do I do this?


title: Graphical login of a local user remotely

text: I'm trying to automate a lab of computers running Fedora 17 (Gnome). I need to write a script that logs out the current local user on the system and logs in as a different user. The systems are currently using gdm. How can I login local users to a graphical interface via an SSH connection?


title: How to clear keybinding

text: I'm in Linux (if it's relevant: Fedora 17 x86_64, 3.6.11) and my laptop's PageUp key has gone ultrasensitive on me. I'd like to disable it (remap it to nothing at all) as I've never liked it where it is (right next to my up arrow keys). I'm sure that I can use xmodmap to do it, but I don't even know where to start. ** EDIT ** I have read through the man page for xmodmap top to bottom. It is not useful for a beginner (makes a great reference for an experienced user, I assume, like the other man pages I use on a regular basis). My biggest problem is in understanding all the opaque terminology they've invented for it. I can see how to remap a single key in its various modified forms, but there's no "IGNORE THIS KEY COMBINATION" option that I've been able to find. I'd like something like:               keycode 112 = NULL PAGE_UP      I'm pretty certain that either `clear` or `remove` might be the answers to my problem, but I can't find a good description of how to use them. The simplest tutorials indicate that `clear` isn't what I want (it's all about modifiers). And `remove` looks like an assignment not a removal


title: How to check the status of bash shell script while executing from Python script?

text: I have a simple Python script which will execute a shell script using `subprocess` module in Python. Below is my Python shell script which is calling `testing.sh` shell script and it works fine.               import os     import json     import subprocess          jsonData = '{"pp": [0,3,5,7,9]}'     jj = json.loads(jsonData)          os.putenv( 'jj3', ' '.join( str(v) for v in jj['pp']  ) )          print "start"     proc = subprocess.Popen('testing.sh', stdout=subprocess.PIPE, stderr=subprocess.PIPE)     (stdout, stderr) = proc.communicate()     if stderr:        print "Shell script gave some error"        print stderr     else:        print stdout        print "end" # Shell script ran fine.      And below is my `testing.sh` shell script -               #!/bin/bash          dir1=some_directory     dir2=some_directory          length1=some_number     length2=some_number          if [ "$dir1" = "$dir2" ] && [ "$length1" -gt 0 ] && [ "$length2" -gt 0 ]     then         for el in $jj3         do             scp david@machineB:/data/be_t1_snapshot/20131215/t1_"$el"_5.data /data01/primary/. || scp david@machineC:/data/be_t1_snapshot/20131215/t1_"$el"_5.data /data01/primary/.         done             fi      What my above shell script does is, it will copy the files from `machineB` OR `machineC` to `machineA`. If the files are not there in `machineB` then it should be there in `machineC` always. So it will try to copy the files from `machineB` to `machineA` but if the files are not there in `machineB` then it will try to copy the files from `machineC` to `machineA`. Now my above Python script (which I am running from `machineA`) tries to execute my above shell script and see whether my script got executed successfully or not. As I am storing the `stderr` of my shell script and `stdout` as well. **Problem Statement:-** With the above approach there is one problem that I am seeing. As I mentioned if the files are not there in `machineB`, then it will try to copy the files from `machineC` to `machineA`. So whenever I run my Python script which calls my shell script, what happens is that, some files are not there in `machineB` so it throws some exception and then it tries copying the files from `machineC` but when the call comes back to Python script, it always go inside `if stderr:` block as there was an error while copying the files from `machineB` (which is not what I want) and `end` print statement doesn't gets printed out. So the question is if the files are not there in `machineB`, it will try copying the files from `machineC` and if the file is there is `machineC` and got successfully copied to `machineA` without any error, then I want to call that as a `success` instead of `failure`. In current scenario what is happening, if the files are not there in `machineB` and got successfully copied from `machineC` then it still counts as a failure and `end` print statement doesn't gets printed out. I also want to see whether my shell script has any problem while executing from Python. If yes, then I don't want to print `end` statement. How should I overcome this problem? **UPDATE:-** What will happen with the below shell script? As the first for loop will failed because david is not a linux command, but my scp command works fine. So still I will see status code as not equal to 0?               for i in $( david ); do         echo item: $i     done          dir1=some_directory     dir2=some_directory          length1=some_number     length2=some_number          if [ "$dir1" = "$dir2" ] && [ "$length1" -gt 0 ] && [ "$length2" -gt 0 ]     then         for el in $jj3         do             scp david@machineB:/data/be_t1_snapshot/20131215/t1_"$el"_5.data /data01/primary/. || scp david@machineC:/data/be_t1_snapshot/20131215/t1_"$el"_5.data /data01/primary/.         done             fi


title: How does logrotate treat globbing?

text: If I have a logrotate config file like this,               # matches multiple ones     /var/log/project/*.log {        ...             prerotate           ...        endscript             ...     }       So how does the glob work here? If I have 3 log file matches that pattern, would the prerotate script get executed for 3 times or only once? I didn't find any clue in `logrotate (8)`


title: Switch between tabs in gnome-terminal with keyboard?

text: Once I've created a new tab in `gnome-terminal` with `Ctrl`+`Shift`+`t`, how can I switch back and forth between the tabs using the keyboard? For example, in Google Chrome the keyboard shortcut is `Ctrl`+`Tab` (forward) and `Ctrl`+`Shift`+`Tab` (backward). I'm using Linux Mint 14 Cinnamon.