title: htop gives blank screen

text: Previously I was using `htop` on 32-bit Manjaro, and it worked fine, then I switched to 64-bit ArchLinux, when starting `htop` it shows a blank screen, and any key press does nothing. I've tried to add `TERM=xterm-color htop`, but it does the same. My current `$TERM` value is `xterm-256color`. I've tried `extra/htop 1.0.2-2`, `aur/htop-svn 308-1` and also `aur/htop- blueweb 1.0.2-1` all give me a blank screen, anything I should do to fix this? EDIT: additional info for ldd: output of `ldd /usr/bin/htop`               linux-vdso.so.1 (0x00007fff5ba70000)     libncursesw.so.5 => /usr/lib/libncursesw.so.5 (0x00007fecdc490000)     libm.so.6 => /usr/lib/libm.so.6 (0x00007fecdc188000)     libc.so.6 => /usr/lib/libc.so.6 (0x00007fecdbdd8000)     /lib/ld-linux-x86-64.so.2 (0x00007fecdc6f8000)      i've tried to reinstall these packages:               core/glibc     multilib/lib32-glibc     core/ncurses      but there are no luck EDIT2: found out using `strace` that there are some program that causes `htop` to hang, after restarting the computer, problem solved..


title: Use grep with or

text: How do I search in a textfile with grep for the occurrence of a word or another word? I want to filter the apache log file for all lines including "bot" or "spider"               cat /var/log/apache2/access.log|grep -i spider      shows only the lines including "spider", but how do I add "bot"?


title: Where to supply authentication details to the Network Proxy (Central Proxy) on Fedora?

text: My system is running Fedora 16 and I live in a campus where we use LAN to connect to the Internet. And for this, we use an http proxy with authentication (username & password). I tried putting the `proxyaddress:port` in the Network Proxy settings after going to the Network Settings window. However, it never asked for an authentication and the programs that use the internet are unable connect, except for Firefox because it asks for authentication. Also, I could get Yum to work by manually editing `yum.conf`. I even tried using `http://username:password@proxy:port` like in the Yum configuration but it has not helped. Is there any solution to this problem? Thank you.


title: How to interpret an octal or hex dump of a binary file?

text: The binary file has strings and some numbers, If I do `od -c filename` or `strings filename`, I can see the strings properly. But, what about numbers? They are in some weird format. The text after doing `od -c filename` is like this:               0000000 036  \0 032 004   S   D  \0  \0  \0  \0   s   e   q   1     0000020          \0  \0  \0  \0  \0  \0  \0  \0  \t  \0   ó 002   3 001     0000040   &  \0 032  \f   O   2 006  \0  \0  \0   o   s   f   u   s   1     0000060           ó 002   3 001   ÿ  \r  \0  \0  \t  \0  \0   @   3   ×     0000100 233   º 004  \0   é 003  \0  \0   &  \0 032  \f   O   2   7  \0     0000120  \0  \0   o   s   f   e   u   1           ó 002   3 001   é 235     0000140  \0  \0 035 003  \0   @   3   × 233   º 004  \0   Ñ  \a  \0  \0     0000160   ä  \0 032  \f   O   r   E  \0  \0  \0   o   s   f   a   p   1      How to decipher this? I even tried `hexdump -C filename` The output is like this:               00000000  1e 00 1a 04 53 44 00 00  00 00 73 65 71 31 20 20  |....SD....seq1  |     00000010  20 20 00 00 00 00 00 00  00 00 09 00 f3 02 33 01  |  ..........ó.3.|     00000020  26 00 1a 0c 4f 32 06 00  00 00 6f 73 66 75 73 31  |&...O2....osfus1|     00000030  20 20 f3 02 33 01 ff 0d  00 00 09 00 00 40 33 d7  |  ó.3.ÿ......@3×|     00000040  9b ba 04 00 e9 03 00 00  26 00 1a 0c 4f 32 37 00  |.º..é...&...O27.|     00000050  00 00 6f 73 66 65 75 31  20 20 f3 02 33 01 e9 9d  |..osfeu1  ó.3.é.|     00000060  00 00 1d 03 00 40 33 d7  9b ba 04 00 d1 07 00 00  |.....@3×.º..Ñ...|     00000070  e4 00 1a 0c 4f 72 45 00  00 00 6f 73 66 61 70 31  |ä...OrE...osfap1|      To clarify, the main file which is a regular file had one attribute which was displaying is some weird format, so we are looking at the raw/binary file. Doing octal dump on the regular file, resolved the viewing problem. With `grep 'id=123' regular_file | head -1 | od -c`, I was able to see what number was in there. I was expecting 1, it showed to us as 001.


title: How to edit /etc/sysconfig/iptables from: RESCUE MODE boot?

text: Let's say the `/etc/sysconfig/iptables` needs to be edited because, due to it I can not ssh to my server. I start my server in "Rescue Mode", but when I login, there is no such thing as `/etc/sysconfig/iptables` to edit. What can be done so I can edit that file from this rescue mode? Or at least, is there a way to reboot the system while ensuring, `iptables` is not started, while inside of the rescue mode?


title: Trying to install Fedora using Unetbootin on a windows 8 laptop

text: The Unetbootin does whatever it says it needs to do, and then when I restart my computer and attempt to launch it says that it cannot find ubnldr.mbr and won't launch. How can I fix this, or is there an easier way to do the same thing?


title: Which AIX command's output is this?

text: Disk          Path  P     Location   adapter    LUN SN       Type         Size   LSS     Vol  Rank  C/A   S   Connection  port RaidMode     -------       -----  -   -----------  ------   -----------  ------------   ----   ----    ---  ----- ----  -   ----------- ---- --------     vpath0        hdisk7     06-00-02[FC] fscsi2   35KJ1320504  IBM 2107-900 65.5GB     2      2   0002   0e   Y   R1-B4-H1-ZA  300 RAID5     vpath0       hdisk19     06-00-02[FC] fscsi2   35KJ1320504  IBM 2107-900 65.5GB     2      2   0002   0e   Y   R1-B7-H3-ZA  630 RAID5      What command produces this output on AIX?


title: What's the difference between /etc/rc.local and /etc/init.d/rc.local?

text: I want to add a permanent `iptables` rule to my new `VPS`, and after brief google search i was surprised that there are two places this rule can be added, that seems like identical: `/etc/rc.local` and `/etc/init.d/rc.local`. Maybe someone knows why where is two places for simple startup code to place? Is it linux flavor specific (but ubuntu has both!)? Or one of them is deprecated?


title: Error when installing Oracle VirtualBox on Ubuntu 12.04

text: I got the following error and couldn't find any solution on Google:               apt-get -f install VirtualBox-4.3          dpkg: error processing /var/cache/apt/archives/virtualbo 4.3_4.3.6-91406~Ubuntu~precise_amd64.deb (--unpack):          error creating directory `./usr/share/virtualbox/rdesktop-vrdp-keymaps': Read-only file system          dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe)     dpkg-deb: error: subprocess <decompress> returned error exit status 2          Errors were encountered while processing:     /var/cache/apt/archives/virtualbox-4.3_4.3.6-91406~Ubuntu~precise_amd64.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)


title: lower bound for download speed in wget

text: I am trying to download some files by using `wget` but after an hour my download speed decrease. And if I cancel downloading and restart it, download speed will increase for an hour. Is it possible to put a lower bound for download speed in `wget`, so that when speed becomes lower than that threshold, `wget` restarts or gets restarted?


title: How do I partition a USB drive so that it's bootable and has a Windows-compatible data storage partition?

text: **split from here** I have a 16gb flash drive, which I want a live ISO to boot from (via unetbootin or something similar). It'll be some 32bit distro that I can plug- in and boot on whatever computer I need to. Since it will be a live ISO, I'll need somewhere to save data. I want the USB drive to have about 1gb for the distro, and the other 15gb for data storage. I made two FAT partitions, the first called 'bootable' and the second 'storage'. The storage works fine in Linux, but Windows only sees the bootable partition. The storage isn't accessible. How can I make the data accessible on Windows, and still have a bootable distribution? If the answer is how to partition it, please include the order and type of each partition. Do I need swap space for this, or is this handled differently?


title: NFS Ownership/Permissions

text: I'm trying to get NFS working properly on a DD-WRT install using OTRW2. I can see and mount the share from the client. But when I do, the mounted folder changes it's owner to `root:root` and so my normal user does not have write access. I saw this post by Frater (the original author of the scripts), in which he says that the `unfsd` service is running as `www-data:www-data` and that the share should be `chown`ed. However when I try `chown`ing the `/mnt` symlink or the `/tmp/mnt` mount, I receive the following:               root@router:~# sudo chown www-data:www-data /mnt      changing ownership of `/mnt': Operation not permitted      root@router:~# sudo chown www-data:www-data /tmp/mnt      changing ownership of `/tmp/mnt': Operation not permitted      My `mount`s look like this:               root@router:/opt# mount      rootfs on / type rootfs (rw)      /dev/root on / type squashfs (ro)      none on /dev type devfs (rw)      proc on /proc type proc (rw)      sysfs on /sys type sysfs (rw)      ramfs on /tmp type ramfs (rw)      devpts on /dev/pts type devpts (rw)      devpts on /proc/bus/usb type usbfs (rw)      /dev/discs/disc0/part1 on /opt type ext3 (rw,noatime,data=ordered)      /dev/sda3 on /tmp/mnt type vfat rw,noatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)      I've tried the default `exports` file as well as this:               root@router:~# cat /opt/etc/exports                                       # /etc/exports: the access control list for filesystems which may be exported      #      to NFS clients.  See exports(5).      #      /mnt       192.168.1.0/24(rw,sync,no_subtree_check,all_squash)          # default     #/mnt       192.168.0.0/255.255.0.0(rw,no_root_squash)      On the client I have a directory that starts out as:               drwxr-xr-x  2 kyle users   4096 Feb 16 09:43 NAS      I've tried from the command line:               kyle@client:~$ sudo mount -v -t nfs router:/mnt NAS      mount.nfs: timeout set for Sun Feb 16 14:09:17 2014      mount.nfs: trying text-based options 'vers=4,addr=192.168.1.1,clientaddr=192.168.1.117'      mount.nfs: mount(2): Protocol not supported      mount.nfs: trying text-based options 'addr=192.168.1.1'      mount.nfs: prog 100003, trying vers=3, prot=6      mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot TCP port 2049      mount.nfs: prog 100005, trying vers=3, prot=17      mount.nfs: trying 192.168.1.1 prog 100005 vers 3 prot UDP port 2049      And with various `fstab` lines:               # router NAS mounting      router:/mnt           /home/kyle/NAS             nfs      auto      0 0      #router:/mnt           /home/kyle/NAS             nfs      rsize=8192,wsize=8192,timeo=14,intr,_netdev,nfsvers=3   0 0      But the folder always ends up as:               drwxr-xr-x 10 root root   16384 Dec 31  1969 NAS      What do I need to do to make the NFS share writable from the client side?


title: Fedora doesn't start X on boot

text: Since a few months I have been facing a problem with Fedora 15. Whenever I start my system, the command prompt is displayed instead of the GUI login. I need to provide a username and password from the command line every time, and after that I have to run `startx`. Whats wrong with my system? Is there any missing file or configuration? How do I fix this problem? Do i need to reinstall my system to solve this problem? Any help and idea will be appreciated.


title: Failed to boot Grub Error Fedora 17

text: I had two hard disks. One is internal, 320GB, all NTFS, where Windows 7 is installed in a ~20GB partition. The other is external, 160GB, where I have installed Fedora. Now when I had installed Fedora I completely detached my internal drive so there is no relationship between internal drive (having Windows) and external. I had installed Fedora17 32bit on my 168GB external drive & I was loving it for about 2 weeks. However something bad happened and now whenever I boot via external drive 'Grub Error, unknown filesystem' appears and I can't proceed. I had been using following partitioning layout: (all as ext4)               /boot 300mb     / 30gb     /opt 9gb     swap 2gb      ...rest as NTFS (to be used universally) The following application (under Windows) has the feature of even identifying Linux based filesystems but as you can see everything is corrupted. ![MiniTool screenshot](http://i.stack.imgur.com/96EnS.jpg) Now I can absolutely recal that I did two things that I believe may be the source of corruption & I urgently need help in troubleshooting it.   1. First thing I did was to apply this tutorial. I know this may appear stupid to apply Ubuntu way over Fedora but I was close to solving it... After applying this tutorial I did log-off several times perfectly but didn't reboot!   2. This may well be the probable reason of corruption. As I said I had one NTFS drive so that I can use it even under my Win7...so I logged on to my win7 as always. I had to do some data transfer from my windows to that NTFS partition but I saw some folder namely `./install` or something like that those may have been created by Fedora but I (being silly) just deleted them I don't know whether they were important or not but after this I shutdown my Win then booted via external drive and first time my Fedora took me to Grub selection menu but failed to start I can't recall comprehensively but it asked me to press Ctrl+D or enter root password for recovery I suppose. I panicked (because I have installed many educational application in my Fedora) and just restarted via pressing Ctrl+Alt+Del then the final dreadful error 'Grub error Unknown filesystem`. I booted via bootable USB the same O installed Fedora with, the following screenshot is of application 'Disks' ![Disks screenshot](http://i.stack.imgur.com/mNalv.png) It doesn't recognise anything except the swap and NTFS (labelled khanz) partitions. I even can't retrieve my Maple/Matlab licences from these (as of now) — unknown filesystems? I was told that I should have a separate `/boot` partition because that avoids what I am facing presently, but that didn't go well either.


title: Find my computer on a LAN network

text: Let's say that I have a computer plugged in to a local network using a dhcp connection, so it will get a different IP every time. Is there a way to find this computer (so the IP) from a different computer on the same local network? Both computers run Linux. I can set up the "lost" computer a'priori before it gets restarted (and gets a different IP), but I would prefer a solution that just works out of the box (if it exists).


title: Finding the IP address of an ssh connection made in the past

text: A few weeks ago I made a few ssh connections from my home PC to my college PC and the other way around. Currently I am sitting at my home PC and I am trying to figure out what was the college PC IP address. Any idea where I could find some clues? I scanned the log files and bash history, but there was nothing obvious there. I am running Debian Testing.


title: Why does Linux show both more and less memory than I physically have installed?

text: I know about swap - this question isn't about that. In dmesg, the Linux (x86-64) kernel tells me this about how much memory I have:               [    0.000000] Memory: 3890880k/4915200k available (6073k kernel code, 861160k absent, 163160k reserved, 5015k data, 1596k init)      `cat /proc/meminfo` tells me that I have               MemTotal:        3910472 kB      And by my calculations, I think I should have exactly 4*1024*1024=4194304k RAM. Which is **way** smaller than the second figure in the dmesg line above! What's with all these different figures? By the way, `uname -a` outputs:               Linux pavilion 3.2.2-1.fc16.x86_64 #1 SMP Thu Jan 26 03:21:58 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


title: Creating a debian package that depends on libcudart.so.6.0 from cuda-core-libs-6-0

text: I try to create a Debian package for a program that depends on libcudart.so.6.0. The debuild script aborts with:               dpkg-shlibdeps: Fehler: Bibliothek libcudart.so.6.0 konnte nicht gefunden werden, benötigt von debian/myprog-cuda/usr/bin/myprog-cuda (ELF-Format: »elf64-x86-64«; RPATH: »«).     dpkg-shlibdeps: Fehler: Kann wegen des vorangegangenen Fehlers nicht fortfahren.     Hinweis: Bibliotheken werden nicht in anderen Binärpaketen, die keine Shlibs-oder Symboldatei haben, gesucht.     Um dpkg-shlibdeps dabei zu helfen, private Bibliotheken zu finden, könnte es notwendig sein, LD_LIBRARY_PATH zu setzen.     dh_shlibdeps: dpkg-shlibdeps -Tdebian/myprog-cuda.substvars debian/myprog-cuda/usr/bin/myprog-cuda returned exit code 2     make: *** [binary-predeb-IMPL/myprog-cuda] Fehler 2     dpkg-buildpackage: Fehler: Fehler-Exitstatus von fakeroot debian/rules binary war 2     debuild: fatal error at line 1350:     dpkg-buildpackage -rfakeroot -D -us -uc failed      I think the equivalent english message is "couldn't find library libcudart.so.6.0 needed by debian/myprog-cuda/usr/bin/myprog-cuda". However, the path to that library is already in LD_LIBRARY_PATH. If I start the dpkg-shlibdeps script manually, then I get a different error message:               $ dpkg-shlibdeps -Tdebian/myprog-cuda.substvars debian/myprog-cuda/usr/bin/myprog-cuda     dpkg-shlibdeps: Fehler: Keine Abhängigkeitsinformationen für /usr/local/cuda-6.0/targets/x86_64-linux/lib/libcudart.so.6.0 (verwendet von debian/myprog-cuda/usr/bin/myprog-cuda) gefunden.      This certainly means "no dependency information found for /usr/local/cuda-6.0/targets/x86_64-linux/lib/libcudart.so.6.0 (used by debian/myprog-cuda/usr/bin/myprog-cuda)" I can fix this problem with               $ echo 'libcudart 6.0 cuda-core-libs-6-0' >debian/shlibs.local      Now, 'dpkg-shlibdeps' completes successfully, when I start in myself. However, this does no affect 'debuild' - it still fails the same way it failed before. It seems that 'debuild' runs 'dpkg-shlibdeps' differently from me. Any idea how to track down or fix the problem?


title: Debian 6 NDISwrapper doesn't install correctly

text: I'm using Debian 6. I've been trying to set up the Netgear N300 WiFi (model number WNA3100) adapter but haven't been successful. The Ndiswrapper was installed from .deb packages which I downloaded on one computer and transfered to the computer I'm haveing issues with. I have added it to /etc/modules               USERNAME@COMPUTERNAME:~$ sudo ndiswrapper     install/manage Windows drivers for ndiswrapper          usage: ndiswrapper OPTION     -i inffile       install driver described by 'inffile'     -a devid driver  use installed 'driver' for 'devid' (dangerous)     -r driver        remove 'driver'     -l               list installed drivers     -m               write configuration for modprobe     -ma              write module alias configuration for all devices     -mi              write module install configuration for all devices     -v               report version information          where 'devid' is either PCIID or USBID of the form XXXX:XXXX,     as reported by 'lspci -n' or 'lsusb' for the card               # /etc/modules: kernel modules to load at boot time.     #     # This file contains the names of kernel modules that should be loaded     # at boot time, one per line. Lines beginning with "#" are ignored.     # Parameters can be specified after the module name.          loop          ndiswrapper      But modprobe doesn't recognize it as present and I can't get online.               USERNAME@COMPUTERNAME:~$ sudo modprobe ndiswrapper     FATAL: Module ndiswrapper not found.


title: Why doesn't this piped script work?

text: #!/bin/bash     rm out     mkfifo out     nc -l 8080 < out | while read line     do         echo hello > out            echo $line     done      If I browse to the IP of the machine this script is running on (using port 8080), I would expect to see the word 'hello' and then on the machine running the script, I would expect it to output lines from the request. However, nothing happens. The browser gets no response, and nothing is output to the server's terminal. Why doesn't it work, and what can I modify to make it work? I want to keep it to simple pipes, I don't want to use process substitution or anything like that.


title: Does ntpd default allow query requests through?

text: I am confused as to what is the default access policy of an ntp server. According to the ntp_acc man page, access can only be denied if specifically blacklisted. > Clients can be denied service because they are explicitly included in the > restrict list created by the restrict command or implicitly as the result of > cryptographic or rate limit violations. To test if I am correct, I ran the following command on an ntp server that didn't have any restrict policy against the client and I was able to successfully query the server.               [root@localhost ~]# ntpdate -q 192.168.122.50     server 192.168.122.50, stratum 3, offset 6.177375, delay 0.02585      4 Nov 20:51:40 ntpdate[2259]: step time server 192.168.122.50 offset 6.177375 sec      This proved my theory that ntp default allows all queries to the server but not necessarily all types of ntp traffic to the server. So here are my question(s):   1. Is all access to an ntp server really unrestricted or is just queries?   2. Can a ntp client modify the time of an ntp server (I would guess this could be done by spoofing yourself as one of the ntp's server's servers but I am not sure)?


title: Limiting grep search

text: Please help! Must use grep for this assignment. Must control grep function to search for a string strictly in a given field (Sadly no delimiters) Search field is characters 12-26. Must check if user input name of choice exists or not (variable "$name"). if so, then must cut out specific fields (No problem with that) My code for this point:               ...(previous lines of code & conditions..)     while read line     do       grep -E "^.{11}[ :alpha: ]{1,15}$name" | cut -c31-43 #(eg. opponent)#      done     ...     #grep start point and end point.       How can I add the option for the user input variable `$name` into the regexp??


title: where are the "files" of ipcs and why are named pipes (mkfifo) not listed in ipcs

text: I was researching about linux shared memory and stumbled upon this `ipcs` command. From the man page:               ipcs - provide information on ipc facilities      `ipc` is not explained in the man page but it most likely stands for inter- process communication. That also makes sense from the context of the information it lists: shared memory segments, message queues and semaphore arrays. I was wondering, since everything in linux/unix is a "file", or at least a file-like object, where are the "files" from the elements listed in `ipcs`? Why are named pipes created by `mkfifo` not listed in `ipcs`? As far as I understand fifos are queues. How are the named pipes created by `mkfifo` different from the message queues created by `ipcmk`?


title: How to manage installed from source programs?

text: I have servers (with Debian or Centos) and I would like to install programs from sources, because I can always have up to date software. If I want to install some program from source I usually do next steps:   1. Download archive with source   2. Unzip and cd to directory with source   3. Run `./configure prefix=/usr/local`   4. `make && sudo make install` After that I remove downloaded archive and unzipped folder with source. My questions are:   1. If I want to update program to newer version, what steps should I perform?   2. How can I remove program installed in such way?   3. Is it correct to remove folder with source after installation or it can be usefull later?


title: Apache server in raspberry PI not visible from outside( public IP)

text: I have made a fresh install of Arch Linux ARM into a Raspberry PI and I mounted there a LAMP, all fresh. I have another Arch(x86) in my laptop with Apache also there, and as far as I know, two web servers cannot run in the same network segment so, the problem is as follows. In my laptop, having Apache running, if I enter via the public ip of my network everything turns ok and I can see my website but, (obviously turning this server down) if I enter from the public IP with the Apache running in the raspberry pi( yes, only that Apache running) i cannot see my website in there. Also, if I access via local network it is a normal success, I can see my website. So, I can enter my raspberry website only via local but in my other web server i can enter it via local and public. I have the same conf files in both of them so what is the difference? I was planning in making the rpi as a development server.   Thanks in advance


title: Command to list contents if directory, or do output contents if file?

text: Is there any command to list the contents if passed a directory, but output the contents if it's a file? For example, often when I am navigating the directory structure I will start typing into the terminal something like               ll /etc/path/  # I see a file in tab-completion that interests me, called myfile.txt     ll /etc/path/myfile.txt  # I do the auto-completion to get it into the command line     less /etc/path/myfile.txt  # Now I have to go back and change 'll' to 'less'      Alternatively, if I'm looking for a file, I start with               less /etc/path  # I see in tab-completion several files that might interest me, so I need to know more     ll /etc/path  # See more info about file sizes, etc, so I can choose the file I want. Have to change 'less' to 'll'     less /etc/path/myfile.txt  # Now that I know which file I want, I have to go back and change 'll' to 'less'      This is something I end up doing dozens of times a day, and starts to slow me down. Is there a command or script that does the likeliest scenario for you? For example               some-program /etc/path/to/file/or/directory      If the target is a text file or symlink to a text file, 'less /etc/path/to/.....' would be executed. But if it were anything else, e.g. directory, binary file, block device, it would do 'll /etc/path/to/......' Of course if it does something you don't want, like 'less' on a file symlink but you want to see the symlink itself with 'll', then you just run 'll' manually. Anything like this exist (I bet it's out there, it seems like such a common task)? Or am I just using Linux command line in an inefficient way and there are better ways to navigate through it...how do you do it? Or I am really the only one going back and forth in the command line all the time switching 'less' to 'll' and back again? I tried writing something but I'm a bash beginner so it's definitely not working, and quite clunky even if it were. Surely there's a better way out there, some magic command I've just not heard about?               some-program() {       if [[ $# > 1 ]]; then         echo "Only one argument supported at this time"       exit 1       fi       if [[ $# == 0 ]]; then         ELEMENT="."       else         ELEMENT="$1"       fi       if [[ -d $ELEMENT ]]; then         ls --color=auto -alF "$ELEMENT"       else         less "$ELEMENT"       fi     }


title: Rsync adding a "?" at the beginning of directories

text: I currently have many of these commands running in a `.sh` file that looks like this:               rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup /home/localbackup     rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup2 /home/localbackup2      When I go to run this, it goes through to the destination correctly, but adds a "?" to the beginning of the directory locally, which prompty fills up the hard drive to the brim. Have I done a flag incorrectly? I thought `rsync` was supposed to sync the directories, not duplicate them.


title: What's those underscore commands?

text: When I `tab tab` `_` in terminal, Bash suggests 206 posibilities. I tried to run one of them `_git_rm` but nothing happend, what are they? Here is a screenshot: ![enter image description here](http://i.stack.imgur.com/AadL6.png)


title: how to determine how many times pid_max wrapped?

text: Is it even possible to know that? may be some kind of tests are required to be performed in order to find that information? My system, just after I login, seem to have already wrapped the max_pid, so a still alive pid got the same pid of an old process (what messes one of mine scripts...)! I am trying to understand what is happening and if there is some workaround to that... my `/proc/sys/kernel/pid_max` is 32768


title: Best way to remove lines from a file where matching text (not whole line) exists in another file

text: I have a file of email addresses (file 1) and another file (file 2) of lines of data that contain some of these email addresses I want to compare files and remove all lines in file 2 that have a matching email in file 1. I know I can do a loop and use `sed -i` or loop and grep each line to a new file then compare files with COMM But I was wondering if there is a comparison method that I can kind of grep all lines in file1 to file2 and just be left with the lines from file2 that do not contain any emails in file 1 file 1:               test@invalid.com     test2@invalid.com     test3@invalid.com      file 2:               23456|tom|jones|test@goodemailcom|10     12345|pete|best|pete@goodemail.com|10     87569|remove3|me3|test3@invalid.com|10     23098|mike|jones|mike@goodemailcom|10     10985|al|best|al@goodemail.com|10     09865|removve|me|test@invalid.com|10     13579|remove2|me2|test2@invalid.com|10      Appreciate any knowledge anyone has.


title: if statement apparently not working in rsyslog

text: I'm trying to use the RainerScript syntax in my Debian `/etc/rsyslog.conf` file. I want to log daemon stuff to a particular file, but only from `pppd`. Here's what I added:               if $programname == 'pppd' then {         daemon.*;local2.*   -/var/log/pppd.log     }      I then restarted the rsyslog service. Stuff does get logged to this file; however I also get stuff from `named` so the `if` statement either seems to be being ignored, or always evaluating to true. Why would either of these be? Have I made a mistake in the code?


title: Can't login after fresh installation

text: I recently installed a new distro called sidbang. I created a liveCD and ran it on my laptop, which worked fine. I then ran the installation script. I set a username, 'sam', and password, 'a' (this was to make sure that I wasn't simply mistyping my password - I will change it as soon as I get into my new operating system). When the installation was finished, I removed the liveCD and booted the operating system from my hard drive. It asks me for a username and password, which I enter. It then says that the login is incorrect. Is there a way to fix this problem? Things I have tried:   1. Trying again      * I thought that I may have mistyped my password during the installation, so I tried reinstalling and reselecting the password multiple times. This did not work    2. Default username and password      * The default username and password that are advertised for LinuxBBQ are 'bbq' and 'bbq'. I wasn't able to log in using these credentials Sorry about the wording and formatting of this question - my laptop is out of order and so I am using a device that I am not comfortable with to ask this question. Thanks, Sam.


title: How to add entries in GPT/ guid table without booting in is?

text: I foolishly deleted entries from guid or gpt table while messing up with gdisk utility, As a result no bootable partition shows up on startup ! I'm stuck at blank screen please help ! How shoul I write entries of partition to guid/ gpt table ? OS : OSX mavericks / windows8 (bootcamp) Machine: MacBook Pro


title: LUKS: encrypted device is much smaller than its host partition

text: To store personal data, I have encrypted a partition with LUKS but, according to the file manager, the resulting encrypted device is much smaller: **334 GB versus 385 GB**. However, the Disk Utility in Debian says the encrypted device is 385 GB. The file manager itself, before mounting the partition, says that it is 385 GB. I have formatted the encrypted device with **ext4**. In case I missed something, here is how I have created, formatted and mounted the device:               # cryptsetup --verify-passphrase --verbose luksFormat /dev/sdc3          WARNING!     ========     This will overwrite data on /dev/sdc3 irrevocably.          Are you sure? (Type uppercase yes): YES     Enter LUKS passphrase:      Verify passphrase:      Command successful.     # cryptsetup luksOpen /dev/sdc3 data     Enter passphrase for /dev/sdc3:      # mkfs.ext4 /dev/mapper/data     mke2fs 1.41.12 (17-May-2010)     Filesystem label=     OS type: Linux     Block size=4096 (log=2)     Fragment size=4096 (log=2)     Stride=0 blocks, Stripe width=0 blocks     23470080 inodes, 93873669 blocks     4693683 blocks (5.00%) reserved for the super user     First data block=0     Maximum filesystem blocks=0     2865 block groups     32768 blocks per group, 32768 fragments per group     8192 inodes per group     Superblock backups stored on blocks:          32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,          4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968          Writing inode tables: done                                 Creating journal (32768 blocks): done     Writing superblocks and filesystem accounting information: done          This filesystem will be automatically checked every 33 mounts or     180 days, whichever comes first.  Use tune2fs -c or -i to override.      Then the file manager allows me to mount the partition. I have also tried to mount the partition manually:               # mount /dev/mapper/data /media/data      But the size difference is still there. Closing and reopening the device does not help. Any suggestions? Thanks. Software:   * Operating System: Debian GNU/Linux 6   * File Manager: Nautilus 2.30.1   * Disk Utility 2.30.1


title: Grepping number in a file

text: I have this command               $ cut -f2,3 AIS2F1 | grep [2-9][0-9]*  | cut -f1      So my second and third fields are something like this               Ben 434     Me  12     you 56      So, I thought that the logic should be to cut the second and third field then grep numbers that are bigger than 20 and then cut the first field. That should give me the name that is on the same line with number that is bigger than 20, but it gives me this output:               Ben      Me     you       instead of               Ben     you       which is what I want, how can I fix this command?


title: GoAccess won't redirect its output as a CGI script

text: I've been pulling my hair with this script:               #!/bin/bash     echo Content-type: text/html     echo ""     goaccess -f /var/www/log/access.log -a | tee      Which runs perfectly on the command line (generates HTML output for access.log), but when I run it as a CGI via the URL, the output isn't the HTML I'm expecting from GoAccess web analyzer but rather:               GoAccess - 0.7           Usage: goaccess -f log_file [-c][-r][-m][-h][-q][-d][...]          The following options can also be supplied to the command:             -f - Path to input log file.     <snipped>      It is as if it's running `goaccess` without any parameters. Either that, or the parameters I specify in my Bash CGI aren't being seen for whatever reason. I'm at the end of my wits. Any people w/some CGI experience that can help?


title: Change the scale of the bar graph in htop

text: Does anyone know of a way to change the scale of the bar graphs in `htop`? The memory one, specifically, doesn't seem based off of percent of memory used-- it's some other scale that seems useless to me. It looks like this:               Mem[|||||||||||||||||||||||||||||||||||||||||||| 1978/7847MB]      When it should look like this:               Mem[||||||||||                                   1978/7847MB]      ...to reflect the correct ratio of memory usage. I am under the impression `htop` is highly customizable, but I'm not sure how to do this.


title: Can pwgen output passwords of a certain length?

text: I'm using the command line tool `pwgen` to generate passwords because I love the repeatability you get with the `sha1` command line flag. To quote the man page:                  -H, --sha1=/path/to/file[#seed]               Will  use the sha1's hash of given file and the optional seed to               create password. It will allow you to compute the same  password               later, if you remember the file, seed, and pwgen's options used.               ie: pwgen -H ~/your_favorite.mp3#your@email.com gives a list  of               possibles  passwords for your pop3 account, and you can ask this               list again and again.                    WARNING: The passwords generated using this option are not  very               random.   If you use this option, make sure the attacker can not               obtain a copy of the file.  Also, note that the name of the file               may  be  easily available from the ~/.history or ~/.bash_history               file.      I'm using it to generate (and retrieve) passwords like this:               pwgen -1cnsy --sha1=/path/to/my/gpg/private-key.asc#username@example.com      The only problem is that I can't figure out a way to specify how many characters I want the password to be. By default it generates an 8-character password, which is more susceptible to brute-forcing. Alternatively, I could use `apg`, which allows me to specify the number of characters, but I don't see a way to make `apg` take a file and string as a seed to give me repeatable characters. Is there a way I can make `pwgen` generate passwords of a specified length?


title: How to download all the e-mail messages from POP3 server to a single text file with mailx?

text: I would like to download all the e-mails in my old e-mail server. It uses POP3 and I'm interested in e-mails in "Inbox" and "Sent" folders. Once I have downloaded all the messages, I would like to make a script which lists all the e-mails between my e-mail address and one certain e-mail address in chronological fashion into single text file. However, at first, I think I need to download all the messages to a single file with headers including dates and then create a sorting script. How to approach this? I have used mailx in scripts for sending mails, but is it possible to use mailx to download all the mails from POP3 server into a single file?


title: How can I know the max possible trasmit power of my wireless card?

text: Is there any way for me to tell the maximum possible power of my wireless card from within Linux? Or do I need to find the product number of the card, and search for specifications like that online?


title: Install RPM file on Arch Linux?

text: I want to install sqldeveloper from Oracle on Arch Linux. The only Linux download option is RPM. I am not interested in using arch repositories to install sqldeveloper. I can only use what the vendor provides.


title: File inheriting permission of directory it is copied in?

text: I have files created into my home directory with only user read permission (`r-- --- ---`). I want to copy this file to another directory `/etc/test/` which has the folder permission of 744 (`rwx r-- r--`). I need to allow for the file I am copying to inherit the permission of the folder it is copied in because so far when I copy it, the files permissions are still the same (`r-- --- ---`). I have tried setfacl command, but it did not work? Please help. PS. I can't just `chmod -r /etc/test/` because there are many files which will be copied into this folder over time and I don't want to run chmod command every time a file is copied over.


title: fastest way to grep jar file for a particular name in it?

text: I am trying to find all the jars which has `spring` in its name. I am working with windows and using cygwin to run the linux commands. Does my below command looks right?               find . -name "*.jar" -exec jar tf '{}' \| grep -H "spring" \;      For some reason, it is still processing and haven't got the result on the screen. Any fast way to grep the jar file with a particular name? For example, below are the valid jar files which has spring in it -               spring-web.jar     spring-core.jar     test-spring.jar


title: How do I switch user without any references to the old one?

text: A while back, when playing with unprivileged LXC, I discovered that the command to create a container failed if I used `su` to switch to the user, but it worked if I used `ssh user@localhost` to login. This is not a LXC related question, but it made me wonder how to best switch user without leaving references or bringing variables from the old one? Thanks!


title: CentOS: FTP (vsftpd) Error 530

text: I struggled my way into setting up FTP on this VPS and I can not get the accounts to work. I did adduser passwd but I get this error in filezilla               Response:   220 (vsFTPd 2.0.5)     Command:    USER Main     Response:   331 Please specify the password.     Command:    PASS *********     Response:   530 Login incorrect.     Error:  Critical error     Error:  Could not connect to server      Anyone Know How I can Fix this?


title: Linux "ip route" changes source address of TCP but not UDP

text: When sending packets from an application that binds to a local address TCP uses a different source address than UDP. For example, bind to 10.10.0.51 (alias IP), the src addr for UDP is 10.10.0.51 but the src addr for TCP is 10.10.0.2 (primary IP address of the machine). This is observed using tcpdump packet capture. The output of "ip route show" includes this line: "10.10.0.0/22 dev eth1 proto kernel scope link src 10.10.0.2" My question: why does TCP use the source address from the routing table but UDP uses the source address the application binds to? This is on CentOS 6.               [user@host ~]$ ip route show     10.10.0.0/22 dev eth1  proto kernel  scope link  src 10.10.0.2      10.20.0.0/22 via 10.10.0.1 dev eth1      10.145.192.0/18 dev eth0  proto kernel  scope link  src 10.145.194.226      169.254.0.0/16 dev eth0  scope link  metric 1002      169.254.0.0/16 dev eth1  scope link  metric 1003      169.254.0.0/16 dev eth2  scope link  metric 1004      default via 10.145.255.254 dev eth0                     [user@host ~]$ uname -a     Linux machinename 2.6.32-358.6.1.el6.x86_64 #1 SMP Tue Apr 23 19:29:00 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux                    [user@host ~]$ ip address show     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo         inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000         link/ether 00:50:56:01:c3:96 brd ff:ff:ff:ff:ff:ff         inet 10.145.194.226/18 brd 10.145.255.255 scope global eth0         inet6 fe80::250:56ff:fe01:c396/64 scope link             valid_lft forever preferred_lft forever     3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000         link/ether 00:50:56:01:c3:97 brd ff:ff:ff:ff:ff:ff         inet 10.10.0.2/22 brd 10.10.3.255 scope global eth1         inet 10.10.0.51/22 scope global secondary eth1:1         inet 10.10.0.52/22 scope global secondary eth1:2         inet 10.10.0.53/22 scope global secondary eth1:3         inet 10.10.0.54/22 scope global secondary eth1:4         inet 10.10.0.55/22 scope global secondary eth1:5         inet6 2002::10:10:0:55/96 scope global             valid_lft forever preferred_lft forever         inet6 2002::10:10:0:54/96 scope global             valid_lft forever preferred_lft forever         inet6 2002::10:10:0:53/96 scope global             valid_lft forever preferred_lft forever         inet6 2002::10:10:0:52/96 scope global             valid_lft forever preferred_lft forever         inet6 2002::10:10:0:51/96 scope global             valid_lft forever preferred_lft forever         inet6 fe80::250:56ff:fe01:c397/64 scope link             valid_lft forever preferred_lft forever     4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000         link/ether 00:50:56:01:c3:98 brd ff:ff:ff:ff:ff:ff     5: ip6tnl0: <NOARP> mtu 1460 qdisc noop          link/tunnel6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00      EDIT: The application in question is SIPp (if that helps).               sipp -sn uac -i 10.10.0.51 -t tn -p 5060 -m 1 -r 1 10.10.0.1          sipp -sn uac -i 10.10.0.51 -t un -p 5060 -m 1 -r 1 10.10.0.1      EDIT 2:               [user@host ~]$ ss -tplan | grep 5060     LISTEN     0      100              10.10.0.51:5060                     *:*      users:(("sipp",14837,3))     SYN-SENT   0      1                 10.10.0.2:50903            10.10.0.1:5060   users:(("sipp",14837,7))          [user@host ~]$ ss -uplan | grep 5060     UNCONN     0      0                10.10.0.51:5060                     *:*      users:(("sipp",14850,3))


title: Replacement to CUPS Browse Protocol

text: The CUPS "browsing" protocol was marked as deprecated being removed at v1.6 of CUPS, due to problems with broadcast and managed networks/WiFi. It's an UDP protocol to broadcast information about installed printers on a CUPS server and share them. In a simple way, the following diagram describes our network and printer propagation using this protocol:                            Browse Protocol                                                                                *Printers are shared as ipp pools on the printserver*      +-----------+                                                                |CUPS Client|  ipp://printserver/printer01, ipp://printserver/printer02      |1.3.7      +--------+                                                       |           |        |      +------------------+                             +-----------+        |      |                  |                                                  +------>   Printserver    |                             +-----------+        |      |   CUPS 1.5.3     |                             |CUPS Client|        |      |                  |                             |1.5.3      |        |      +------+---------+-+                             |           +--------+             |         |                               +-----------+                      |         | ipp://printer01                                       smb://printer02      |                                                                  |         |                                                        +---------v-+    +--v-------+                                                |           |    |          |                                                |Printer 02 |    |Printer 01|                                                |           |    |          |                                                ++----------+    +----------+                                        *Printserver connects to them using                                           all kinds of protocols*                                                                                * The servers have interfaces on the same VLAN to make the zeroconf propagation of printers;   * The clients (some of them) have legacy systems that prints through `lpr`. Their local `cups` have printers pointing to the printserver;   * The printserver announces (broadcast) new printers and changes each 60 seconds; We have about 10 clients that consumes those printserver polls, while the printserver itself connects to 250 printers. Since adding printers on each client would not be a pleasant task, and due to driver issues with newer printers, CUPS needs to be updated I ask: **Question:** Is there an alternative to the browse protocol to add printers in a distributed way? Reasons why this architecture needs to be kept:   * With this centralized printserver i can make job accounting through scripts and send them by email. Synchronizing printers but letting the clients print directly to them would be a "good enough" solution, but not the best;   * Easy to manage printers at one server;   * Security. Since it´s a virtualized environment i can decide which server will have an interface on the same vlan the printserver broadcast it´s pools/printers;   * Our support guys are trained to add and share printers using the default cups administration page(`http://printserver:631`) and they have no access to shell at all. This is why solutions like adding one avahi service to each printer are not good options.


title: Yum on CentOS 7 repositories may be broken

text: Just got CentOS 7 on a new server and I went `yum install httpd` and it went fine. Afterwards I went `yum install mysql-server` and I got `No package mysql-server available`. I haven't messed up with the configuration files. Any suggestion?


title: How to install nvidia driver (gt 755m) on Fedora 20?

text: I am trying to install nvidia drivers for my Geforce GT755M on Fedora 20. I tried installing kmod, akmod and compiled from source. None of them seem to work. I always end up at a black screen. After compiling from source, when I reboot the system, I can not get to the login screen. Here's the output of Xorg.0.log:                [   941.731]      X.Org X Server 1.14.4     Release Date: 2013-10-31     [   941.731] X Protocol Version 11, Revision 0     [   941.731] Build Operating System:  3.14.3-200.fc20.x86_64      [   941.731] Current Operating System: Linux abhay-mittal 3.14.5-200.fc20.x86_64 #1 SMP Mon Jun 2 14:26:34 UTC 2014 x86_64     [   941.731] Kernel command line: BOOT_IMAGE=/vmlinuz-3.14.5-200.fc20.x86_64 root=UUID=9508d200-f5fd-4a84-8ceb-549c1eb548d6 ro vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8     [   941.731] Build Date: 14 May 2014  12:35:26AM     [   941.731] Build ID: xorg-x11-server 1.14.4-9.fc20      [   941.731] Current version of pixman: 0.30.0     [   941.731]    Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.     [   941.731] Markers: (--) probed, (**) from config file, (==) default setting,         (++) from command line, (!!) notice, (II) informational,         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [   941.731] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jun 11 18:57:29 2014     [   941.731] (==) Using config file: "/etc/X11/xorg.conf"     [   941.731] (==) Using config directory: "/etc/X11/xorg.conf.d"     [   941.731] (==) Using system config directory "/usr/share/X11/xorg.conf.d"     [   941.732] (==) ServerLayout "Layout0"     [   941.732] (**) |-->Screen "Screen0" (0)     [   941.732] (**) |   |-->Monitor "Monitor0"     [   941.732] (**) |   |-->Device "Device0"     [   941.732] (**) |-->Input Device "Keyboard0"     [   941.732] (**) |-->Input Device "Mouse0"     [   941.732] (==) Automatically adding devices     [   941.732] (==) Automatically enabling devices     [   941.732] (==) Automatically adding GPU devices     [   941.732] (**) FontPath set to:         /usr/share/fonts/default/Type1,         catalogue:/etc/X11/fontpath.d,         built-ins     [   941.732] (==) ModulePath set to "/usr/lib64/xorg/modules"     [   941.732] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.     [   941.732] (WW) Disabling Keyboard0     [   941.732] (WW) Disabling Mouse0     [   941.732] (II) Loader magic: 0x80dd00     [   941.732] (II) Module ABI versions:     [   941.732]    X.Org ANSI C Emulation: 0.4     [   941.732]    X.Org Video Driver: 14.1     [   941.732]    X.Org XInput driver : 19.2     [   941.732]    X.Org Server Extension : 7.0     [   941.732] (II) xfree86: Adding drm device (/dev/dri/card1)     [   941.935] (II) xfree86: Adding drm device (/dev/dri/card0)     [   941.936] (--) PCI:*(0:0:2:0) 8086:0416:17aa:3801 rev 6, Mem @ 0xc2000000/4194304, 0xb0000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/131072     [   941.936] (--) PCI: (0:1:0:0) 10de:0fcd:17aa:3801 rev 161, Mem @ 0xc0000000/16777216, 0x90000000/268435456, 0xa0000000/33554432, I/O @ 0x00004000/128, BIOS @ 0x????????/524288     [   941.936] Initializing built-in extension Generic Event Extension     [   941.936] Initializing built-in extension SHAPE     [   941.936] Initializing built-in extension MIT-SHM     [   941.936] Initializing built-in extension XInputExtension     [   941.936] Initializing built-in extension XTEST     [   941.936] Initializing built-in extension BIG-REQUESTS     [   941.936] Initializing built-in extension SYNC     [   941.936] Initializing built-in extension XKEYBOARD     [   941.936] Initializing built-in extension XC-MISC     [   941.936] Initializing built-in extension XINERAMA     [   941.936] Initializing built-in extension XFIXES     [   941.936] Initializing built-in extension RENDER     [   941.936] Initializing built-in extension RANDR     [   941.936] Initializing built-in extension COMPOSITE     [   941.936] Initializing built-in extension DAMAGE     [   941.936] Initializing built-in extension MIT-SCREEN-SAVER     [   941.936] Initializing built-in extension DOUBLE-BUFFER     [   941.936] Initializing built-in extension RECORD     [   941.936] Initializing built-in extension DPMS     [   941.936] Initializing built-in extension X-Resource     [   941.936] Initializing built-in extension XVideo     [   941.936] Initializing built-in extension XVideo-MotionCompensation     [   941.936] Initializing built-in extension SELinux     [   941.936] Initializing built-in extension XFree86-VidModeExtension     [   941.936] Initializing built-in extension XFree86-DGA     [   941.936] Initializing built-in extension XFree86-DRI     [   941.936] Initializing built-in extension DRI2     [   941.936] (II) "glx" will be loaded by default.     [   941.936] (WW) "xwayland" is not to be loaded by default. Skipping.     [   941.936] (II) LoadModule: "dri2"     [   941.936] (II) Module "dri2" already built-in     [   941.936] (II) LoadModule: "glamoregl"     [   941.936] (WW) Warning, couldn't open module glamoregl     [   941.936] (II) UnloadModule: "glamoregl"     [   941.936] (II) Unloading glamoregl     [   941.936] (EE) Failed to load module "glamoregl" (module does not exist, 0)     [   941.936] (II) LoadModule: "glx"     [   941.936] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so     [   941.944] (II) Module glx: vendor="NVIDIA Corporation"     [   941.944]    compiled for 4.0.2, module version = 1.0.0     [   941.944]    Module class: X.Org Server Extension     [   941.944] (II) NVIDIA GLX Module  331.79  Sat May 17 23:58:32 PDT 2014     [   941.944] Loading extension GLX     [   941.944] (II) LoadModule: "nvidia"     [   941.944] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so     [   941.944] (II) Module nvidia: vendor="NVIDIA Corporation"     [   941.944]    compiled for 4.0.2, module version = 1.0.0     [   941.944]    Module class: X.Org Video Driver     [   941.944] (II) NVIDIA dlloader X Driver  331.79  Sat May 17 23:37:42 PDT 2014     [   941.944] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs     [   941.944] (++) using VT number 1          [   941.944] (II) Loading sub module "fb"     [   941.944] (II) LoadModule: "fb"     [   941.944] (II) Loading /usr/lib64/xorg/modules/libfb.so     [   941.945] (II) Module fb: vendor="X.Org Foundation"     [   941.945]    compiled for 1.14.4, module version = 1.0.0     [   941.945]    ABI class: X.Org ANSI C Emulation, version 0.4     [   941.945] (WW) Unresolved symbol: fbGetGCPrivateKey     [   941.945] (II) Loading sub module "wfb"     [   941.945] (II) LoadModule: "wfb"     [   941.945] (II) Loading /usr/lib64/xorg/modules/libwfb.so     [   941.945] (II) Module wfb: vendor="X.Org Foundation"     [   941.945]    compiled for 1.14.4, module version = 1.0.0     [   941.945]    ABI class: X.Org ANSI C Emulation, version 0.4     [   941.945] (II) Loading sub module "ramdac"     [   941.945] (II) LoadModule: "ramdac"     [   941.945] (II) Module "ramdac" already built-in     [   941.969] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your     [   941.969] (EE) NVIDIA:     system's kernel log for additional error messages.     [   941.969] (EE) No devices detected.     [   941.969] (EE)      Fatal server error:     [   941.969] (EE) no screens found(EE)      [   941.969] (EE)      Please consult the Fedora Project support           at http://wiki.x.org      for help.      [   941.969] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.     [   941.969] (EE)       I've looked at posts on various forums, and found no working solution. Can't figure out what am I doing wrong. Please help.


title: Aix grep wildcard not working

text: I have a file called **message** that has the line               CSC/UT/USA/WBIMB/SAP/orders05:orders05/ORDERS05/NONE/ORDRSP/758      I am doing a grep (Platform is AIX 6.1)               grep CSC/UT/USA/WBIMB/SAP/orders05:orders05/ORDERS05/NONE/ORDRSP/758 message      it finds the line and displays the output But, when I try to use wildcard as below               grep CSC/UT/USA/WBIMB/SAP/orders05:orders05/ORDERS05/.*/ORDRSP/758 message      it is not finding the line. I have tried with single/double quotes as well. It is not working. Am I missing anything here? I am confused.


title: How are filesystem snapshots different from simply making a copy of the files?

text: by doing this,               # btrfs subvolume snapshot /mnt/1 /mnt/1/snapshot     # tree /mnt/1     /mnt/1     ├── a     ├── snapshot     │   ├── a     │   └── subv     └── subv         └── b          3 directories, 3 files      We can create snapshot from /mnt/1 on btrfs. My question is: what is advantage of using snapshot , than using rsync to simpaly backup filesystem?


title: Issues with Fedora 20 and bumblebee

text: I'm experiencing several issues trying to use my Fedora 20 laptop NVIDIA Optimus technology. My system:               ASUS N53S      Fedora 20 x86-64     3.12.6-300.fc20.x86_64 Kernel     Intel Core i7-2670QM     NVIDIA Geforce 630M      I installed Fedora 20 only yesterday, and immediately updated all the packages using yum. My laptop uses the NVIDIA Optimus technology, which cannot be disabled via BIOS. I've previously used Fedora 16 and followed this guide: http://duxyng.wordpress.com/2012/01/26/finally-working-nvidia-optimus-on- fedora/ to get bumblebee working. The guide worked flawlessly and I was successfully able to do CUDA development on my laptop with no issues at all. For my Fedora 20 installation, the dyxyng guide did not work. With that guide, I was able to start up the bumblebee daemon, but GNOME wouldn't load up when I reboot. I then used this official guide: https://fedoraproject.org/wiki/Bumblebee Bumblebee almost seems to work using these instructions. The discrete graphics is disabled, and can be enabled to run CUDA applications. I've managed to install CUDA 5.5 and was able to compile all the sample, including those using the driver api (cuda.so in /usr/lib65/nvidia-bumblebee). However, when I run any kind of graphical application, such as glxgears or an nbody (which uses CUDA) simulation (from the SDK), SELinux goes nuts and starts throwing up dozens of warnings: ![SELinux alerts on CUDA nbody](http://i.stack.imgur.com/PcWhm.png) Also, my laptop's screen won't turn on after waking the computer from suspension. Besides that, Fedora is using basic graphics when booting, It's possible this issue is unrelated to bumblebee, since my Fedora 16 install seemed boot fine and the screen was able to turn on after waking from suspension. * * * **EDIT** I should mention that certain applications won't run under the bumblebee daemon. For example, the NVIDIA Visual Profiler will not start up when ran with optirun, i.e. `optirun nvvp`, but will run when executed normally by simply running the `nvvp` command.


title: Run two commands on one argument (without scripting)

text: How can I perform two commands on one input, without typing that input twice? For example, the stat command tells a lot about a file, but doesn't indicate its file type:               stat fileName      The file command, tells what type a file is:               file fileName      You can perform this in one line this way:               stat fileName ; file fileName      However, you have to type the fileName twice. How can you execute both commands on the same input (without typing the input or a variable of the input twice)? In Linux, I know how to pipe outputs, but how do you pipe inputs?


title: Run the Zsh first use wizard

text: I made a bad choice when configuring Zsh the first time around, so now I would like to run the configuration wizard (the thing that runs the first time you log in) again. How do I do this?


Can "grub-emu" make any changes to my system? I understand that the command "grub-emu" opens a GRUB _emulator_. However, since it loads the configuration files used by the "real" GRUB, I am a little concerned that this emulator may be able to harm my system. Is it completely safe to experiment with CLI-mode commands in grub-emu?


title: Linux shell lagging one step

text: I upgraded busybox from 1.2.1 to 1.7.4 in my embedded system platform and it is connected to linux host via serial cable. Now when I type any command in shell on that embedded system platform like `ifconfig` it is showing as `ifconfi` only and when I press enter then it show `ifconfig` and again on pressing any key it is showing output of `ifconfig`. I am not sure if it is carriage return problem or stdout buffering issue. Also during boot up of platform it is stops after executing a few scripts and on pressing any key it continues the boot up process. I got stuck there badly, any suggestions?


title: Emacs "jump to class definition" functionality?

text: I want to jump to a class file "A" from another file "B" which defines objects "A". In eclipse, it is done using `F3`. Is there a way to achieve this in emacs?


title: how can I rename multiple files by removing a character or string?

text: As a follow-up to my previous question, if I have multiple files of the form               sw.ras.001     sw.ras.002     sw.ras.003     …      What command can I use to remove the `ras.` in the middle of all the files?


title: Remove whitespace and parentheses in filenames with sed

text: I'm an absolute newbie in the unix area so forgive me off the bat if I've gone about this the wrong way. I have a series of files I need to rename which all have the pattern " (*)" in them. Eg;               001 (1).txt     002 (1).txt     003 (2).txt      My desired output is to rename the files to 001.txt, 002.txt, 003.txt. Note the real files vary in length and extension type (this is my test batch). I have searched the net and SE and come up with the following which gives me the desired output in the terminal.               ls *\(*\)* | sed 's/\(.*\)\( (.*)\)\(.*\)/mv & \1\3/'          mv 001 (1).txt 001.txt     mv 002 (1).txt 002.txt     mv 003 (2).txt 003.txt      However once I pipe it to sh I get the error below.               sh: line 1: syntax error near unexpected token `('     sh: line 1: `mv 001 (1).txt 001.txt'      I know it has to do with the `\\( (.*)\\)` section. I've tried escaping the internal parentheses but then that doesn't give me the desired output. I've also searched for regex ways to say search for the whitespace followed by any 3 characters but have had no luck. I know there are easier ways to achieve what I want but I went with sed as thus far it was the only thing I could vaguely understand. Very much appreciate any input into getting the above line working and then considering easier approaches.


title: Troubles establishing connection with wvdial

text: I have a Huawei cell modem EM680 with which I can establish a connection on my Ubuntu 13.10 box just fine. I plug it in and I can establish a connection using the Connections Manager. I have a box without X server and I want to establish a connection with that same modem on that box. I can get a serial link at `/dev/ttyUSB1` and if I connect to it using `screen /dev/ttyUSB1 460800` and send `AT`, it responds with `OK` just fine -- so the modem works! Ater that I tried to establish a connection using `wvdial` with my `/etc/wvdial.conf` configured like this:               [Dialer Defaults]     Init1 = ATZ     Init2 = AT+CFUN=1     Init3 = AT+CGDCONT=1,"IP","m2mstatic.apn"     Modem = /dev/ttyUSB1     Phone = *99***1#     Modem Type = USB Modem      Username = "blank"     Password = "blank"     Stupid Mode = yes     New PPPD = yes     Baud = 460800     ISDN = 0      I tried to launch `wvdial` without any options or with `wvdial eap-interval 1 require-chap` because in my Connection Manager window, under the tab `PPP` following checkboxes are checked: `EAP`, `MSCHAP`, `PAP`, `MSCHAPv2`, `CHAP`, `Use BSD data compression`, `Use Deflate data compression` and `Use TCP header compression`. But upon launch I just get               # wvdial eap-interval 1 require-chap     --> WvDial: Internet dialer version 1.61     --> Warning: section [Dialer eap-interval] does not exist in wvdial.conf.     --> Warning: section [Dialer 1] does not exist in wvdial.conf.     --> Warning: section [Dialer require-chap] does not exist in wvdial.conf.     --> Cannot get information for serial port.     --> Initializing modem.     --> Sending: ATZ     ATZ     OK     --> Sending: AT+CFUN=1     AT+CFUN=1     OK          --> Sending: AT+CGDCONT=1,"IP","m2mstatic.apn"     AT+CGDCONT=1,"IP","m2mstatic.apn"     OK     --> Modem initialized.     --> Sending: ATDT*99***1#     --> Waiting for carrier.     ATDT*99***1#     CONNECT 14000000     --> Carrier detected.  Starting PPP immediately.     --> Starting pppd at Mon Jan 22 03:26:56 2007     --> Pid of pppd: 4295      Here it waits for a about a minute and then:               --> pppd: H�[02]     --> pppd: H�[02]     --> Disconnecting at Mon Jan 22 03:27:57 2007     --> The PPP daemon has died: Connect script failed (exit code = 8)     --> man pppd explains pppd error codes in more detail.     --> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.     --> Auto Reconnect will be attempted in 5 seconds     --> Cannot get information for serial port.     --> Initializing modem.     --> Sending: ATZ     --> Sending: ATQ0     --> Re-Sending: ATZ     --> Modem not responding.     --> Cannot get information for serial port.     --> Initializing modem.     --> Sending: ATZ     --> Sending: ATQ0     --> Re-Sending: ATZ     --> Modem not responding.     --> Disconnecting at Mon Jan 22 03:28:19 2007     #      but I can never actually reach the internet. Exit code 8 in the pppd man page says: `The serial port could not be opened.` -- which is ridiculous as I just opened (and **closed(!)** it with `screen`). Any ideas where I'm going wrong or what I'm missing? **edit** I just found the connection manager's config file and it looks like this, that might help too, hey?:               [connection]     id=Rogers     uuid=5c4ed6f8-9ece-4888-a129-65ed5c741502     type=gsm     permissions=user:ron:;          [gsm]     number=*99#     password-flags=1     apn=m2mstatic.apn     pin-flags=1          [ipv4]     method=auto


title: Nature of the positional parameters

text: I am beginner to shell scripting and wrote this script which sort of confused me a bit...               function func     {     the variables received are     echo $0: $1 and $2     }     echo in the main script     func ball boy      The name of script is shell.txt I expected the result to be               func : ball and boy      However I got               ./shell.txt :ball and boy      I have read that the positional parameters are "local" in nature then how did this result come?


title: Highlight linux shell commands

text: I have a log of new commands I use and my own tips/descriptions with them inside a text file. I noticed there is DOS Batch code highlighting which highlights DOS commands. Is there one for Linux shell commands? I have the latest gedit-plugins(gedit- plugins (3.10.1-1ubuntu2) installed. **Edit:** (log file snippet) Linux.txt               7/10/2014     =========     netstat -an | egrep 'Proto|LISTEN' (get a list of listening ports)     find / -name "jenkins*"  2>&1 | grep -v "Permission denied"        (get list of files that are not Permission denied)          7/14/2014     =========     setterm -blank (disables screen timeout)     vmware settings > options, /mnt/hgfs/ (Set up VMware host shared folder)     sudo cp -avr /mnt/hgfs/C/Perl64/cpan/sources/modules /etc/perl/CPAN        (copied folder from shared windows folder to ubuntu, for perl modules)     ctrl+flag(windows key)+arrow (same as windows key+arrow to position window)     sudo apt-get install nautilus-open-terminal (install nautilus)     nautilus -q (reset nautilus)        (now you can open terminal from current folder in file browse)      I tried the _sh_ syntax highlighting, but it doesn't highlight netstat or the second sudo command for some reason. Also, on second thought, I'm thinking I might as well keep this as simple text file and use 'Changelog' maybe to highlight the === underlining I have, because this is a mix of shell commands plus Linux shortcut keys, and I have the description in () brackets, so it may not work out anyway. Not sure why I want to keep track of dates, I know there's good references online anyways, so it's just for me to keep track of commands/use as a reference. Should I close/delete this question, or does anyone think this is at all useful, or have any good suggestions to keep track of useful commands? Thanks.


title: yum update fails: Error: Cannot retrieve repository metadata (repomd.xml) for repository …

text: I'm using CentOS 6.3. When I try to update my system with yum I have this message: `yum update`               Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirrors.ircam.fr      * centosplus: miroir.univ-paris13.fr      * extras: mirrors.ircam.fr      * update: centos.quelquesmots.fr     http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again      `yum clean all`               Loaded plugins: fastestmirror     Cleaning repos: CactiEZ addons base centosplus extras pgdg93 update     Cleaning up Everything     Cleaning up list of fastest mirrors      `yum check`               Loaded plugins: fastestmirror     check all      `yum erase apf`               Loaded plugins: fastestmirror     Setting up Remove Process     No Match for argument: apf     Determining fastest mirrors      * base: centos.mirror.fr.planethoster.net      * centosplus: centos.mirror.fr.planethoster.net      * extras: mirrors.ircam.fr      * update: centos.quelquesmots.fr     CactiEZ                                                | 2.9 kB     00:00     CactiEZ/primary_db                                     |  13 kB     00:00     http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again      `yum upgrade`               Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: centos.mirror.fr.planethoster.net      * centosplus: centos.mirror.fr.planethoster.net      * extras: mirrors.ircam.fr      * update: centos.quelquesmots.fr     http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again      My yum.conf               [main]     cachedir=/var/cache/yum/$basearch/$releasever     keepcache=0     debuglevel=2     logfile=/var/log/yum.log     exactarch=1     obsoletes=1     gpgcheck=1     plugins=1     installonly_limit=5     bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum     distroverpkg=centos-release


title: Bash Autocompletion (rather than tab completion)

text: How can I make bash show completion suggestions without having to press [tab]. I'd like the suggestions to update on each character I add and maybe to have the ability to quickly pick an option. I'd like it to work like an IDE. I want this because it would be faster.


title: Switch from grep to sed

text: I have a files `students.txt`, with lines of the form:               Surname, Forename: Day.Month.Year: Degree      For example:               Smith, John: 15.01.1986: MSc IT     Taylor, Susan: 04.05.1987: MSc IT     Thomas, Steve: 19.04.1986: MSc MIT     Sellen, Jo: 03.07.1987: MSc CSE      How can I change the command below into a `sed` command to return all the surnames of students who were born in 1987?               $ grep 1987 students.txt | grep -o "^\(.*\),"


title: Standard Terminal Font Aspect Ratio

text: What is the aspect ratio of a mono font that's made for terminal use, or more specifically, the size of the cell that any single character would fill? I've read that a standard terminal is `80x24` columns by rows, and that the standard terminal screen is 4:3. So, considering that information: > Each cell is 4/80ths of the screen's width, or 1/20th, and each cell is > 3/24ths of the screen's height, or 1/8. > > 1/20:1/8 = 1:20/8 = 1:2.5 Does this sound right? I'm curious because I would like to make a few games for iOS, and I would like to emulate the feeling of a terminal and I believe dimensions are important.


title: Do we need to configure postfix for using Google Apps gmail?

text: Do we need to configure postfix to use Google Apps gmail account or adding the correct MX records is sufficient. I'm trying to use Google Apps gmail account for my domain. Hosted on CentOS 6 VPS. I have 12 emails in total. One of which is for mailing list subscription using mailchimp (sending newletter). Out of the remaining emails, one I wish to set for auto reply. Remaining 10 are to be used with Google Apps gmail account. So far, I was able to verify my domain with google. I've added MX records correctly as per Google's recommendations. I am receiving bounce mail if I try to send email to that account stating that server gave a 550 5.1.1 Do I need to configure postfix for this? If yes, is there any guide or reference for this?


title: How to install easy_install using non-default Python Interpreter on CentOS?

text: I have downloaded, compiled and installed Python 2.7 on CentOS. I would like to download and install easy_install (and pip) for it but I am a little bit confused as to how to do that. How can I proceed to get setuptools and easy_install and pip using a non- default Python installation installed in `/usr/local/`?


title: How to disable Switch User option from Fedora 15

text: Is there a way to disable the **Switch User** option from a locked screen on Fedora 15? I've tried this way, but no luck, since `gconf-editor` has no effect.


title: Where is weather indicator on Linux Mint?

text: I've installed a weather indicator (name of the indicator is My-Weather indicator) on my Linux Mint 14 successfully. I've installed it by using terminal with the following commands               - sudo add-apt-repository ppa:atareao/atareao     - sudo apt-get update     - sudo apt-get install my-weather-indicator      It works great, but when I change the weather updates source to Yahoo, then suddenly it's gone. I've restarted my PC many times, but no luck. Every time when I click on the icon to open it, the mouse pointer shows busy for few seconds, seems it's gonna start, but nothing happens. After that I opened system monitor to see the running processes, weather indicator isn't even on the list. I really love that indicator, how can I get back that?


title: Routing private network to internet via 2 gateways

text: I have the current set up for an embedded environment:               Embedded Target (192.168.0.200) -----> Virtual Machine (VMWare) (2 NIC's - 192.168.0.2 (Target Port) and 192.168.49.69 (NAT Port to host)) ------> NAT on Windows PC ----> internet      What I would like to do is allow the Embedded target to access the internet.   1. Is this possible? The Virtual machine can access the internet fine through the NAT on the Virtual machine, I just do not know how to route the embedded target to the internet. There are also other devices on the 192.168.0.x network that access the virtual machine. Thanks.


title: shell script  to execute in root mode

text: I need execute script that have commands which should be run in root mode. If I put `sudo` before command then when I run script I see permission denied ( I don't have a chance to write password). If I run script with sudo then it writes - command not found. If I put `sudo su` in the beginning of the script then after I inter password nothing happens. Script executes only when exit root mode. How can make such script? Thank you.


title: Rebinding/disabling CTRL+ALT+F#

text: I have an application that binds CTRL+ALT+F7, but my linux machine seems to catch the keystroke. Is there a way to rebind/disable this key? A recompile of the kernel is an acceptable answer. The distributions in question are Fedora 16 and Ubuntu 11.10.


title: Where do I find Mandriva netinstall?

text: Where do I find Mandriva Linux netinstall for i386? Do they even have a Mandriva netinstall?


title: Reference prior command output / terminal screen contents in current command line

text: I often need to copy an output line in Bash in its entirety:               $ grep -ilr mysql_connect *     httpdocs/includes/config.php     httpdocs/admin/db.php     statistics/logs/error_log     $ vim httpdocs/includes/config.php      Is there any way to configure a Bash or Tmux shortcut for `three lines up`, like perhaps `@@3`:               $ grep -ilr mysql_connect *     httpdocs/includes/config.php     httpdocs/admin/db.php     statistics/logs/error_log     $ vim @@3 # This would be the equivalent of vim httpdocs/includes/config.php (three lines up)      The shortcut does not need to be `@@`, anything else would do. Ideally this would work in any Bash, but a tmux shortcut would work too. Note that I am familiar with tmux and screen copy and paste (enter paste mode, move to copy, come back, paste), but I am hoping for something that I could use easier (@@N) as I seem to do this often.


title: Cron does not print to syslog

text: I have following `crontab` file -               # /etc/crontab: system-wide crontab     # Unlike any other crontab you don't have to run the `crontab'     # command to install the new version when you edit this file     # and files in /etc/cron.d. These files also have username fields,     # that none of the other crontabs do.          SHELL=/bin/sh     PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin          # m h dom mon dow user  command     17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly     25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )     47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )     52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )          * * * * * mango echo hi >> /home/mango/test      I restarted the service using `sudo service cron restart` but the file does not appear. So I checked the log file to see the issue.               Sep 18 09:24:41 dpiplserver rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="869" x-info="http://www.rsyslog.com"] rsyslogd was HUPed     Sep 18 09:24:51 dpiplserver anacron[1157]: Job `cron.daily' terminated     Sep 18 09:24:51 dpiplserver anacron[1157]: Normal exit (1 job run)     Sep 18 09:39:01 dpiplserver CRON[2349]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)     Sep 18 10:09:01 dpiplserver CRON[2399]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)     Sep 18 10:16:08 dpiplserver kernel: [ 4726.374034] usb 2-1.5: new high-speed USB device number 3 using ehci_hcd     Sep 18 10:39:01 dpiplserver CRON[2803]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)     Sep 18 10:50:21 dpiplserver kernel: [ 6773.998690] init: cron main process (1192) killed by TERM signal     Sep 18 10:50:21 dpiplserver cron[2880]: (CRON) INFO (pidfile fd = 3)     Sep 18 10:50:21 dpiplserver cron[2881]: (CRON) STARTUP (fork ok)     Sep 18 10:50:21 dpiplserver cron[2881]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 10:50:21 dpiplserver cron[2881]: (CRON) INFO (Skipping @reboot jobs -- not system startup)     Sep 18 10:52:17 dpiplserver kernel: [ 6890.091067] init: cron main process (2881) killed by TERM signal     Sep 18 10:52:17 dpiplserver cron[2905]: (CRON) INFO (pidfile fd = 3)     Sep 18 10:52:17 dpiplserver cron[2906]: (CRON) STARTUP (fork ok)     Sep 18 10:52:17 dpiplserver cron[2906]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 10:52:17 dpiplserver cron[2906]: (CRON) INFO (Skipping @reboot jobs -- not system startup)     Sep 18 10:54:41 dpiplserver kernel: [ 7033.797057] init: cron main process (2906) killed by TERM signal     Sep 18 10:54:41 dpiplserver cron[2937]: (CRON) INFO (pidfile fd = 3)     Sep 18 10:54:41 dpiplserver cron[2938]: (CRON) STARTUP (fork ok)     Sep 18 10:54:41 dpiplserver cron[2938]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 10:54:41 dpiplserver cron[2938]: (CRON) INFO (Skipping @reboot jobs -- not system startup)     Sep 18 10:56:01 dpiplserver cron[2938]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 10:56:57 dpiplserver kernel: [ 7168.922614] init: cron main process (2938) killed by TERM signal     Sep 18 10:56:57 dpiplserver cron[2953]: (CRON) INFO (pidfile fd = 3)     Sep 18 10:56:57 dpiplserver cron[2954]: (CRON) STARTUP (fork ok)     Sep 18 10:56:57 dpiplserver cron[2954]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 10:56:57 dpiplserver cron[2954]: (CRON) INFO (Skipping @reboot jobs -- not system startup)     Sep 18 10:59:34 dpiplserver kernel: [ 7325.393315] init: cron main process (2954) killed by TERM signal     Sep 18 10:59:34 dpiplserver cron[2967]: (CRON) INFO (pidfile fd = 3)     Sep 18 10:59:34 dpiplserver cron[2968]: (CRON) STARTUP (fork ok)     Sep 18 10:59:34 dpiplserver cron[2968]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 10:59:34 dpiplserver cron[2968]: (CRON) INFO (Skipping @reboot jobs -- not system startup)     Sep 18 11:00:21 dpiplserver kernel: [ 7372.324581] init: cron main process (2968) killed by TERM signal     Sep 18 11:00:21 dpiplserver cron[2977]: (CRON) INFO (pidfile fd = 3)     Sep 18 11:00:21 dpiplserver cron[2978]: (CRON) STARTUP (fork ok)     Sep 18 11:00:21 dpiplserver cron[2978]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 11:00:21 dpiplserver cron[2978]: (CRON) INFO (Skipping @reboot jobs -- not system startup)     Sep 18 11:09:01 dpiplserver CRON[3060]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)     Sep 18 11:09:18 dpiplserver crontab[3068]: (mango) LIST (mango)     Sep 18 11:09:50 dpiplserver crontab[3089]: (root) LIST (root)     Sep 18 11:13:34 dpiplserver kernel: [ 8163.398965] init: cron main process (2978) killed by TERM signal     Sep 18 11:13:34 dpiplserver cron[3144]: (CRON) INFO (pidfile fd = 3)     Sep 18 11:13:34 dpiplserver cron[3145]: (CRON) STARTUP (fork ok)     Sep 18 11:13:34 dpiplserver cron[3145]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 11:13:34 dpiplserver cron[3145]: (CRON) INFO (Skipping @reboot jobs -- not system startup)     Sep 18 11:15:22 dpiplserver kernel: [ 8271.390434] init: cron main process (3145) killed by TERM signal     Sep 18 11:15:22 dpiplserver cron[3163]: (CRON) INFO (pidfile fd = 3)     Sep 18 11:15:22 dpiplserver cron[3164]: (CRON) STARTUP (fork ok)     Sep 18 11:15:22 dpiplserver cron[3164]: (*system*) INSECURE MODE (group/other writable) (/etc/crontab)     Sep 18 11:15:22 dpiplserver cron[3164]: (CRON) INFO (Skipping @reboot jobs -- not system startup)      I was expecting that the log file would either show that it run the command or the error it encountered. Why does it print neither success nor error?


title: SVN failing to create SASL context

text: Trying to execute the command               svn log svn://[my server address]/path/to/repository      nets me the following:               svn: E170001: Unable to connect to a repository at URL 'svn://[my server address]/path/to/repository'     svn: E170001: Could not create SASL context: generic failure      Some quick googling reveals a possible solution:               sudo port activate cyrus-sasl2 @2.1.23_3+kerberos      However, before I attempt this, I would like to know a couple things.   1. What exactly is going on?   2. What does this command do? How does it fix the problem? EDIT: I am not using SASL, nor do I wish to. I don't actually have Cyrus SASL installed.


title: Will incron's IN_CREATE event give me a blank file?

text: I want to monitor a directory for new files, which will be created by another process. I plan to use `incrod` to do this. I am not interested in reacting to changes in files, as the files should never be updated. Therefore the `IN_CREATE` event seems the sensible option to listen for. However, I am unsure, if I listen for that event, could I end up with an empty file (before the other process has written any information to it)? Should I use the `IN_WRITE_CLOSE` event instead?


title: Wait for multiple files to be finished downloading

text: I have the following script which checks if there is a file in a folder and if the file is stable (this is for large video file I am receiving).               #!/bin/bash          cdate1=$(date +%Y%m%d-%T)     folder1="/path-to-folder"          cd $folder1          while file=$(ls "$folder1")           [ -z "$file" ]             do sleep 10             done                 echo "There is a file in the folder at $cdate1"                 size1=$(stat -c '%s' "$file")                 echo "The size1 is $size1"                 sleep 30                 size2=$(stat -c '%s' "$file")                 echo "The size2 is $size2"             if [ $size1 = $size2 ]             then                 ls -l                 echo "Start converting"             else                  echo "Restart the script"             fi      How to modify the script so it can check multiple files in the same folder and after all of them are stable to start the conversion script?


title: Get list of subdirectories which contain a file matching a string

text: How can I get a list of the subdirectories which contain a file matching a particular string? More specifically, I am looking for directories which contain a file with the letter 'f' somewhere occurring in the file name. Ideally, the list would not have duplicates and only contain the path without the filename.


title: How to insert a line into text document right before line containing some text in bash?

text: I have a variable say `$strToInsert` I have a file `file.html` I wonder how to find last appearence of `</head>` and insert a new line before line with it and fill it with `$strToInsert` contents? Update: Here is what I have:               GACODE="UA-00000000-1"          if [ "$2" = "" ]     then         echo "Usage: $0 <url to extract doxygen generated docs into> <GA tracker code if needed>"         echo "Using default"     else         GACODE = $2     fi          GASTR=""      but when I try               sed -i 's##'$GASTR'\n#' header.html      I get:               sed: -e expression #1, char 21: unterminated `s' command      Whats wrong with my code?


title: using logrorate with a complex logging directory

text: An application has a log directory, in which a alot of log output is created. The file structure in this log directory looks something like this:               localhost:/var/log/myapp # ls          appClient22334.a    appClient22336.a    appClient22338.a     appClient22334.b    appClient22336.b    appClient22338.b         appClient22334.c    appClient22336.c    appClient22338.c     appClient22335.a    appClient22337.a    appClient22339.a     appClient22335.b    appClient22337.b    appClient22339.b     appClient22335.c    appClient22337.c    appClient22339.c      Every day the application generates hundreds of those files, which are all to be stored. The numbers are incrementing. For most purposes I use logrotate to store and compress log files on a daily base, but in this case I fail to see how this could be done. The ideal solution would be to have something like               appClient.20120324.gzip     appClient.20120325.gzip     appClient.20120326.gzip      Can anyone of you nudge me into the right direction, if this can be done while using logrotate (maybe a clever way to use `prerotate`?), or if it is faster/easier to write a specific bash script?


title: setting up pecl for php5 in Amazon Linux

text: I have a webserver (development) using php5. I need to install php extension pecl as shown on this link http://uk.php.net/manual/en/java.installation.php Now, this above link has instruction for php4. We need it for php5. At the moment, the following php packages are installed on php5 machine               php-common-5.3.28-1.5.amzn1.x86_64     php-pdo-5.3.28-1.5.amzn1.x86_64     php-mbstring-5.3.28-1.5.amzn1.x86_64     php-xml-5.3.28-1.5.amzn1.x86_64     php-pear-1.9.4-20.15.amzn1.noarch     php-cli-5.3.28-1.5.amzn1.x86_64     php-5.3.28-1.5.amzn1.x86_64     php-pecl-geoip-1.0.8-3.el6.x86_64     php-mysql-5.3.28-1.5.amzn1.x86_64     php-process-5.3.28-1.5.amzn1.x86_64      I can also see the pecl binary               # which pecl     /usr/bin/pecl      From this link http://uk.php.net/manual/en/java.installation.php, I understand that we need to   1. Install Java JDK   2. Record JDK path   3. Compile PHP with: --with-java=/path/to/jdk Since pecl is already installed, I am not sure how I can perform the third action above. I am not sure how to go ahead with this setup.


title: Replace using VIM, reuse part of the search pattern

text: I am working with `VIm` and trying to set up a search and replace command to do some replacements where I can re-use the regular expression that is part of my search string. A simple example would be a line where I want to replace `(10)` to `{10}`, where 10 can be any number. I came this far                 .s/([0-9]*)/what here??/      which matches exactly the part that I want. Now the replacement, I tried                 .s/([0-9]*)/{\0}/      But, this gives as output `{(10)}` Then, I tried                .s/(\zs[0-9]*\ze)/{\0}/      However, that gave me `({10})`, which I also close, but not what I want. I think I need some other kind of marking/back-referencing instead of this `\0`, but I don't know where to look. So the question is, can this be done in vim, and if so, how?


title: Cannot connect to ssh server

text: I am having trouble connecting to my ssh server. It responds with a lengthy error message about no network etc. but it is the last message that concerns me: > Sometimes, such troubles can be caused by a misconfigured firewall. How can I check the firewall if I cannot connect to ssh? I am running plesk 11.5 control panel and CentOS 6. Is this something I can do from plesk? I can see that the firewall in plesk is set to allow all for ssh, but I cannot see way to disable the firewall to test ssh connection. Can this be done from plesk? It is driving me absolutely bananas and I would be grateful if someone could shed some light as to how I can proceed. Many thanks for your help.


title: lftp mirror permission denied?

text: I have mirrored a public html folder to my new openvz but it gives me permission denied error on some files. I have compared the size of the mirrored folder and it's less then the original. How can I syncronize the folder in the right way? I need to move my website to a new openvz.


title: Set a callback for when a certain process is spawned

text: The script I'm writing launches process A, which after an uncertain amount of time, launches a child process B. I need the script to execute a command C which depends on process B. But B might not be there at call time! **How to wait until a process with a certain given name is spawned?** I reckon I could just blindly poll/wait inside an infinite loop but maybe there's a fancier solution...


title: Passing arguments from a file to a bash script

text: I' ve got this situation:               ./     ./myscript.sh     ./arguments.txt     ./test.sh      Inside myscript.sh, i have to run the file test.sh, passing to it the arguments contained inside arguments.txt. _myscript.sh_ is:               arguments=$(cat arguments.txt)     source test.sh $arguments      This works well if if _arguments.txt_ contains max one argument:               firstargument       The substitution is:               ++ source test.sh 'firstargument'      But, and here is the real problem, with two arguments it does this:               ++ source test.sh 'firstargument secondargument'      Also, i don't know in advice the number of arguments inside arguments.txt. There can be zero, one or more. Thanks a lot for help in advice!


title: How to execute a script at the start and end of every application?

text: I am trying to log the applications that a user opens/closes. Is there a way to execute a script (Java,Python,etc) everytime an application (like firefox) is opened and closed?


title: How to print only defined variables (shell and/or environment variables) in bash

text: The bash builtin command `set`, if invoked without arguments, will print all shell and environment variables, but also all defined functions. This makes the output unusable for humans and difficult to `grep`. How can I make the bash builtin command `set` print only the variables and not the functions? Are there other commands which prints only the shell variables, without the functions? Note: bash differentiates between shell variables and environment variables. see here Difference between environment variables and exported environment variables in bash


title: How to check, which limit was exceeded? (Process terminated because of ulimit. )

text: Let's assume process runs in ulimited environment :               (     ulimit  ... -v ... -t ... -x 0 ...     ./program     )      Program is terminated. There might be many reasons : memory/time/file limit exceeded ; just simple segfault ; or even normal termination with return code 0. How to check what was the reason of program termination, without modifying program? P.S. I mean "when binary is given". Maybe some wrapper (ptrace-ing etc) might help?


title: Is it possible to choose which X display a program instance should run on?

text: If there are multiple X Windows running on a system, is it possible get a program to run on a particular window? How would you identify the Window and get the program to run there? I'm assuming that I have whatever permissions are necessary to run such a program.


title: Where does postfix store email?

text: I can't find any documentation on how postfix stores email. Where is it stored, and in what format? I'm using Ubuntu server 11


title: Syntax error comparing floats with bc

text: I'm trying to use the comparison operator of `bc` and I'm getting a "syntax error on line 1 stdin" error. I need to use the comparison functionality within a korn script because korn doesn't handle floating points well. Example usage below:               echo "scale=2; 3.2 > 3" | bc


title: Pipes vs process substitution

text: While trying the `cat "$@"` trick to read from either standard input _or_ given files, it turned out that _pipe and process substitution handle a missing trailing newline differently_ :               printf %s foo > test.txt          unset REPLY     while read     do         :     done < <(cat test.txt)     echo "$REPLY" # Prints foo          unset REPLY     cat test.txt | while read     do         :     done     echo "$REPLY" # Prints nothing!      Is this by design? Is this "feature" documented anywhere? D'oh! @fered had the right idea - It's just another example of how variable values are lost because piped commands are run in a subshell.


title: Awesome WM loads personal rc.lua but then overwrites with system settings

text: I just started playing with awesome-wm. Sometimes, when I reload my config, the settings hold. Other times, I can see some settings take for a second, but then are overridden by the defaults. I copied the /etc/xdg/awesome directory to ~/.config/awesome as suggested on the wiki. I've also noticed some other issues with these steps, and I'm not sure if it's me, my system, or what. Other relevant issues include:   * Theme loads, and then loads the default   * Network Widget on the link above doesn't load (or I don't see it)   * Changing the tags results in 18 tags. The ones I changed, and 1-9 again. Any thoughts on what I'm doing wrong?


title: How can I find out the estimated power use of my desktop computer?

text: Is there a way to get the computer power usage instead of battery load tracking (what for instance seemingly `powertop` does), which is obviously not too useful on desktops?


title: How to block glyph fallback on Linux?

text: I want to block font substitution in specific apps on Linux, but my research indicates that it might be controlled only at the system level, probably with fontconfig. I have found some discussion of how to direct fontconfig to substitute particular fonts, but nothing on how to competely turn off the feature. The best answer would be how to disable glyph fallback for individual apps, but doing it system wide would be better than nothing.